blob: fe09fcc4764c89a53d2c24a65e641e09075ef879 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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"
|