aboutsummaryrefslogtreecommitdiff
path: root/i3blocks/i3moon.sh
blob: e86c4cad9fc0b649a0e9aa566698c4f0dfa8a2e1 (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 | grep -q "New" && moon=🌚
pom | grep -q "Waxing Crescent" && moon=🌒
pom | grep -q "First Quarter" && moon=🌓
pom | grep -q "Waxing Gibbous" && moon=🌔
pom | grep -q "Full" && moon=🌝
pom | grep -q "Waning Gibbous" && moon=🌖
pom | grep -q "Last Quarter" && moon=🌗
pom | grep -q "Waning Crescent" && moon=🌘

echo "$moon"

case $BLOCK_BUTTON in
	1) dunstify -r "$(dunstifyIDs.sh "moon")" "$moon $(pom) $moon";;
esac