aboutsummaryrefslogtreecommitdiff
path: root/i3blocks/i3moon.sh
diff options
context:
space:
mode:
Diffstat (limited to 'i3blocks/i3moon.sh')
-rwxr-xr-xi3blocks/i3moon.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/i3blocks/i3moon.sh b/i3blocks/i3moon.sh
new file mode 100755
index 0000000..fcb45dc
--- /dev/null
+++ b/i3blocks/i3moon.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Shows an emoji with the phase of the moon
+
+pom | grep -q "New Moon" && moon=🌑
+pom | grep -q "Waxing Crescent" && moon=🌒
+pom | grep -q "First Quarter" && moon=🌓
+pom | grep -q "Waxing Gibbous" && moon=🌔
+pom | grep -q "Full moon" && moon=🌕
+pom | grep -q "Waning Gibbous" && moon=🌖
+pom | grep -q "Last Quarter" && moon=🌗
+pom | grep -q "Waning Crescent" && moon=🌘
+
+case $BLOCK_BUTTON in
+ 1) dunstify "$moon $(pom) $moon";;
+esac
+
+echo "$moon"
+