aboutsummaryrefslogtreecommitdiffstats
path: root/modules/graphical/sxhkd/default.nix
blob: a65d3fa5cf981f3b819e2c5595c43e17bcf1fe46 (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
{ pkgs, config, lib, ... }:

{
	config = lib.mkIf config.graphical.enable {
		services.sxhkd.enable = true;
		services.sxhkd.keybindings =
		let
			modKey = "alt";
			createKeybinding = keybinding: description: command: {
				"# ${description}\n${modKey} + ${keybinding}" = command;
			};
		in lib.mkMerge [
			(import ./keybindings/bspwm.nix { inherit pkgs createKeybinding lib; })

			(createKeybinding
				"s"
				"Show keybindings."
				"kitty --title 'Keybindings' --class floating-termial -e ${pkgs.writeShellScript "keybindings.sh" (builtins.readFile ./scripts/keybindings.sh)}"
				)

			(createKeybinding
				"r"
				"Application launcher."
				"rofi -show drun")

			(createKeybinding
				"t"
				"Launch terminal."
				"kitty")

			# (createKeybinding
			# 	"f"
			# 	"Launch File Manager."
			# 	"kitty --title 'File Manager' --class floating-termial -e ${config.tools.file-manager.command}")
		];
	};
}