From 3bf3dea3208899eb0adc5fd419c9f79f2a2de288 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 10 Jan 2018 20:31:28 +0000 Subject: [PATCH] redshift: add option to start redshift tray applet --- modules/services/redshift.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/services/redshift.nix b/modules/services/redshift.nix index 9bf66f89..423b9fe1 100644 --- a/modules/services/redshift.nix +++ b/modules/services/redshift.nix @@ -87,6 +87,15 @@ in ''; }; + tray = mkOption { + type = types.bool; + default = false; + example = true; + description = '' + Start the redshift-gtk tray applet. + ''; + }; + extraOptions = mkOption { type = types.listOf types.str; default = []; @@ -118,8 +127,9 @@ in "-t ${toString cfg.temperature.day}:${toString cfg.temperature.night}" "-b ${toString cfg.brightness.day}:${toString cfg.brightness.night}" ] ++ cfg.extraOptions; + command = if cfg.tray then "redshift-gtk" else "redshift"; in - "${cfg.package}/bin/redshift ${concatStringsSep " " args}"; + "${cfg.package}/bin/${command} ${concatStringsSep " " args}"; RestartSec = 3; Restart = "always"; };