diff --git a/home/tiling/wallpaper.nix b/home/tiling/wallpaper.nix index 76d65a7..958cb97 100644 --- a/home/tiling/wallpaper.nix +++ b/home/tiling/wallpaper.nix @@ -1,5 +1,6 @@ { pkgs, + config, ... }: { @@ -7,7 +8,7 @@ Unit.Description = "Wallpaper service using wbg (daemon)"; Service.ExecStart = '' ${pkgs.wbg}/bin/wbg -s \ - %h/.local/share/wallpaper/daily.jpg + %h/.local/share/wallpaper/daily-colored.jpg ''; Install.WantedBy = [ "niri.service" ]; }; @@ -45,7 +46,7 @@ ''; } ); - Service.ExecStartPost = "${pkgs.systemd}/bin/systemctl --user restart wbg-daemon.service"; + Service.ExecStartPost = "${pkgs.systemd}/bin/systemctl --user start gowall-convert.service"; Install.WantedBy = [ "niri.service" ]; }; @@ -55,4 +56,52 @@ Timer.Persistent = true; Install.WantedBy = [ "timers.target" ]; }; + + systemd.user.services.gowall-convert = { + Unit.Description = "Convert a wallpaper to the system color scheme"; + Unit.StartLimitBurst = 6; + Unit.StartLimitIntervalSec = "10m"; + Service.Restart = "on-failure"; + Service.RestartSec = "10s"; + Service.Type = "oneshot"; + Service.ExecStart = '' + ${pkgs.gowall}/bin/gowall convert \ + %h/.local/share/wallpaper/daily.jpg \ + --output %h/.local/share/wallpaper/daily-colored.jpg \ + -t nix + ''; + Service.ExecStartPost = "${pkgs.systemd}/bin/systemctl --user restart wbg-daemon.service"; + }; + + home.file.".config/gowall/config.yml".text = with config.scheme.withHashtag; '' + themes: + - name: "nix" + colors: + - "${base06}" + - "${base0F}" + - "${base17}" + - "${base0E}" + - "${base08}" + - "${base12}" + - "${base09}" + - "${base0A}" + - "${base0B}" + - "${base0C}" + - "${base15}" + - "${base16}" + - "${base0D}" + - "${base07}" + - "${base05}" + - "${base07}" + - "${base0D}" + - "${base0D}" + - "${base04}" + - "${base04}" + - "${base04}" + - "${base03}" + - "${base02}" + - "${base00}" + - "${base01}" + - "${base11}" + ''; }