aboutsummaryrefslogtreecommitdiff
path: root/i3blocks/i3moon.sh
blob: d691e8dd8f6bb4e5f06af795244f58c1ac967dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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";;
esac