Refactor sxhkd to its own module

This commit is contained in:
Oliver Davies 2025-05-25 15:11:33 +01:00
parent cb01fe8fe7
commit 098e9f4816
3 changed files with 26 additions and 9 deletions

View file

@ -24,6 +24,7 @@
}; };
ranger.enable = true; ranger.enable = true;
sxhkd.enable = true;
starship.enable = true; starship.enable = true;
tmux.enable = true; tmux.enable = true;
@ -109,13 +110,4 @@
098EE055DAD2B9CB68154C6759DD38292D2273B6 098EE055DAD2B9CB68154C6759DD38292D2273B6
1E21B58D69FFEFAD077F152A50FEA938A3413F50 1E21B58D69FFEFAD077F152A50FEA938A3413F50
''; '';
services.sxhkd = {
enable = true;
keybindings = {
"{_,shift + ,super + }XF86MonBrightness{Down,Up}" = "${lib.getExe pkgs.brightnessctl} set {5%-,10%-,10%,+5%,+10%,100%}";
"super + x; {1,2,3}" = "st {newsboat,nmtui,bluetuith";
};
};
} }

View file

@ -11,6 +11,7 @@
./ranger.nix ./ranger.nix
./scripts ./scripts
./starship.nix ./starship.nix
./sxhkd.nix
./todos.nix ./todos.nix
./tmux.nix ./tmux.nix
./tmux-sessionizer.nix ./tmux-sessionizer.nix

View file

@ -0,0 +1,24 @@
{ config, lib, pkgs, ... }:
let
cfg = config.cli.${service};
service = "sxhkd";
inherit (lib) getExe mkIf mkEnableOption;
in
{
options.cli.${service} = {
enable = mkEnableOption "Enable ${service}";
};
config = mkIf cfg.enable {
services.${service} = {
enable = true;
keybindings = {
"{_,shift + ,super + }XF86MonBrightness{Down,Up}" = "${getExe pkgs.brightnessctl} set {5%-,10%-,10%,+5%,+10%,100%} --quiet";
"super + x; {1,2,3}" = "st {newsboat,nmtui,bluetuith}";
};
};
};
}