inital commit
This commit is contained in:
25
.local/bin/statusbar/moonphase
Executable file
25
.local/bin/statusbar/moonphase
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Shows the current moon phase. Requires `pom-perl`.
|
||||
|
||||
mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.')
|
||||
prcnt=$(pom $1 | grep -o '[[:digit:]]*%' | grep -o '[[:digit:]]*' )
|
||||
case "$mnphs" in
|
||||
"New") icon="🌑" prcnt="0" ;;
|
||||
"Waxing Crescent") icon="🌒" ;;
|
||||
"First Quarter") icon="🌓" prcnt="50" ;;
|
||||
"Waxing Gibbous") icon="🌔" ;;
|
||||
"Full") icon="🌕" prcnt="100" ;;
|
||||
"Waning Gibbous") icon="🌖" ;;
|
||||
"Last Quarter") icon="🌗" prcnt="50" ;;
|
||||
"Waning Crescent") icon="🌘" ;;
|
||||
*) echo errorrrr ;;
|
||||
esac
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
1) $mnphs ;;
|
||||
2) $mnphs ;;
|
||||
3) notify-send " 🌜$(pom)" ;;
|
||||
esac
|
||||
|
||||
echo "$icon" "$prcnt"%
|
Reference in New Issue
Block a user