57 lines
2.9 KiB
Lua
57 lines
2.9 KiB
Lua
-- modules/keybindings.lua
|
|
-- See https://wiki.hypr.land/Configuring/Basics/Binds/
|
|
|
|
local mainMod = "SUPER"
|
|
local terminal = "kitty"
|
|
local fileManager = "dolphin"
|
|
local menu = "wofi --show drun"
|
|
|
|
-- Core
|
|
hl.bind(mainMod .. " + Q", hl.dsp.exec_cmd(terminal))
|
|
hl.bind(mainMod .. " + C", hl.dsp.window.close())
|
|
hl.bind(mainMod .. " + M", hl.dsp.exec_cmd(
|
|
"command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch 'hl.dsp.exit()'"))
|
|
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileManager))
|
|
hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle" }))
|
|
hl.bind(mainMod .. " + R", hl.dsp.exec_cmd(menu))
|
|
hl.bind(mainMod .. " + P", hl.dsp.window.pseudo())
|
|
hl.bind(mainMod .. " + J", hl.dsp.layout("togglesplit"))
|
|
|
|
-- Focus
|
|
hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" }))
|
|
hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" }))
|
|
hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" }))
|
|
hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" }))
|
|
|
|
-- Workspaces 1-10
|
|
for i = 1, 10 do
|
|
local key = i % 10
|
|
hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i }))
|
|
hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i }))
|
|
end
|
|
|
|
-- Scratchpad
|
|
hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic"))
|
|
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" }))
|
|
|
|
-- Scroll workspaces
|
|
hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
|
|
hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
|
|
|
|
-- Mouse window control
|
|
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
|
|
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
|
|
|
|
-- Multimedia / brightness
|
|
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 })
|
|
|
|
-- Playerctl
|
|
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 })
|