diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2021-09-20 21:37:34 +0200 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2021-09-20 21:37:34 +0200 |
| commit | d4c0f93e1d61960e6bd534ad29fc84a1190a8ff4 (patch) | |
| tree | 814a404de46751336494aaf0f3c23b1f260234e4 /home/config/i3/startup.nix | |
| parent | 6469af670d055c8f4a72a6e03a19d34f931ef177 (diff) | |
use lib.optional* functions
Diffstat (limited to 'home/config/i3/startup.nix')
| -rw-r--r-- | home/config/i3/startup.nix | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/home/config/i3/startup.nix b/home/config/i3/startup.nix index 3c7cdf3..cdad53c 100644 --- a/home/config/i3/startup.nix +++ b/home/config/i3/startup.nix @@ -6,31 +6,17 @@ in { autostart = { command, always ? false, notification ? false }: { inherit command always notification; }; - in (if (config.services.redshift.enable) then - [ (autostart { command = "systemctl --user start redshift"; }) ] - else - [ ]) ++ (if background-image != null then - [ - (autostart { - command = "${pkgs.feh}/bin/feh --bg-scale ${background-image}"; - }) - ] - else - [ ]) ++ (if config.services.screen-locker.enable then - [ - (autostart { - command = - "systemctl --user xidlehook.service"; - }) - ] - else - [ ]) ++ (if config.services.emacs.enable then - [ (autostart { command = "systemctl --user start emacs.service"; }) ] - else - [ ]) ++ [ - # Launch frequently used apps - (autostart { command = "thunderbird"; }) - (autostart { command = "signal-desktop"; }) - (autostart { command = ''i3-msg "workspace 10; exec keepassxc"''; }) - ]; + in (lib.optional config.services.redshift.enable + (autostart { command = "systemctl --user start redshift"; })) +++ (lib.optional (background-image != null) (autostart { + command = "${pkgs.feh}/bin/feh --bg-scale ${background-image}"; + })) ++ (lib.optional config.services.xidlehook.enable + (autostart { command = "systemctl --user xidlehook.service"; })) + ++ (lib.optional config.services.emacs.enable + (autostart { command = "systemctl --user start emacs.service"; })) ++ [ + # Launch frequently used apps + (autostart { command = "thunderbird"; }) + (autostart { command = "signal-desktop"; }) + (autostart { command = ''i3-msg "workspace 10; exec keepassxc"''; }) + ]; } |
