From 12fd3bc3a2c3193d3dec0d47b71f2d39b3ce0fe2 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Wed, 1 Sep 2021 11:24:55 +0200 Subject: [PATCH] Background changer for Gnome --- custom/update-background/default.nix | 11 ++++++++++- modules/update_background.nix | 2 -- 2 files changed, 10 insertions(+), 3 deletions(-) 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 {