From b2a787ca6937cdfba182fd013d727076157f30b1 Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Mon, 26 Aug 2019 14:11:42 +0200 Subject: [PATCH] random-background: add option `enableXinerama` --- modules/services/random-background.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/services/random-background.nix b/modules/services/random-background.nix index 742642fb..789c9164 100644 --- a/modules/services/random-background.nix +++ b/modules/services/random-background.nix @@ -6,6 +6,11 @@ let cfg = config.services.random-background; + flags = lib.concatStringsSep " " ( + [ "--randomize" "--bg-${cfg.display}" ] + ++ lib.optional (!cfg.enableXinerama) "--no-xinerama" + ); + in { @@ -41,6 +46,16 @@ in as a duration understood by systemd. ''; }; + + enableXinerama = mkOption { + default = true; + type = types.bool; + description = '' + Will place a separate image per screen when enabled, + otherwise a single image will be stretched across all + screens. + ''; + }; }; }; @@ -56,7 +71,7 @@ in Service = { Type = "oneshot"; - ExecStart = "${pkgs.feh}/bin/feh --randomize --bg-${cfg.display} ${cfg.imageDirectory}"; + ExecStart = "${pkgs.feh}/bin/feh ${flags} ${cfg.imageDirectory}"; IOSchedulingClass = "idle"; };