summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar/moonphase
blob: d2bbad6187bd442e08839699954399d46def8d1f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

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:]]*%')
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

printf "%s %s\\n" "$icon" "$prcnt"