-------------- ---- INPUT --- -------------- hl.config({ input = { numlock_by_default = true, follow_mouse = 1, sensitivity = 0.1, -- -1.0 - 1.0, 0 means no modification. touchpad = { natural_scroll = true, disable_while_typing = false, }, }, }) -- Gestures hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace", }) -------------------- ---- KEYBINDINGS --- -------------------- mainMod = "SUPER" -- Sets META ("Windows") key as main modifier -- Main desktop controls hl.bind(mainMod .. " + Q" , hl.dsp.window.close()) hl.bind(mainMod .. " + R" , hl.dsp.exec_cmd(menu)) -- Omnibar hl.bind(mainMod .. " + D" , hl.dsp.exec_cmd(menu)) -- Legacy menu shortcut hl.bind(mainMod .. " + I" , hl.dsp.exec_cmd("hyprlock")) -- Lockscreen hl.bind(mainMod .. " + B" , hl.dsp.exec_cmd("~/.config/hypr/scripts/toggle-waybar.sh")) -- Toggle sidebar hl.bind(mainMod .. " + SHIFT + R", hl.dsp.exec_cmd("~/.config/hypr/scripts/reload.sh")) -- Reload desktop hl.bind(mainMod .. " + F11" , hl.dsp.exec_cmd("~/.config/hypr/scripts/gamemode.sh")) -- Gamemode hl.bind(mainMod .. " + F10" , hl.dsp.exec_cmd("~/.config/hypr/scripts/sharp_mode.sh")) -- Sharp mode hl.bind(mainMod .. " + SHIFT + M", hl.dsp.exit()) -- Exit desktop session -- Shortcuts hl.bind(mainMod .. " + RETURN", hl.dsp.exec_cmd(terminal)) hl.bind(mainMod .. " + X" , hl.dsp.exec_cmd(terminal)) -- Absolutely not because I dislocated my arm hl.bind(mainMod .. " + SPACE" , hl.dsp.exec_cmd(menu)) hl.bind(mainMod .. " + E" , hl.dsp.exec_cmd(fileManager)) hl.bind(mainMod .. " + A" , hl.dsp.exec_cmd(notificationManager)) -- TODO Replace by default editor hl.bind("XF86Launch1" , hl.dsp.exec_cmd(terminal .. " hx ~/.config/hypr/config")) -- Move focus with mainMod + arrow keys 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" })) -- Move focus with mainMod + hjkl (vim keybinds) hl.bind(mainMod .. " + H", hl.dsp.focus({ direction = "left" })) hl.bind(mainMod .. " + L", hl.dsp.focus({ direction = "right" })) hl.bind(mainMod .. " + K", hl.dsp.focus({ direction = "up" })) hl.bind(mainMod .. " + J", hl.dsp.focus({ direction = "down" })) -- Move windows with mainMod + shift + arrow keys hl.bind(mainMod .. " + SHIFT + left" , hl.dsp.window.move{ direction = "left" }) hl.bind(mainMod .. " + SHIFT + right", hl.dsp.window.move{ direction = "right" }) hl.bind(mainMod .. " + SHIFT + up" , hl.dsp.window.move{ direction = "up" }) hl.bind(mainMod .. " + SHIFT + down" , hl.dsp.window.move{ direction = "down" }) -- Layout hl.bind(mainMod .. " + " .. "F", hl.dsp.window.fullscreen()) hl.bind(mainMod .. " + " .. "V", hl.dsp.layout("togglesplit")) -- Horizontal/vertical split hl.bind(mainMod .. " + " .. "T", hl.dsp.window.float()) hl.bind(mainMod .. " + " .. "Y", hl.dsp.window.pseudo()) -- Toggle pseudo-tiling -- Switch workspaces with mainMod + [0-9] -- Move active window to a workspace with mainMod + SHIFT + [0-9] for i = 0, 10 do key = i % 10 hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i})) hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i })) end -- Example special workspace (scratchpad) hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic")) hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" })) -- TODO -- Minimize function (uses scratchpad) -- Scroll through existing workspaces with mainMod + scroll hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" })) hl.bind(mainMod .. " + mouse_up" , hl.dsp.focus({ workspace = "e-1" })) -- Move/resize windows with mainMod + LMB/RMB and dragging hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true }) hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true }) -- Function keys --- Volume hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true }) hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true }) hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true }) hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true }) --- Brightness hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 5%+"), { locked = true }) hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 5%-"), { locked = true }) hl.bind("SHIFT" .. " + XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 1%+"), { locked = true }) hl.bind("SHIFT" .. " + XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 1%-"), { locked = true }) --- Player controls 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 }) --- Screenshot hl.bind("Print", hl.dsp.exec_cmd("~/.config/hypr/scripts/screenshot.sh")) hl.bind("SHIFT" .. " + " .. "Print", hl.dsp.exec_cmd("~/.config/hypr/scripts/screenshot.sh --fullscreen")) -- Color picker hl.bind(mainMod .. " + " .. "SHIFT" .. " + " .. "C", hl.dsp.exec_cmd("hyprpicker -a")) --- Touchpad toggle hl.bind("XF86TouchpadToggle", hl.dsp.exec_cmd("~/.config/hypr/scripts/toggle-touchpad.sh"), { locked = true }) ---- On galaxy books, pressing the disable touchpad key also triggers SUPER and ---- CONTROL keys, this is why there are present here hl.bind("SUPER + CONTROL" .. " + " .. "XF86TouchpadToggle", hl.dsp.exec_cmd("~/.config/hypr/scripts/toggle-touchpad.sh")) --- Keyboard layout toggle ---- Only works between AZERTY and QWERTY because of differences in the numbers row ---- that prevent using the default way provided by hyprland hl.bind(mainMod .. " + " .. "CONTROL" .. " + " .. "SPACE", hl.dsp.exec_cmd("~/.config/hypr/scripts/change-kb-layout.sh")) -- Lock laptop on lid close hl.bind("switch:off:Lid Switch", hl.dsp.exec_cmd("hyprlock --immediate"), { locked = true })