From bc9373dbdb200b12edd62840d0d19098b9adcc9d Mon Sep 17 00:00:00 2001 From: iFargle Date: Wed, 3 Jan 2024 09:08:23 +0900 Subject: [PATCH] test --- nixos/common/desktops/plasma6/default.nix | 26 ++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/nixos/common/desktops/plasma6/default.nix b/nixos/common/desktops/plasma6/default.nix index c7a9e33c..b96f458b 100644 --- a/nixos/common/desktops/plasma6/default.nix +++ b/nixos/common/desktops/plasma6/default.nix @@ -46,11 +46,11 @@ enable = true; path = [ pkgs.at pkgs.fx pkgs.nodejs pkgs.bash ]; script = '' - source ~/.bashrc - # It doesn't get here for some reason - TIME=`cat /tmp/wttr.in | grep sunrise | head -n 1 | awk {'print $2" "$3'} | sed -e 's/"//g' | sed -e 's/,//'` - echo "Time to run at: $TIME" - echo "plasma-apply-colorscheme -platform offscreen Arc" | at $TIME + SUNRISE=`fx /tmp/wttr.in .weather[0].astronomy[0].sunrise` + NOW=`date +'%I:%M %p'` + if [[ $SUNRISE == $NOW ]] ; then + plasma-apply-colorscheme -platform offscreen ArcDark + fi ''; serviceConfig.Type = "oneshot"; }; @@ -58,11 +58,17 @@ enable = true; path = [ pkgs.at pkgs.fx pkgs.nodejs pkgs.bash ]; script = '' - source ~/.bashrc - # It doesn't get here for some reason - TIME=`cat /tmp/wttr.in | grep sunset | head -n 1 | awk {'print $2" "$3'} | sed -e 's/"//g' | sed -e 's/,//'` - echo "Time to run at: $TIME" - echo "plasma-apply-colorscheme -platform offscreen ArcDark" | at $TIME + SUNSET=`fx /tmp/wttr.in .weather[0].astronomy[0].sunset` + NOW="04:56 PM" + echo "Sunset: $SUNSET." + echo "Now : $NOW." + if [[ $SUNSET != $NOW ]] ; then + echo "Not sunset." + fi + if [[ $SUNET == $NOW ]] ; then + echo "Setting ArcDark colorscheme" + plasma-apply-colorscheme -platform offscreen ArcDark + fi ''; serviceConfig.Type = "oneshot"; };