#!/bin/bash DATEFMT=${DATEFMT:-"+%a %d.%m.%Y %H:%M:%S"} SHORTFMT=${SHORTFMT:-"+%H:%M:%S"} OPTIND=1 while getopts ":f:W:H:" opt; do case $opt in f) DATEFMT="$OPTARG" ;; W) WIDTH="$OPTARG" ;; H) HEIGHT="$OPTARG" ;; \?) echo "Invalid option: -$OPTARG" >&2 exit 1 ;; :) echo "Option -$OPTARG requires an argument." >&2 exit 1 ;; esac done case "$BLOCK_BUTTON" in 1|2|3) # Focus Thunderbird and open calendar i3-msg -q [class="Thunderbird" instance="Mail"] focus; \ sleep 0.005; \ xdotool key --clearmodifiers --delay 5 ctrl+shift+c esac echo "$LABEL$(date "$DATEFMT")" echo "$LABEL$(date "$SHORTFMT")"