This commit is contained in:
iFargle 2024-01-03 09:08:23 +09:00
parent e3039b6cde
commit bc9373dbdb

View file

@ -46,11 +46,11 @@
enable = true; enable = true;
path = [ pkgs.at pkgs.fx pkgs.nodejs pkgs.bash ]; path = [ pkgs.at pkgs.fx pkgs.nodejs pkgs.bash ];
script = '' script = ''
source ~/.bashrc SUNRISE=`fx /tmp/wttr.in .weather[0].astronomy[0].sunrise`
# It doesn't get here for some reason NOW=`date +'%I:%M %p'`
TIME=`cat /tmp/wttr.in | grep sunrise | head -n 1 | awk {'print $2" "$3'} | sed -e 's/"//g' | sed -e 's/,//'` if [[ $SUNRISE == $NOW ]] ; then
echo "Time to run at: $TIME" plasma-apply-colorscheme -platform offscreen ArcDark
echo "plasma-apply-colorscheme -platform offscreen Arc" | at $TIME fi
''; '';
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
}; };
@ -58,11 +58,17 @@
enable = true; enable = true;
path = [ pkgs.at pkgs.fx pkgs.nodejs pkgs.bash ]; path = [ pkgs.at pkgs.fx pkgs.nodejs pkgs.bash ];
script = '' script = ''
source ~/.bashrc SUNSET=`fx /tmp/wttr.in .weather[0].astronomy[0].sunset`
# It doesn't get here for some reason NOW="04:56 PM"
TIME=`cat /tmp/wttr.in | grep sunset | head -n 1 | awk {'print $2" "$3'} | sed -e 's/"//g' | sed -e 's/,//'` echo "Sunset: $SUNSET."
echo "Time to run at: $TIME" echo "Now : $NOW."
echo "plasma-apply-colorscheme -platform offscreen ArcDark" | at $TIME 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"; serviceConfig.Type = "oneshot";
}; };