blob: decad258c57ab618e431d2dda61d065268442a25 (
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.popup-manager.application-launcher.default;
${(createKeybinding
"t"
"Launch terminal.")}
= config.desktop.terminal.default;
${(createKeybinding
"f"
"Launch File Manager.")}
= "${config.desktop.terminal.default} -t 'File Manager' --class popup -e ${config.tools.file-manager.default}";
}
];
};
}
|