aboutsummaryrefslogtreecommitdiff
path: root/i3blocks/i3moon.sh
blob: 4bacaf6ff8f6dc243c89c7afea781aa50557db43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# Shows an emoji with the phase of the moon

[ ! -f "/bin/pom" ] && echo "🌜 bsd-games not installed. 🌛" && exit 0
pom | fgrep -q "New" && moon=🌚
pom | fgrep -q "Waxing Crescent" && moon=🌒
pom | fgrep -q "First Quarter" && moon=🌓
pom | fgrep -q "Waxing Gibbous" && moon=🌔
pom | fgrep -q "is Full" && moon=🌝
pom | fgrep -q "Waning Gibbous" && moon=🌖
pom | fgrep -q "Last Quarter" && moon=🌗
pom | fgrep -q "Waning Crescent" && moon=🌘

echo "$moon"

case $BLOCK_BUTTON in
	1) dunstify -r "$(dunstifyIDs.sh "moon")" "$moon $(pom) $moon";;
	3) dunstify -r "$(dunstifyIDs.sh "moon")" "moon" "$(curl 'wttr.in/moon?0T')";;
esac