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;
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";
};