Krolyxon
Commit 85941a2

Branches

Refs →

aurora.confighyprsourcekeybinds.lua

149 lines · 7.0 KB · Lua

1---------------------
2---- KEYBINDINGS ----
3---------------------
4-- See https://wiki.hypr.land/Configuring/Basics/Binds/ for more
5
6hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd(terminal))
7hl.bind(mainMod .. " + SHIFT + X", hl.dsp.window.close())
8hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.exit())
9hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" }))
10hl.bind(mainMod .. " + SHIFT + F", hl.dsp.window.fullscreen({ mode = "maximized", action = "toggle" }))
11
12-- bind = $mainMod SHIFT, R, togglefloating,
13-- Smart Float: Toggle float -> Resize to 90% -> Center
14hl.bind(
15 mainMod .. "+ SHIFT + R",
16 hl.dsp.exec_cmd([[
17 if hyprctl activewindow | grep -q 'floating: 0'; then
18 W=$(hyprctl monitors -j | jq '.[] | select(.focused) | ((.width / .scale) * 0.9) | floor')
19 H=$(hyprctl monitors -j | jq '.[] | select(.focused) | ((.height / .scale) * 0.9) | floor')
20 hyprctl --batch "dispatch hl.dsp.window.float({action='set'}); dispatch hl.dsp.window.resize({x=${W}, y=${H}, relative=false})"
21 hyprctl dispatch "hl.dsp.window.center()"
22 else
23 hyprctl dispatch "hl.dsp.window.float({action='unset'})"
24 fi
25 ]]),
26 { description = "Smart Float" }
27)
28
29
30hl.bind(mainMod .. " + R", hl.dsp.exec_cmd(menu))
31-- bind = $mainMod SHIFT, P, pseudo, # dwindle
32hl.bind(mainMod .. " + Tab", hl.dsp.window.cycle_next({ next = false }), { repeating = true })
33hl.bind(mainMod .. " + b", hl.dsp.exec_cmd("killall waybar || waybar"))
34hl.bind(mainMod .. " + grave", hl.dsp.exec_cmd("fuzzelunicode"))
35hl.bind(mainMod .. " + escape", hl.dsp.exec_cmd("sysact"))
36
37-- Applications
38hl.bind(mainMod .. " + W", hl.dsp.exec_cmd(browser))
39hl.bind("PRINT", hl.dsp.exec_cmd("hypr_screenshot.sh"))
40hl.bind(mainMod .. " + SHIFT + P", hl.dsp.exec_cmd("hypr_screenshot.sh"))
41
42-- Music Controls
43hl.bind(mainMod .. " + m", hl.dsp.exec_cmd(terminal .. " -e zsh -i -c \"ncmpcpp\""))
44hl.bind(mainMod .. " + p", hl.dsp.exec_cmd("mpc toggle"))
45hl.bind(mainMod .. " + period", hl.dsp.exec_cmd("mpc seek +10"), { repeating = true })
46hl.bind(mainMod .. " + comma", hl.dsp.exec_cmd("mpc seek -10"), { repeating = true })
47hl.bind(mainMod .. " + SHIFT + period", hl.dsp.exec_cmd("mpc next"))
48hl.bind(mainMod .. " + SHIFT + comma", hl.dsp.exec_cmd("mpc prev"))
49
50-- Swap current focused window with master
51hl.bind(mainMod .. " + space", hl.dsp.layout("swapwithmaster"))
52
53-- Resize windows with h/j/k/l
54hl.bind(mainMod .. " + h", hl.dsp.window.resize({ x = -30, y = 0, relative = true}), { repeating = true })
55hl.bind(mainMod .. " + l", hl.dsp.window.resize({ x = 30, y = 0, relative = true}), { repeating = true })
56hl.bind(mainMod .. " + k", hl.dsp.window.resize({ x = 0, y = -30, relative = true }), { repeating = true })
57hl.bind(mainMod .. " + j", hl.dsp.window.resize({ x = 0, y = 30, relative = true }), { repeating = true })
58
59-- Clipboard menu (cliphist)
60hl.bind(mainMod .. " + v", hl.dsp.exec_cmd("sh -c \"cliphist list | fuzzel --dmenu --with-nth 2 | cliphist decode | wl-copy\""))
61
62-- -----------------------------------------------------
63-- Workspace switching
64-- -----------------------------------------------------
65
66local mainMod = "SUPER"
67for i = 1, smw.get_amount_of_workspaces() do
68 local n = tostring(i)
69 if n == "10" then n = "0" end -- Optional if you configured 10 workspaces: bind workspace 10 to SUPER + 0
70 -- Switch to the Nth workspace on the currently focused monitor.
71 hl.bind(mainMod .. " +" .. n, smw.workspace(n))
72 -- Move the active window to the Nth workspace on the currently focused monitor silently (no focus change).
73 hl.bind(mainMod .. " + SHIFT +" .. n, smw.move_to_workspace_silent(n))
74end
75
76-- Example special workspace (scratchpad)
77hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic"))
78hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" }))
79
80-- Scratchpad like DWM
81hl.workspace_rule({ workspace = "special:h", on_created_empty = terminal })
82hl.bind(mainMod .. " + SHIFT + Return", hl.dsp.workspace.toggle_special("h"))
83
84-- --- Accessibility: Zoom ---
85hl.config({ cursor = { zoom_disable_aa = true } })
86
87hl.bind(
88 "SUPER + equal",
89 function()
90 local z = hl.get_config("cursor.zoom_factor")
91 hl.config({ cursor = { zoom_factor = z * 1.25 } })
92 end,
93 { description = "Zoom In", repeating = true }
94)
95
96hl.bind(
97 "SUPER + minus",
98 function()
99 local z = hl.get_config("cursor.zoom_factor")
100 local nz = z / 1.25
101 if nz < 1.0 then nz = 1.0 end
102 hl.config({ cursor = { zoom_factor = nz } })
103 end,
104 { description = "Zoom Out", repeating = true }
105)
106
107hl.bind(
108 "SUPER + BACKSPACE",
109 function()
110 hl.config({ cursor = { zoom_factor = 1.0 } })
111 end,
112 { description = "Reset Zoom", locked = true }
113)
114
115-- Screen Rotate
116hl.bind(mainMod .. " + CTRL + comma", hl.dsp.exec_cmd("hypr_screen_rotate.py +90"),
117 { locked = true, desc = "Rotate Screen Anti-Clockwise" })
118hl.bind(mainMod .. " + CTRL + period", hl.dsp.exec_cmd("hypr_screen_rotate.py -90"),
119 { locked = true, desc = "Rotate Screen Clockwise" })
120
121-- --- Hyprshade (Visual Filters) ---
122hl.bind(mainMod .. " + CTRL + S", hl.dsp.exec_cmd("hypr_shader_menu.sh"), { desc = "Shader Menu" })
123hl.bind(mainMod .. " + CTRL + X", hl.dsp.exec_cmd("hyprshade off"), { locked = true, desc = "Disable Shader" })
124hl.bind(mainMod .. " + CTRL + V", hl.dsp.exec_cmd("hyprshade on vibrance"), { locked = true, desc = "Vibrant Shader" })
125
126-- Scroll through existing workspaces with mainMod + scroll
127hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
128hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
129
130-- Move/resize windows with mainMod + LMB/RMB and dragging
131hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
132hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
133
134-- Laptop multimedia keys for volume and LCD brightness
135hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true })
136hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true })
137hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true, repeating = true })
138hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true, repeating = true })
139hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("~/.local/bin/brictl -"), { locked = true, repeating = true })
140hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("~/.local/bin/brictl +"), { locked = true, repeating = true })
141
142-- Requires playerctl
143hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
144hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
145hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
146hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })
147
148-- Quichshell
149hl.bind(mainMod .. "+ C", hl.dsp.exec_cmd("qs -p ~/.config/quickshell/wal-control ipc call control toggle"))