This commit is contained in:
iFargle 2024-01-05 20:38:54 +09:00
parent a33367727d
commit acb771edb9

View file

@ -35,8 +35,10 @@
enable = true; enable = true;
path = [ pkgs.curl ]; path = [ pkgs.curl ];
script = '' script = ''
echo "Activating get-theme-times systemd service"
curl -s wttr.in/?format=%S > /tmp/wttr.sunrise curl -s wttr.in/?format=%S > /tmp/wttr.sunrise
curl -s wttr.in/?format=%s > /tmp/wttr.sunset curl -s wttr.in/?format=%s > /tmp/wttr.sunset
echo "get-theme-times - complete"
''; '';
after = [ "networking-online.target" ]; after = [ "networking-online.target" ];
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
@ -45,6 +47,7 @@
set-theme = { set-theme = {
enable = true; enable = true;
script = '' script = ''
echo "set-theme.service - Checking for theme settings"
if [ ! -f /tmp/wttr.sunrise ] ; then if [ ! -f /tmp/wttr.sunrise ] ; then
systemctl --user start get-theme-times.service systemctl --user start get-theme-times.service
fi fi
@ -56,6 +59,7 @@
else else
/run/current-system/sw/bin/plasma-apply-colorscheme -platform offscreen ArcDark /run/current-system/sw/bin/plasma-apply-colorscheme -platform offscreen ArcDark
fi fi
echo "set-theme.service - Complete"
''; '';
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
}; };
@ -65,7 +69,7 @@
"get-theme-times" = { "get-theme-times" = {
enable = true; enable = true;
partOf = [ "get-theme-times.service" ]; partOf = [ "get-theme-times.service" ];
timerConfig.OnCalendar = ["*:37"]; timerConfig.OnCalendar = ["*:40"];
timerConfig.OnBootSec= [ "2 min" ]; timerConfig.OnBootSec= [ "2 min" ];
}; };
"set-theme" = { "set-theme" = {