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/keybindings.nix | |
| parent | 6469af670d055c8f4a72a6e03a19d34f931ef177 (diff) | |
use lib.optional* functions
Diffstat (limited to 'home/config/i3/keybindings.nix')
| -rw-r--r-- | home/config/i3/keybindings.nix | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/home/config/i3/keybindings.nix b/home/config/i3/keybindings.nix index b35dc8a..5efdeaa 100644 --- a/home/config/i3/keybindings.nix +++ b/home/config/i3/keybindings.nix @@ -34,20 +34,15 @@ in { $(( $(${brightnessctlKbd} max) - $(${brightnessctlKbd} get) )) ''; "Print" = "exec xfce4-screenshooter"; - } // (if backgroundImage != null then { + } // (lib.optionalAttrs (backgroundImage != null) { "${modifier}+l" = "exec ${lockscreen}/bin/lockscreen.sh"; - } else - { }) // (if config.programs.alacritty.enable then { - "${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty"; - } else - { }) // (if config.programs.rofi.enable then { - "${modifier}+d" = ''exec "${rofi} -modi drun,run,window -show drun"''; - "${modifier}+Shift+d" = "exec ${rofi} -show window"; - } else - { }) // (if config.services.emacs.client.enable then { - "${modifier}+Control+r" = - "exec systemctl --user restart emacs.service"; - } else - { })); + }) // (lib.optionalAttrs config.programs.alacritty.enable { + "${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty"; + }) // (lib.optionalAttrs config.programs.rofi.enable { + "${modifier}+d" = ''exec "${rofi} -modi drun,run,window -show drun"''; + "${modifier}+Shift+d" = "exec ${rofi} -show window"; + }) // (lib.optionalAttrs config.services.emacs.client.enable { + "${modifier}+Control+r" = "exec systemctl --user restart emacs.service"; + })); }; } |
