aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/window-manager
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-10-15 04:21:26 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-10-15 04:21:26 +0530
commita4fb9a83d671a4c7f3ed44df77cdee36604b5411 (patch)
treed52ba573a132c218be5e0cab67524ed2cd54ae93 /modules/desktop/window-manager
parent2352b6907387b778623d8f09969cca6cb739ccc0 (diff)
downloadhome-manager-config-a4fb9a83d671a4c7f3ed44df77cdee36604b5411.tar.gz
home-manager-config-a4fb9a83d671a4c7f3ed44df77cdee36604b5411.zip
Refactoring code.
Stopped using picom. Disabled unused packages and configurations.
Diffstat (limited to 'modules/desktop/window-manager')
-rw-r--r--modules/desktop/window-manager/sxhkd/default.nix38
-rw-r--r--modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix44
2 files changed, 41 insertions, 41 deletions
diff --git a/modules/desktop/window-manager/sxhkd/default.nix b/modules/desktop/window-manager/sxhkd/default.nix
index 953cfd3..f4678c3 100644
--- a/modules/desktop/window-manager/sxhkd/default.nix
+++ b/modules/desktop/window-manager/sxhkd/default.nix
@@ -11,36 +11,36 @@
services.sxhkd.keybindings =
let
modKey = "alt";
- createKeybinding = keybinding: description: "# ${description}\n${modKey} + ${keybinding}";
+ createKeybinding = keybinding: description: command: {
+ "# ${description}\n${modKey} + ${keybinding}" = command;
+ };
in lib.mkMerge [
(
if config.desktop.window-manager.bspwm.enable then
- (import ./keybindings/bspwm.nix { inherit pkgs createKeybinding; })
+ (import ./keybindings/bspwm.nix { inherit pkgs createKeybinding lib; })
else {}
)
- {
- ${(createKeybinding
+ (lib.mkMerge [
+ (createKeybinding
"s"
- "Show keybindings.")}
- = pkgs.writeShellScript
- "keybindings.sh"
- (builtins.readFile ./scripts/keybindings.sh);
+ "Show keybindings."
+ (pkgs.writeShellScript "keybindings.sh" (builtins.readFile ./scripts/keybindings.sh)))
- ${(createKeybinding
- "r"
- "Application launcher.")}
- = config.desktop.application-launcher.command;
+ (createKeybinding
+ "space"
+ "Application launcher."
+ config.desktop.application-launcher.command)
- ${(createKeybinding
+ (createKeybinding
"t"
- "Launch terminal.")}
- = config.tools.terminal.command;
+ "Launch terminal."
+ config.tools.terminal.command)
- ${(createKeybinding
+ (createKeybinding
"f"
- "Launch File Manager.")}
- = "${config.tools.terminal.command} --title 'File Manager' --class floating-termial -e ${config.tools.file-manager.command}";
- }
+ "Launch File Manager."
+ "${config.tools.terminal.command} --title 'File Manager' --class floating-termial -e ${config.tools.file-manager.command}")
+ ])
];
};
}
diff --git a/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix b/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix
index 1d66d16..ed62ed4 100644
--- a/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix
+++ b/modules/desktop/window-manager/sxhkd/keybindings/bspwm.nix
@@ -1,38 +1,38 @@
-{ createKeybinding, pkgs }:
+{ createKeybinding, pkgs, lib }:
let
bspc = "${pkgs.bspwm}/bin/bspc";
-in {
- ${(createKeybinding
+in lib.mkMerge [
+ (createKeybinding
"q"
- "Kill current window.")}
- = "${bspc} node -c";
+ "Kill current window."
+ "${bspc} node -c")
- ${(createKeybinding
+ (createKeybinding
"{1-9,0}"
- "Switch workspace.")}
- = "${bspc} desktop -f {1-9,10}";
+ "Switch workspace."
+ "${bspc} desktop -f {1-9,10}")
- ${(createKeybinding
+ (createKeybinding
"shift + {1-9,0}"
- "Move window to workspace.")}
- = "${bspc} node -d {1-9,10} --follow";
+ "Move window to workspace."
+ "${bspc} node -d {1-9,10} --follow")
- ${(createKeybinding
+ (createKeybinding
"{n,d,m}"
- "Set current window mode (tiled, floating, fullscreen).")}
- = "${bspc} node focused -t {tiled,floating,fullscreen}";
+ "Set current window mode (tiled, floating, fullscreen)."
+ "${bspc} node focused -t {tiled,floating,fullscreen}")
- ${(createKeybinding
+ (createKeybinding
"{_,shift + }{h,j,k,l}"
- "Navigate between windows.")}
- = "${bspc} node --{focus,swap} {west,south,north,east}";
+ "Navigate between windows."
+ "${bspc} node --{focus,swap} {west,south,north,east}")
# the indentation for each line is required to work with the help prompt
- ${(createKeybinding
+ (createKeybinding
"ctrl + {h,j,k,l}"
- "Resize current window.")}
- = ''
+ "Resize current window."
+ ''
${bspc} node {@parent/second -z left -20 0; \
@parent/first -z right -20 0, \
@parent/second -z top 0 +20; \
@@ -41,5 +41,5 @@ in {
@parent/second -z top 0 -20, \
@parent/first -z right +20 0; \
@parent/second -z left +20 0}
-'';
-}
+'')
+]