Background changer for Gnome

This commit is contained in:
Filippo Berto 2021-09-01 11:24:55 +02:00
parent ff081bbaf1
commit 12fd3bc3a2
2 changed files with 10 additions and 3 deletions

View file

@ -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"
''

View file

@ -1,7 +1,5 @@
{ pkgs, config, ... }:
let
fehCmd = "${pkgs.feh}/bin/feh";
backgrounds_directory = ~/Immagini/Sfondi;
update_time = "10m";
in
{