1
0

keybindings.lua 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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([[
  24. #!/bin/bash
  25. OLD=$(wl-paste)
  26. caelestia shell picker openFreezeClip
  27. for i in {1..20}; do
  28. NEW=$(wl-paste)
  29. if [ "$NEW" != "$OLD" ]; then
  30. wl-paste --type image/png > ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png
  31. exit 0
  32. fi
  33. sleep 0.1
  34. done
  35. exit 1
  36. ]]))
  37. -- Move focus with mainMod + arrow keys
  38. hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" }))
  39. hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" }))
  40. hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" }))
  41. hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" }))
  42. -- Move window
  43. hl.bind(mainMod .. " + SHIFT + left", hl.dsp.window.move({ direction = "left" }))
  44. hl.bind(mainMod .. " + SHIFT + right", hl.dsp.window.move({ direction = "right" }))
  45. hl.bind(mainMod .. " + SHIFT + up", hl.dsp.window.move({ direction = "up" }))
  46. hl.bind(mainMod .. " + SHIFT + down", hl.dsp.window.move({ direction = "down" }))
  47. -- Switch workspaces with mainMod + [0-9]
  48. -- Move active window to a workspace with mainMod + SHIFT + [0-9]
  49. for i = 1, 10 do
  50. local key = i % 10 -- 10 maps to key 0
  51. hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i}))
  52. hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i, follow = false }))
  53. end
  54. for i = 1, 10 do
  55. local key = "F" .. i
  56. hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i + 10 }))
  57. hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i + 10, follow = false }))
  58. end
  59. -- Example special workspace (scratchpad)
  60. hl.bind(mainMod .. " + BAR", hl.dsp.workspace.toggle_special("magic"))
  61. hl.bind(mainMod .. " + SHIFT + BAR", hl.dsp.window.move({ workspace = "special:magic" }))
  62. -- Scroll through existing workspaces with mainMod + scroll
  63. hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
  64. hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
  65. -- Move/resize windows with mainMod + LMB/RMB and dragging
  66. hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
  67. hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
  68. -- Laptop multimedia keys for volume and LCD brightness
  69. hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true })
  70. hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true })
  71. hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true, repeating = true })
  72. hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true, repeating = true })
  73. hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true })
  74. hl.bind("XF86MonBrightnessDown",hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true })
  75. -- Requires playerctl
  76. hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
  77. hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
  78. hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
  79. hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })