From 8d4a021f3741a728f5b1aa7e0b406e43ff79b039 Mon Sep 17 00:00:00 2001 From: nerrufam <58603397+nerrufam@users.noreply.github.com> Date: Thu, 13 Feb 2020 13:38:29 +0100 Subject: [PATCH] know the phase of the moon with emoji and % (#482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 8 emoji for 8 main phases plus the % 'of full' 😉 dont forget to load it to your status bar --- .local/bin/statusbar/moonphase | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .local/bin/statusbar/moonphase diff --git a/.local/bin/statusbar/moonphase b/.local/bin/statusbar/moonphase new file mode 100644 index 0000000..6ccc81b --- /dev/null +++ b/.local/bin/statusbar/moonphase @@ -0,0 +1,18 @@ +#!/bin/sh + +mnphs=$(pom | grep -io 'new\|waxing cresent\|first quarter\|waxing gibbous\|full\|waning gibbous\|last quarter\|waning cresent' | grep -m1 '.') +prcnt=$(pom | grep -o '..%') + +case $mnphs in + "New") icon="🌑" ;; + "Waxing Cresent") icon="🌒" ;; + "First Quarter") icon="🌓" ;; + "Waxing Gibbous") icon="🌔" ;; + "Full") icon="🌕" ;; + "Waning Gibbous") icon="🌖" ;; + "Last Quarter") icon="🌗" ;; + "Waning Cresent") icon="🌘" ;; + *) echo errorrrr ;; +esac + +printf "%s %s\\n" "$icon" "$prcnt"