diff --git a/custom/update-background/default.nix b/custom/update-background/default.nix index 8ecf888..1ef856a 100644 --- a/custom/update-background/default.nix +++ b/custom/update-background/default.nix @@ -1,4 +1,12 @@ -{ lib, stdenv, feh, findutils, gnugrep, coreutils, writeScript, backgrounds_directory ? "$HOME/Immagini/Sfondi" }: +{ lib +, stdenv +, feh +, glib +, findutils +, gnugrep +, coreutils +, writeScript +, backgrounds_directory ? "$HOME/Immagini/Sfondi"}: let find = "${findutils}/bin/find"; grep = "${gnugrep}/bin/grep"; @@ -9,4 +17,5 @@ writeScript "update-background.sh" '' image=`${find} ${backgrounds_directory} -type f | ${grep} -v "/\." | ${shuf} -n 1` echo "image: $image" ${feh}/bin/feh --bg-fill --no-fehbg "$image" + ${glib}/bin/gsettings set org.gnome.desktop.background picture-uri "file://$image" '' diff --git a/modules/update_background.nix b/modules/update_background.nix index e392660..3613757 100644 --- a/modules/update_background.nix +++ b/modules/update_background.nix @@ -1,7 +1,5 @@ { pkgs, config, ... }: let - fehCmd = "${pkgs.feh}/bin/feh"; - backgrounds_directory = ~/Immagini/Sfondi; update_time = "10m"; in {