summaryrefslogtreecommitdiff
path: root/nixos/extra/bindings.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/extra/bindings.lua')
-rw-r--r--nixos/extra/bindings.lua52
1 files changed, 52 insertions, 0 deletions
diff --git a/nixos/extra/bindings.lua b/nixos/extra/bindings.lua
new file mode 100644
index 0000000..3107b27
--- /dev/null
+++ b/nixos/extra/bindings.lua
@@ -0,0 +1,52 @@
+local terminal = "alacritty"
+local browser = "firefox"
+local menu = "hyprlauncher"
+
+hl.on("hyprland.start", function()
+ hl.exec_cmd("dunst")
+ hl.exec_cmd("sh ~/.local/bin/unblock-pipewire.sh")
+end)
+local mainMod = "SUPER"
+
+hl.bind(mainMod .. " + A", hl.dsp.window.fullscreen())
+hl.bind(mainMod .. " + C", hl.dsp.window.close())
+hl.bind(mainMod .. " + D", hl.dsp.exec_cmd("hyprpicker -naq"))
+hl.bind(mainMod .. " + F", hl.dsp.exec_cmd(browser))
+hl.bind(mainMod .. " + J", hl.dsp.layout("togglesplit"))
+hl.bind(mainMod .. " + M", hl.dsp.exec_cmd("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch 'hl.dsp.exit()'"))
+hl.bind(mainMod .. " + P", hl.dsp.window.pseudo())
+hl.bind(mainMod .. " + Q", hl.dsp.exec_cmd(terminal))
+hl.bind(mainMod .. " + return", hl.dsp.exec_cmd("~/.local/bin/spawn-alacritty-cwd"))
+hl.bind(mainMod .. " + R", hl.dsp.exec_cmd(menu))
+hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle" }))
+
+hl.bind(mainMod .. " + h", hl.dsp.focus({ direction = "left" }))
+hl.bind(mainMod .. " + j", hl.dsp.focus({ direction = "right" }))
+hl.bind(mainMod .. " + k", hl.dsp.focus({ direction = "up" }))
+hl.bind(mainMod .. " + l", hl.dsp.focus({ direction = "down" }))
+
+hl.bind("print", hl.dsp.exec_cmd("grim -g \"$(slurp)\" - | wl-copy"))
+hl.bind(mainMod .. " + print", hl.dsp.exec_cmd("grim - | wl-copy"))
+
+for i = 1, 10 do
+ local key = i % 11
+ hl.bind(mainMod .. " + code:" .. key + 9, hl.dsp.focus({ workspace = i }))
+ hl.bind(mainMod .. " + SHIFT + code:" .. key + 9, hl.dsp.window.move({ workspace = i }))
+end
+
+hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic"))
+hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" }))
+
+hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
+hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
+
+hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true })
+hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true })
+hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true, repeating = true })
+hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true, repeating = true })
+hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true })
+hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true })
+hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
+hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
+hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
+hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })