blob: 953cfd346cbef0f8ff0410663bf731b139409416 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
{ pkgs, config, lib, ... }:
{
options.desktop.window-manager.sxhkd = {
enable = lib.mkEnableOption "Enables sxhkd.";
};
config = lib.mkIf config.desktop.window-manager.sxhkd.enable {
services.sxhkd.enable = true;
services.sxhkd.keybindings =
let
modKey = "alt";
createKeybinding = keybinding: description: "# ${description}\n${modKey} + ${keybinding}";
in lib.mkMerge [
(
if config.desktop.window-manager.bspwm.enable then
(import ./keybindings/bspwm.nix { inherit pkgs createKeybinding; })
else {}
)
{
${(createKeybinding
"s"
"Show keybindings.")}
= pkgs.writeShellScript
"keybindings.sh"
(builtins.readFile ./scripts/keybindings.sh);
${(createKeybinding
"r"
"Application launcher.")}
= config.desktop.application-launcher.command;
${(createKeybinding
"t"
"Launch terminal.")}
= config.tools.terminal.command;
${(createKeybinding
"f"
"Launch File Manager.")}
= "${config.tools.terminal.command} --title 'File Manager' --class floating-termial -e ${config.tools.file-manager.command}";
}
];
};
}
|