diff options
| author | Alec Goncharow <alec.goncharow@gmail.com> | 2018-10-07 13:54:13 -0400 |
|---|---|---|
| committer | Alec Goncharow <alec.goncharow@gmail.com> | 2018-10-07 13:54:13 -0400 |
| commit | 2825fe0b91dc8f8abb318c83b85f893c35852e69 (patch) | |
| tree | 43cf9cb085692efb7038a7f728263276cae6e0d4 /.config/i3blocks/scripts/calendar | |
| parent | dc3939e1d6ade0b378837e4f6b427273d4a5c227 (diff) | |
saving desktop config for reinstall
Diffstat (limited to '.config/i3blocks/scripts/calendar')
| -rwxr-xr-x | .config/i3blocks/scripts/calendar | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/.config/i3blocks/scripts/calendar b/.config/i3blocks/scripts/calendar new file mode 100755 index 0000000..fe09fcc --- /dev/null +++ b/.config/i3blocks/scripts/calendar @@ -0,0 +1,38 @@ +#! /bin/sh + +width=200 +height=200 +datefmt="+%a %Y-%m-%d" + +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) + + # the position of the upper left corner of the popup + posX=$(($BLOCK_X - $width)) + posY=$(($BLOCK_Y)) #+ $height)) + + i3-msg -q "exec yad --calendar \ + --width=$width --height=$height \ + --fixed \ + --close-on-unfocus --no-buttons \ + --posx=$posX --posy=$posY \ + > /dev/null" +esac +date "$datefmt" |
