1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/configs/wallpaper.nix

40 lines
957 B
Nix
Raw Permalink Normal View History

2021-06-01 19:05:53 +02:00
{
2022-03-10 21:52:12 +01:00
pkgs,
lib,
...
2025-12-27 22:22:54 +01:00
}:
let
2024-01-08 14:55:04 +01:00
# url = "http://wallpaper.r/realwallpaper-krebs-stars-berlin.png";
url = "http://wallpaper.r/realwallpaper-krebs.png";
stateDir = "~/.cache/wallpaper";
2025-12-27 22:22:54 +01:00
in
{
systemd.user.services.wallpaper = {
2025-12-27 22:22:54 +01:00
wantedBy = [ "graphical-session.target" ];
after = [ "network.target" ];
2026-01-06 22:46:12 +01:00
path = [
pkgs.curl
pkgs.hyprland
];
script = ''
set -euf
2020-12-15 16:09:18 +01:00
mkdir -p ${stateDir}
chmod o+rx ${stateDir}
cd ${stateDir}
2026-01-06 22:46:12 +01:00
(${pkgs.curl}/bin/curl -s -o wallpaper.tmp -z wallpaper.tmp ${lib.escapeShellArg url} && cp wallpaper.tmp wallpaper.png) || :
hyprctl hyprpaper preload ${stateDir}/wallpaper.png
hyprctl hyprpaper wallpaper ",${stateDir}/wallpaper.png"
sleep 5
hyprctl hyprpaper unload unused
true
'';
startAt = "*:00,10,20,30,40,50";
serviceConfig = {
2026-01-06 22:46:12 +01:00
Restart = "on-failure";
RestartSec = "15s";
StartLimitBurst = 0;
};
2020-12-15 16:09:18 +01:00
};
2019-04-19 15:02:05 +02:00
}