summaryrefslogtreecommitdiff
path: root/common/home/hyprland/default.nix
blob: 9aca556666037a2aaebfea6150f591d96e1ed60c (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{ pkgs, lib, ... }:
let
	hl = import ./hl.nix { inherit lib; };
in
{
	enable = true;

	systemd = {
		enable = true;
		variables = [ "--all" ];
	};
	xwayland.enable = true;
	configType = "lua";
	settings = {
		mod =  {
			_var = "SUPER";
		};
		bind = [
			(hl.bind { mod = true; keys = [ "q" ]; flags = { long_press = true; locked = true; }; } (hl.dsp.exec "shutdown"))

			(hl.bind { mod = true; keys = [ "h" ]; } (hl.dsp.focus { direction = "left"; }))
			(hl.bind { mod = true; keys = [ "j" ]; } (hl.dsp.focus { direction = "down"; }))
			(hl.bind { mod = true; keys = [ "k" ]; } (hl.dsp.focus { direction = "up"; }))
			(hl.bind { mod = true; keys = [ "l" ]; } (hl.dsp.focus { direction = "right"; }))
			(hl.bind { mod = true; keys = [ "i" ]; } (hl.dsp.layout "removemaster"))
			(hl.bind { mod = true; keys = [ "d" ]; } (hl.dsp.layout "addmaster"))

			(hl.bind { mod = true; shift = true; keys = [ "h" ]; } (hl.dsp.window.move { direction = "left"; }))
			(hl.bind { mod = true; shift = true; keys = [ "j" ]; } (hl.dsp.window.move { direction = "down"; }))
			(hl.bind { mod = true; shift = true; keys = [ "k" ]; } (hl.dsp.window.move { direction = "up"; }))
			(hl.bind { mod = true; shift = true; keys = [ "l" ]; } (hl.dsp.window.move { direction = "right"; }))

			(hl.bind { mod = true; keys = [ "c" ]; } hl.dsp.window.close)
			(hl.bind { mod = true; keys = [ "f" ]; } hl.dsp.window.fullscreen)

			(hl.bind { mod = true; keys = [ "Escape" ]; } (hl.dsp.exec "hyprlock"))
			(hl.bind { mod = true; keys = [ "Space"  ]; } (hl.dsp.exec "wofi --show drun"))
			(hl.bind { mod = true; keys = [ "o"      ]; } (hl.dsp.exec "openproject"))
			(hl.bind { mod = true; keys = [ "v"      ]; } (hl.dsp.exec "openproject -e nvim"))
			(hl.bind { mod = true; keys = [ "b"      ]; } (hl.dsp.exec "bluemenu"))
			(hl.bind { mod = true; keys = [ "F1"     ]; } (hl.dsp.exec "bluemenu"))
			(hl.bind { mod = true; keys = [ "s"      ]; } (hl.dsp.exec "sshconnect"))

			(hl.bind { mod = true; shift = true; keys = [ "Space" ]; } (hl.dsp.exec "wofi --show run"))

			(hl.bind { mod = true; shift = true; keys = [ "Return" ]; } (hl.dsp.exec "alacritty"))
			(hl.bind { mod = true; shift = true; keys = [ "b"      ]; } (hl.dsp.exec "firefox"))
			(hl.bind { mod = true; shift = true; keys = [ "p"      ]; } (hl.dsp.exec "wofi-pass"))
			(hl.bind { mod = true; shift = true; keys = [ "o"      ]; } (hl.dsp.exec "wofi-pass otp"))
			(hl.bind { mod = true; shift = true; keys = [ "e"      ]; } (hl.dsp.exec "webtrayctl show https://chat.nathanreiner.xyz"))
			(hl.bind { mod = true; shift = true; keys = [ "m"      ]; } (hl.dsp.exec "webtrayctl show https://jellyfin.nathanreiner.xyz"))
			(hl.bind { mod = true; shift = true; keys = [ "s"      ]; } (hl.dsp.exec "signal-desktop"))

			(hl.bind { mod = true; shift = false; keys = [ "period" ]; flags = { repeating = true; }; } (hl.dsp.window.resize { x = 20; y = 0; relative = true; }))
			(hl.bind { mod = true; shift = false; keys = [ "comma"  ]; flags = { repeating = true; }; } (hl.dsp.window.resize { x = -20; y = 0; relative = true; }))
			(hl.bind { mod = true; shift = true; keys =  [ "period" ]; flags = { repeating = true; }; } (hl.dsp.window.resize { x = 0; y = 20; relative = true; }))
			(hl.bind { mod = true; shift = true; keys =  [ "comma"  ]; flags = { repeating = true; }; } (hl.dsp.window.resize { x = 0; y = -20; relative = true; }))

			(hl.bind { keys = [ "Print" ]; } (hl.dsp.exec "grimshot copy area"))
			(hl.bind { keys = [ "XF86AudioMute"         ]; flags = { repeating = true; }; } (hl.dsp.exec "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"))
			(hl.bind { keys = [ "XF86AudioRaiseVolume"  ]; flags = { repeating = true; }; } (hl.dsp.exec "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"))
			(hl.bind { keys = [ "XF86AudioLowerVolume"  ]; flags = { repeating = true; }; } (hl.dsp.exec "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"))
			(hl.bind { keys = [ "XF86AudioPlay"         ]; flags = { repeating = true; }; } (hl.dsp.exec "playerctl play-pause"))
			(hl.bind { keys = [ "XF86MonBrightnessDown" ]; flags = { repeating = true; }; } (hl.dsp.exec "brightnessctl set 10%-"))
			(hl.bind { keys = [ "XF86MonBrightnessUp"   ]; flags = { repeating = true; }; } (hl.dsp.exec "brightnessctl set +10%"))

			(hl.bind { mod = true; keys = [ "mouse:272" ]; flags = { mouse = true; }; } (hl.dsp.window.drag))
		];

		animation = [ {
			enabled = true;
			speed = 1;
			leaf = "global";
			bezier = "default";
		} ];

		config = {
			general = {
				gaps_in = 5;
				gaps_out = 5;
				layout = "scrolling";
				border_size = 1;
				"col.active_border" = "rgba(665c54ff)";
				"col.inactive_border" = "rgba(3c3836ff)";
			};

			decoration = {
				rounding = 4;
				shadow = {
					enabled = true;
					range = true;
					render_power = 4;
				};
			};

			misc = {
				disable_hyprland_logo = true;
				disable_splash_rendering = true;
				enable_swallow = false;
				swallow_regex = "^(Alacritty)$";
				animate_manual_resizes = true;
			};

			input = {
				kb_layout = "us,ch";
				kb_options = "caps:escape,grp:alt_space_toggle";

				touchpad = {
					natural_scroll = true;
					clickfinger_behavior = true;
					disable_while_typing = true;
				};

				tablet = {
					output = "DP-3";
				};

			};

			master = {
				new_on_top = true;
				new_status = "master";
			};

			scrolling = {
				direction = "down";
				explicit_column_widths = "0.8, 1.0";
				column_width = 0.8;
			};
		};

		on = [
			(hl.on.start [
				(hl.dsp.exec "signal-desktop")
				(hl.dsp.exec "kdeconnect-indicator")
			])
		];
	};
}