diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2025-11-26 13:49:55 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2025-11-26 14:07:55 +0530 |
| commit | b553b7633a838f6ad023fb2430c95933ea512e4a (patch) | |
| tree | 2dc2d09d6b8df64e8089abcd59fc6a0f1fd1fb26 /modules | |
| parent | de166231fa4954a2cdc68265da9fbaf072c0d3b1 (diff) | |
| download | home-manager-config-b553b7633a838f6ad023fb2430c95933ea512e4a.tar.gz home-manager-config-b553b7633a838f6ad023fb2430c95933ea512e4a.zip | |
Added volume, brightness and player controls.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/graphical/default.nix | 1 | ||||
| -rw-r--r-- | modules/graphical/sxhkd/default.nix | 10 | ||||
| -rw-r--r-- | modules/graphical/sxhkd/keybindings/brightnessctl.nix | 15 | ||||
| -rw-r--r-- | modules/graphical/sxhkd/keybindings/pamixer.nix | 20 | ||||
| -rw-r--r-- | modules/graphical/sxhkd/keybindings/playerctl.nix | 10 | ||||
| -rw-r--r-- | modules/tools/brave/default.nix | 13 | ||||
| -rw-r--r-- | modules/tools/brightnessctl/default.nix | 13 | ||||
| -rw-r--r-- | modules/tools/default.nix | 4 | ||||
| -rw-r--r-- | modules/tools/pamixer/default.nix | 13 | ||||
| -rw-r--r-- | modules/tools/playerctl/default.nix | 13 |
10 files changed, 108 insertions, 4 deletions
diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index 37fc04b..411deaa 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -20,7 +20,6 @@ ${if config.tools.feh.enable then "${pkgs.feh}/bin/feh --bg-scale ${../../assets/skeleton-mage.png}" else "xsetroot -solid \"${config.scheme.withHashtag.base00}\""} -${pkgs.bspwm}/bin/bspwm "; }; } diff --git a/modules/graphical/sxhkd/default.nix b/modules/graphical/sxhkd/default.nix index a65d3fa..d19f01f 100644 --- a/modules/graphical/sxhkd/default.nix +++ b/modules/graphical/sxhkd/default.nix @@ -5,12 +5,16 @@ services.sxhkd.enable = true; services.sxhkd.keybindings = let - modKey = "alt"; - createKeybinding = keybinding: description: command: { - "# ${description}\n${modKey} + ${keybinding}" = command; + modKey = "super"; + createKeybinding = keybinding: createKeybindingBase "${modKey} + ${keybinding}"; + createKeybindingBase = keybinding: description: command: { + "# ${description}\n${keybinding}" = command; }; in lib.mkMerge [ + (import ./keybindings/brightnessctl.nix { inherit pkgs createKeybindingBase lib; }) (import ./keybindings/bspwm.nix { inherit pkgs createKeybinding lib; }) + (import ./keybindings/pamixer.nix { inherit pkgs createKeybindingBase lib; }) + (import ./keybindings/playerctl.nix { inherit pkgs createKeybindingBase lib; }) (createKeybinding "s" diff --git a/modules/graphical/sxhkd/keybindings/brightnessctl.nix b/modules/graphical/sxhkd/keybindings/brightnessctl.nix new file mode 100644 index 0000000..acb4ea2 --- /dev/null +++ b/modules/graphical/sxhkd/keybindings/brightnessctl.nix @@ -0,0 +1,15 @@ +{ createKeybindingBase, pkgs, lib }: + +let + brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; +in lib.mkMerge [ + (createKeybindingBase + "XF86MonBrightnessDown" + "Decrease brightness." + "${brightnessctl} set 5%-") + + (createKeybindingBase + "XF86MonBrightnessUp" + "Increase brightness." + "${brightnessctl} set +5%") +] diff --git a/modules/graphical/sxhkd/keybindings/pamixer.nix b/modules/graphical/sxhkd/keybindings/pamixer.nix new file mode 100644 index 0000000..3543d8f --- /dev/null +++ b/modules/graphical/sxhkd/keybindings/pamixer.nix @@ -0,0 +1,20 @@ +{ createKeybindingBase, pkgs, lib }: + +let + pamixer = "${pkgs.pamixer}/bin/pamixer"; +in lib.mkMerge [ + (createKeybindingBase + "XF86AudioLowerVolume" + "Decrease volume." + "${pamixer} --decrease 5") + + (createKeybindingBase + "XF86AudioRaiseVolume" + "Increase volume." + "${pamixer} --increase 5") + + (createKeybindingBase + "XF86AudioMute" + "Mute audio." + "${pamixer} --toggle-mute") +] diff --git a/modules/graphical/sxhkd/keybindings/playerctl.nix b/modules/graphical/sxhkd/keybindings/playerctl.nix new file mode 100644 index 0000000..3e5c4e0 --- /dev/null +++ b/modules/graphical/sxhkd/keybindings/playerctl.nix @@ -0,0 +1,10 @@ +{ createKeybindingBase, pkgs, lib }: + +let + playerctl = "${pkgs.playerctl}/bin/playerctl"; +in lib.mkMerge [ + (createKeybindingBase + "XF86AudioPlay" + "Toggle video / audio player." + "${playerctl} play-pause") +] diff --git a/modules/tools/brave/default.nix b/modules/tools/brave/default.nix new file mode 100644 index 0000000..93b4b84 --- /dev/null +++ b/modules/tools/brave/default.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +{ + options.tools.brave = { + enable = lib.mkEnableOption "Enables brave."; + }; + + config = lib.mkIf config.tools.brave.enable { + home.packages = [ + pkgs.brave + ]; + }; +} diff --git a/modules/tools/brightnessctl/default.nix b/modules/tools/brightnessctl/default.nix new file mode 100644 index 0000000..f4aa488 --- /dev/null +++ b/modules/tools/brightnessctl/default.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +{ + options.tools.brightnessctl = { + enable = lib.mkEnableOption "Enables brightnessctl."; + }; + + config = lib.mkIf config.tools.brightnessctl.enable { + home.packages = [ + pkgs.brightnessctl + ]; + }; +} diff --git a/modules/tools/default.nix b/modules/tools/default.nix index 631bacc..a76c835 100644 --- a/modules/tools/default.nix +++ b/modules/tools/default.nix @@ -3,6 +3,8 @@ { imports = [ ./bat + ./brave + ./brightnessctl ./feh ./fzf ./git @@ -12,6 +14,8 @@ ./neofetch ./neovim ./nnn + ./pamixer + ./playerctl ./rofi ./zsh ]; diff --git a/modules/tools/pamixer/default.nix b/modules/tools/pamixer/default.nix new file mode 100644 index 0000000..f182099 --- /dev/null +++ b/modules/tools/pamixer/default.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +{ + options.tools.pamixer = { + enable = lib.mkEnableOption "Enables pamixer."; + }; + + config = lib.mkIf config.tools.pamixer.enable { + home.packages = [ + pkgs.pamixer + ]; + }; +} diff --git a/modules/tools/playerctl/default.nix b/modules/tools/playerctl/default.nix new file mode 100644 index 0000000..1453bc2 --- /dev/null +++ b/modules/tools/playerctl/default.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +{ + options.tools.playerctl = { + enable = lib.mkEnableOption "Enables playerctl."; + }; + + config = lib.mkIf config.tools.playerctl.enable { + home.packages = [ + pkgs.playerctl + ]; + }; +} |
