1
0

keybindings.lua 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. local mainMod = "ALT"
  2. local secMod = "SUPER"
  3. local terminal = "alacritty"
  4. local fileManager = "dolphin"
  5. -- Example binds, see https://wiki.hypr.land/Configuring/Basics/Binds/ for more
  6. hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd(terminal))
  7. hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.window.close())
  8. --hl.bind(mainMod .. " + M", hl.dsp.exec_cmd("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch 'hl.dsp.exit()'"))
  9. hl.bind(mainMod .. " + P", hl.dsp.window.pseudo())
  10. hl.bind(mainMod .. " + V", hl.dsp.layout("togglesplit")) -- dwindle only
  11. hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen({ action = "toggle" }))
  12. hl.bind(mainMod .. " + SHIFT + SPACE", hl.dsp.window.float({ action = "toggle" }))
  13. hl.bind(secMod .. " + E", hl.dsp.exec_cmd(fileManager))
  14. hl.bind(secMod .. " + Q", hl.dsp.exec_cmd("firefox"))
  15. hl.bind(secMod .. " + S", hl.dsp.exec_cmd("spotify"))
  16. hl.bind(secMod .. " + D", hl.dsp.exec_cmd("vesktop"))
  17. hl.bind(secMod .. " + SHIFT + C", hl.dsp.exec_cmd("hyprpicker --autocopy"))
  18. hl.bind(mainMod .. " + CONTROL + A", hl.dsp.exec_cmd("amixer set Capture toggle"))
  19. hl.bind(mainMod .. " + CONTROL + S", hl.dsp.exec_cmd("amixer set Master toggle"))
  20. -- Move focus with mainMod + arrow keys
  21. hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" }))
  22. hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" }))
  23. hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" }))
  24. hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" }))
  25. -- Move window
  26. hl.bind(mainMod .. " + SHIFT + left", hl.dsp.window.move({ direction = "left" }))
  27. hl.bind(mainMod .. " + SHIFT + right", hl.dsp.window.move({ direction = "right" }))
  28. hl.bind(mainMod .. " + SHIFT + up", hl.dsp.window.move({ direction = "up" }))
  29. hl.bind(mainMod .. " + SHIFT + down", hl.dsp.window.move({ direction = "down" }))
  30. -- Switch workspaces with mainMod + [0-9]
  31. -- Move active window to a workspace with mainMod + SHIFT + [0-9]
  32. for i = 1, 10 do
  33. local key = i % 10 -- 10 maps to key 0
  34. hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i}))
  35. hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i, follow = false }))
  36. end
  37. for i = 1, 10 do
  38. local key = "F" .. i
  39. hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i + 10 }))
  40. hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i + 10, follow = false }))
  41. end
  42. -- Example special workspace (scratchpad)
  43. hl.bind(mainMod .. " + BAR", hl.dsp.workspace.toggle_special("magic"))
  44. hl.bind(mainMod .. " + SHIFT + BAR", hl.dsp.window.move({ workspace = "special:magic" }))
  45. -- Scroll through existing workspaces with mainMod + scroll
  46. hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
  47. hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
  48. -- Move/resize windows with mainMod + LMB/RMB and dragging
  49. hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
  50. hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
  51. -- Laptop multimedia keys for volume and LCD brightness
  52. hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true })
  53. hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true })
  54. hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true, repeating = true })
  55. hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true, repeating = true })
  56. hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true })
  57. hl.bind("XF86MonBrightnessDown",hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true })
  58. -- Requires playerctl
  59. hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
  60. hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
  61. hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
  62. hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })