From a4d10d8ce31fc30fc96bfccb027728a0b98bc6b4 Mon Sep 17 00:00:00 2001 From: iFargle Date: Tue, 2 Jan 2024 21:26:44 +0900 Subject: [PATCH] Testing at jobs for setting themes --- nixos/common/desktops/plasma6/default.nix | 13 ++++++++++++- nixos/hosts/framework-server/cron.nix | 4 +--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/nixos/common/desktops/plasma6/default.nix b/nixos/common/desktops/plasma6/default.nix index 72683f57..ae447927 100644 --- a/nixos/common/desktops/plasma6/default.nix +++ b/nixos/common/desktops/plasma6/default.nix @@ -34,4 +34,15 @@ plasma-theme-switcher tailscale-systray ]; -} + + services.cron = { + enable = true; + systemCronJobs = [ + # Set the 'at' jobs for changing the theme + ''0 12 * * * albert curl -s wttr.in?format=j1 > /tmp/wttr.in'' + ''@reboot albert curl -s wttr.in?format=j1 > /tmp/wttr.in'' + ''@reboot albert sleep 10; echo "plasma-apply-colorscheme -platform offscreen Arc" | at `fx /tmp/wttr.in .weather[0].astronomy[0].sunrise`'' + ''@reboot albert sleep 10; echo "plasma-apply-colorscheme -platform offscreen ArcDark" | at `fx /tmp/wttr.in .weather[0].astronomy[0].sunset` '' + ]; + }; +} diff --git a/nixos/hosts/framework-server/cron.nix b/nixos/hosts/framework-server/cron.nix index e0518eca..11de421b 100644 --- a/nixos/hosts/framework-server/cron.nix +++ b/nixos/hosts/framework-server/cron.nix @@ -33,7 +33,7 @@ ''@daily root docker exec mastodon-web tootctl media remove-orphans'' ]; }; - +} # Old crontab: # # At reboot, apply the ip_tables modprobe so Wireguard works # @reboot /usr/sbin/modprobe ip_tables @@ -80,5 +80,3 @@ # # Set up DERP relay certs for headscale-derp: # DONE @hourly cp /Storage/Data/Docker/letsencrypt/certs/certs/\*.sysctl.io.crt /Storage/Data/Docker/letsencrypt/certs/certs/derp.sysctl.io.crt # DONE @hourly cp /Storage/Data/Docker/letsencrypt/certs/private/\*.sysctl.io.key /Storage/Data/Docker/letsencrypt/certs/private/derp.sysctl.io.key - -} \ No newline at end of file