From dd9ef0eda523a37baddd2635d5d35663c3e7746f Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Mon, 6 Nov 2023 21:00:12 -0800 Subject: [PATCH] some work on the moon/sun-phase script --- .../ewwbar/eww-config/scripts/clock_background | 3 +++ .../eww-config/scripts/clock_background.sh | 17 +++++++++++++++++ modules/ewwbar/eww-config/scripts/moontime | 9 ++++++--- modules/ewwbar/eww-config/scripts/suntime | 6 ++++-- 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100755 modules/ewwbar/eww-config/scripts/clock_background.sh diff --git a/modules/ewwbar/eww-config/scripts/clock_background b/modules/ewwbar/eww-config/scripts/clock_background index 8b13789..25e54b8 100755 --- a/modules/ewwbar/eww-config/scripts/clock_background +++ b/modules/ewwbar/eww-config/scripts/clock_background @@ -1 +1,4 @@ +#!/usr/env bash + +echo "{ }" diff --git a/modules/ewwbar/eww-config/scripts/clock_background.sh b/modules/ewwbar/eww-config/scripts/clock_background.sh new file mode 100755 index 0000000..4bae7d6 --- /dev/null +++ b/modules/ewwbar/eww-config/scripts/clock_background.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + + +moonstate=$(gcal --resource-file=$HOME/.config/eww/scripts/moontime | awk '{print $4}') + +sunstate=$(gcal --resource-file=$HOME/.config/eww/scripts/suntime | awk '{print $4}') + +moonrise=$(echo $moonstate | awk '{print $1}') +moonset=$(echo $moonstate | awk '{print $2}') +moonphase=$(echo $moonstate | awk '{print $3}') + +sunrise=$(echo $sunstate | awk '{print $1}') +sunset=$(echo $sunstate | awk '{print $2}') + + + +echo "{ \"has_color\": false, \"is_sun\": true, \"gradient_angle\": 45 }" diff --git a/modules/ewwbar/eww-config/scripts/moontime b/modules/ewwbar/eww-config/scripts/moontime index 0d6204c..5d14eda 100644 --- a/modules/ewwbar/eww-config/scripts/moontime +++ b/modules/ewwbar/eww-config/scripts/moontime @@ -2,7 +2,10 @@ ; %( = moonrise %) moonset +XX-XX == lat long, ,-X:XX time-offset from UTC ; gcal --resource-file= -H no -ox ; -H no == no highlight -ox don't show date on every line -0 Moonrise is at %(+47.20-122.24,-8:00 -0 Moonset is at %)+47.20-122.24,-8:00 -0 Moon phase %O +; 0 Moonrise is at %(+47.20-122.24,-8:00 +; 0 Moonset is at %)+47.20-122.24,-8:00 +; 0 Moon phase %O +0 %(+47.20-122.24,-8:00 +0 %)+47.20-122.24,-8:00 +0 %O diff --git a/modules/ewwbar/eww-config/scripts/suntime b/modules/ewwbar/eww-config/scripts/suntime index 7b663a8..e5e991e 100644 --- a/modules/ewwbar/eww-config/scripts/suntime +++ b/modules/ewwbar/eww-config/scripts/suntime @@ -1,3 +1,5 @@ ; %o = sunrise %) sunset +XX-XX == lat long, ,-X:XX time-offset from UTC -0 Sunrise is at %o+47.20-122.24,-8:00 -0 Sunset is at %s+47.20-122.244,-8:00 +; 0 Sunrise is at %o+47.20-122.24,-8:00 +; 0 Sunset is at %s+47.20-122.244,-8:00 +0 %o+47.20-122.24,-8:00 +0 %s+47.20-122.244,-8:00