keybindings.lua 4.2 KB

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