chore(hypr): migrate Hyprland configuration to Lua

This commit is contained in:
2026-08-19 15:40:38 +02:00
parent a754efd301
commit fe99bff5a8
14 changed files with 313 additions and 571 deletions
-25
View File
@@ -1,25 +0,0 @@
# Only display the OSD on the currently focused monitor
$osdclient = swayosd-client --monitor "$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')"
# Laptop multimedia keys for volume and LCD brightness (with OSD)
bindeld = ,XF86AudioRaiseVolume, Volume up, exec, $osdclient --output-volume raise
bindeld = ,XF86AudioLowerVolume, Volume down, exec, $osdclient --output-volume lower
bindeld = ,XF86AudioMute, Mute, exec, $osdclient --output-volume mute-toggle
bindeld = ,XF86AudioMicMute, Mute microphone, exec, $osdclient --input-volume mute-toggle
bindeld = ,XF86MonBrightnessUp, Brightness up, exec, $osdclient --brightness raise
bindeld = ,XF86MonBrightnessDown, Brightness down, exec, $osdclient --brightness lower
# Precise 1% multimedia adjustments with Alt modifier
bindeld = ALT, XF86AudioRaiseVolume, Volume up precise, exec, $osdclient --output-volume +1
bindeld = ALT, XF86AudioLowerVolume, Volume down precise, exec, $osdclient --output-volume -1
bindeld = ALT, XF86MonBrightnessUp, Brightness up precise, exec, $osdclient --brightness +1
bindeld = ALT, XF86MonBrightnessDown, Brightness down precise, exec, $osdclient --brightness -1
# Requires playerctl
bindld = , XF86AudioNext, Next track, exec, $osdclient --playerctl next
bindld = , XF86AudioPause, Pause, exec, $osdclient --playerctl play-pause
bindld = , XF86AudioPlay, Play, exec, $osdclient --playerctl play-pause
bindld = , XF86AudioPrev, Previous track, exec, $osdclient --playerctl previous
# Switch audio output with Super + Mute
bindld = SUPER, XF86AudioMute, Switch audio output, exec, omarchy-cmd-audio-switch
+20
View File
@@ -0,0 +1,20 @@
local osdclient = "swayosd-client --monitor \"$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')\""
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd(osdclient .. " --output-volume raise"), { description = "Volume up", locked = true, repeating = true })
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd(osdclient .. " --output-volume lower"), { description = "Volume down", locked = true, repeating = true })
hl.bind("XF86AudioMute", hl.dsp.exec_cmd(osdclient .. " --output-volume mute-toggle"), { description = "Mute", locked = true, repeating = true })
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd(osdclient .. " --input-volume mute-toggle"), { description = "Mute microphone", locked = true, repeating = true })
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd(osdclient .. " --brightness raise"), { description = "Brightness up", locked = true, repeating = true })
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd(osdclient .. " --brightness lower"), { description = "Brightness down", locked = true, repeating = true })
hl.bind("ALT + XF86AudioRaiseVolume", hl.dsp.exec_cmd(osdclient .. " --output-volume +1"), { description = "Volume up precise", locked = true, repeating = true })
hl.bind("ALT + XF86AudioLowerVolume", hl.dsp.exec_cmd(osdclient .. " --output-volume -1"), { description = "Volume down precise", locked = true, repeating = true })
hl.bind("ALT + XF86MonBrightnessUp", hl.dsp.exec_cmd(osdclient .. " --brightness +1"), { description = "Brightness up precise", locked = true, repeating = true })
hl.bind("ALT + XF86MonBrightnessDown", hl.dsp.exec_cmd(osdclient .. " --brightness -1"), { description = "Brightness down precise", locked = true, repeating = true })
hl.bind("XF86AudioNext", hl.dsp.exec_cmd(osdclient .. " --playerctl next"), { description = "Next track", locked = true })
hl.bind("XF86AudioPause", hl.dsp.exec_cmd(osdclient .. " --playerctl play-pause"), { description = "Pause", locked = true })
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd(osdclient .. " --playerctl play-pause"), { description = "Play", locked = true })
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd(osdclient .. " --playerctl previous"), { description = "Previous track", locked = true })
hl.bind("SUPER + XF86AudioMute", hl.dsp.exec_cmd("omarchy-cmd-audio-switch"), { description = "Switch audio output", locked = true })
-74
View File
@@ -1,74 +0,0 @@
# Close windows
bindd = SUPER, Q, Close active window, killactive,
#bindd = CTRL ALT, DELETE, Close all Windows, exec, omarchy-cmd-close-all-windows
# Control tiling
bindd = SUPER, J, Toggle split, layoutmsg, togglesplit # dwindle
bindd = SUPER, P, Pseudo window, pseudo, # dwindle
bindd = SUPER, V, Toggle floating, togglefloating,
bindd = SHIFT, F11, Force full screen, fullscreen, 0
bindd = ALT, F11, Full width, fullscreen, 1
bindd = SUPER SHIFT, RETURN, Full width, fullscreen, 1
bindd = SUPER, numbersign, 1:1 split, layoutmsg, splitratio -2
bindd = SUPER, numbersign, 1:1 split, layoutmsg, splitratio 0.9
# Move focus with SUPER + arrow keys
bindd = SUPER, left, Move focus left, movefocus, l
bindd = SUPER, right, Move focus right, movefocus, r
bindd = SUPER, up, Move focus up, movefocus, u
bindd = SUPER, down, Move focus down, movefocus, d
# Switch workspaces with SUPER + [0-9]
bindd = SUPER, code:10, Switch to workspace 1, workspace, 1
bindd = SUPER, code:11, Switch to workspace 2, workspace, 2
bindd = SUPER, code:12, Switch to workspace 3, workspace, 3
bindd = SUPER, code:13, Switch to workspace 4, workspace, 4
bindd = SUPER, code:14, Switch to workspace 5, workspace, 5
bindd = SUPER, code:15, Switch to workspace 6, workspace, 6
bindd = SUPER, code:16, Switch to workspace 7, workspace, 7
bindd = SUPER, code:17, Switch to workspace 8, workspace, 8
bindd = SUPER, code:18, Switch to workspace 9, workspace, 9
bindd = SUPER, code:19, Switch to workspace 10, workspace, 10
# Move active window to a workspace with SUPER + SHIFT + [0-9]
bindd = SUPER SHIFT, code:10, Move window to workspace 1, movetoworkspace, 1
bindd = SUPER SHIFT, code:11, Move window to workspace 2, movetoworkspace, 2
bindd = SUPER SHIFT, code:12, Move window to workspace 3, movetoworkspace, 3
bindd = SUPER SHIFT, code:13, Move window to workspace 4, movetoworkspace, 4
bindd = SUPER SHIFT, code:14, Move window to workspace 5, movetoworkspace, 5
bindd = SUPER SHIFT, code:15, Move window to workspace 6, movetoworkspace, 6
bindd = SUPER SHIFT, code:16, Move window to workspace 7, movetoworkspace, 7
bindd = SUPER SHIFT, code:17, Move window to workspace 8, movetoworkspace, 8
bindd = SUPER SHIFT, code:18, Move window to workspace 9, movetoworkspace, 9
bindd = SUPER SHIFT, code:19, Move window to workspace 10, movetoworkspace, 10
# Tab between workspaces
bindd = SUPER, TAB, Next workspace, workspace, e+1
bindd = SUPER SHIFT, TAB, Previous workspace, workspace, e-1
bindd = SUPER CTRL, TAB, Former workspace, workspace, previous
# Swap active window with the one next to it with SUPER + SHIFT + arrow keys
bindd = SUPER SHIFT, left, Swap window to the left, swapwindow, l
bindd = SUPER SHIFT, right, Swap window to the right, swapwindow, r
bindd = SUPER SHIFT, up, Swap window up, swapwindow, u
bindd = SUPER SHIFT, down, Swap window down, swapwindow, d
# Cycle through applications on active workspace
bindd = ALT, Tab, Cycle to next window, cyclenext
bindd = ALT SHIFT, Tab, Cycle to prev window, cyclenext, prev
bindd = ALT, Tab, Reveal active window on top, bringactivetotop
bindd = ALT SHIFT, Tab, Reveal active window on top, bringactivetotop
# Resize active window
bindd = SUPER, code:20, Expand window left, resizeactive, -100 0 # - key
bindd = SUPER, code:21, Shrink window left, resizeactive, 100 0 # = key
bindd = SUPER SHIFT, code:20, Shrink window up, resizeactive, 0 -100
bindd = SUPER SHIFT, code:21, Expand window down, resizeactive, 0 100
# Scroll through existing workspaces with SUPER + scroll
bindd = SUPER, mouse_down, Scroll active workspace forward, workspace, e+1
bindd = SUPER, mouse_up, Scroll active workspace backward, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindmd = SUPER, mouse:272, Move window, movewindow
bindmd = SUPER, mouse:273, Resize window, resizewindow
+46
View File
@@ -0,0 +1,46 @@
hl.bind("SUPER + Q", hl.dsp.window.close(), { description = "Close active window" })
hl.bind("SUPER + J", hl.dsp.layout("togglesplit"), { description = "Toggle split" })
hl.bind("SUPER + P", hl.dsp.window.pseudo(), { description = "Pseudo window" })
hl.bind("SUPER + V", hl.dsp.window.float({ action = "toggle" }), { description = "Toggle floating" })
hl.bind("SHIFT + F11", hl.dsp.window.fullscreen(0), { description = "Force full screen" })
hl.bind("ALT + F11", hl.dsp.window.fullscreen(1), { description = "Full width" })
hl.bind("SUPER + SHIFT + RETURN", hl.dsp.window.fullscreen(1), { description = "Full width" })
hl.bind("SUPER + numbersign", hl.dsp.layout("splitratio -2"), { description = "1:1 split" })
hl.bind("SUPER + numbersign", hl.dsp.layout("splitratio 0.9"), { description = "1:1 split" })
hl.bind("SUPER + left", hl.dsp.focus({ direction = "left" }), { description = "Move focus left" })
hl.bind("SUPER + right", hl.dsp.focus({ direction = "right" }), { description = "Move focus right" })
hl.bind("SUPER + up", hl.dsp.focus({ direction = "up" }), { description = "Move focus up" })
hl.bind("SUPER + down", hl.dsp.focus({ direction = "down" }), { description = "Move focus down" })
for i = 1, 10 do
local key_code = 9 + i
hl.bind("SUPER + code:" .. tostring(key_code), hl.dsp.focus({ workspace = i }), { description = "Switch to workspace " .. tostring(i) })
hl.bind("SUPER + SHIFT + code:" .. tostring(key_code), hl.dsp.window.move({ workspace = i }), { description = "Move window to workspace " .. tostring(i) })
end
hl.bind("SUPER + TAB", hl.dsp.focus({ workspace = "e+1" }), { description = "Next workspace" })
hl.bind("SUPER + SHIFT + TAB", hl.dsp.focus({ workspace = "e-1" }), { description = "Previous workspace" })
hl.bind("SUPER + CTRL + TAB", hl.dsp.focus({ workspace = "previous" }), { description = "Former workspace" })
hl.bind("SUPER + SHIFT + left", hl.dsp.window.swap({ direction = "left" }), { description = "Swap window to the left" })
hl.bind("SUPER + SHIFT + right", hl.dsp.window.swap({ direction = "right" }), { description = "Swap window to the right" })
hl.bind("SUPER + SHIFT + up", hl.dsp.window.swap({ direction = "up" }), { description = "Swap window up" })
hl.bind("SUPER + SHIFT + down", hl.dsp.window.swap({ direction = "down" }), { description = "Swap window down" })
hl.bind("ALT + TAB", hl.dsp.exec_cmd("hyprctl dispatch cyclenext"), { description = "Cycle to next window" })
hl.bind("ALT + SHIFT + TAB", hl.dsp.exec_cmd("hyprctl dispatch cyclenext prev"), { description = "Cycle to prev window" })
hl.bind("ALT + TAB", hl.dsp.exec_cmd("hyprctl dispatch bringactivetotop"), { description = "Reveal active window on top" })
hl.bind("ALT + SHIFT + TAB", hl.dsp.exec_cmd("hyprctl dispatch bringactivetotop"), { description = "Reveal active window on top" })
hl.bind("SUPER + code:20", hl.dsp.window.resize({ x = -100, y = 0 }), { description = "Expand window left" })
hl.bind("SUPER + code:21", hl.dsp.window.resize({ x = 100, y = 0 }), { description = "Shrink window left" })
hl.bind("SUPER + SHIFT + code:20", hl.dsp.window.resize({ x = 0, y = -100 }), { description = "Shrink window up" })
hl.bind("SUPER + SHIFT + code:21", hl.dsp.window.resize({ x = 0, y = 100 }), { description = "Expand window down" })
hl.bind("SUPER + mouse_down", hl.dsp.focus({ workspace = "e+1" }), { description = "Scroll active workspace forward" })
hl.bind("SUPER + mouse_up", hl.dsp.focus({ workspace = "e-1" }), { description = "Scroll active workspace backward" })
hl.bind("SUPER + mouse:272", hl.dsp.window.drag(), { description = "Move window", mouse = true })
hl.bind("SUPER + mouse:273", hl.dsp.window.resize(), { description = "Resize window", mouse = true })
-49
View File
@@ -1,49 +0,0 @@
# Menus
bindd = SUPER, SPACE, Launch apps, exec, walker -p "Start…"
bindd = SUPER CTRL, E, Emoji picker, exec, walker -m Emojis
bindd = SUPER ALT, SPACE, Omarchy menu, exec, omarchy-menu
bindd = SUPER, ESCAPE, Power menu, exec, omarchy-menu system
bindld = , XF86PowerOff, Power menu, exec, omarchy-menu system
bindd = SUPER, K, Show key bindings, exec, omarchy-menu-keybindings
bindd = , XF86Calculator, Calculator, exec, gnome-calculator
bindd = SUPER, N, Notification center, exec, swaync-client -op
# Aesthetics
bindd = SUPER SHIFT, SPACE, Toggle top bar, exec, omarchy-toggle-waybar
bindd = SUPER CTRL, SPACE, Next background in theme, exec, omarchy-theme-bg-next
bindd = SUPER SHIFT CTRL, SPACE, Pick new theme, exec, omarchy-menu theme
bindd = SUPER, BACKSPACE, Toggle window transparency, exec, hyprctl dispatch setprop "address:$(hyprctl activewindow -j | jq -r '.address')" opaque toggle
# Notifications
bindd = SUPER, COMMA, Dismiss last notification, exec, makoctl dismiss
bindd = SUPER SHIFT, COMMA, Dismiss all notifications, exec, makoctl dismiss --all
bindd = SUPER CTRL, COMMA, Toggle silencing notifications, exec, makoctl mode -t do-not-disturb && makoctl mode | grep -q 'do-not-disturb' && notify-send "Silenced notifications" || notify-send "Enabled notifications"
# Toggle idling
bindd = SUPER CTRL, I, Toggle locking on idle, exec, omarchy-toggle-idle
# Toggle nightlight
bindd = SUPER CTRL, N, Toggle nightlight, exec, omarchy-toggle-nightlight
# Control Apple Display brightness
bindd = CTRL, F1, Apple Display brightness down, exec, omarchy-cmd-apple-display-brightness -5000
bindd = CTRL, F2, Apple Display brightness up, exec, omarchy-cmd-apple-display-brightness +5000
bindd = SHIFT CTRL, F2, Apple Display full brightness, exec, omarchy-cmd-apple-display-brightness +60000
# Screenshots
bindd = , PRINT, Screenshot of region, exec, ~/.config/hypr/scripts/cmd-screenshot region
bindd = SHIFT, PRINT, Screenshot of window, exec, ~/.config/hypr/scripts/cmd-screenshot windows
bindd = CTRL, PRINT, Screenshot of display, exec, ~/.config/hypr/scripts/cmd-screenshot fullscreen
# Screen recordings
bindd = ALT, PRINT, Screen record a region, exec, omarchy-cmd-screenrecord region
bindd = ALT SHIFT, PRINT, Screen record a region with audio, exec, omarchy-cmd-screenrecord region audio
bindd = CTRL ALT, PRINT, Screen record display, exec, omarchy-cmd-screenrecord output
bindd = CTRL ALT SHIFT, PRINT, Screen record display with audio, exec, omarchy-cmd-screenrecord output audio
# Color picker
bindd = SUPER, PRINT, Color picker, exec, pkill hyprpicker || hyprpicker -a
# File sharing
bindd = CTRL SUPER, S, Share, exec, omarchy-menu share
+37
View File
@@ -0,0 +1,37 @@
hl.bind("SUPER + SPACE", hl.dsp.exec_cmd("walker -p \"Start…\""), { description = "Launch apps" })
hl.bind("SUPER + CTRL + E", hl.dsp.exec_cmd("walker -m Emojis"), { description = "Emoji picker" })
hl.bind("SUPER + ALT + SPACE", hl.dsp.exec_cmd("omarchy-menu"), { description = "Omarchy menu" })
hl.bind("SUPER + ESCAPE", hl.dsp.exec_cmd("omarchy-menu system"), { description = "Power menu" })
hl.bind("XF86PowerOff", hl.dsp.exec_cmd("omarchy-menu system"), { description = "Power menu", locked = true })
hl.bind("SUPER + K", hl.dsp.exec_cmd("omarchy-menu-keybindings"), { description = "Show key bindings" })
hl.bind("XF86Calculator", hl.dsp.exec_cmd("gnome-calculator"), { description = "Calculator" })
hl.bind("SUPER + N", hl.dsp.exec_cmd("swaync-client -op"), { description = "Notification center" })
hl.bind("SUPER + SHIFT + SPACE", hl.dsp.exec_cmd("omarchy-toggle-waybar"), { description = "Toggle top bar" })
hl.bind("SUPER + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-theme-bg-next"), { description = "Next background in theme" })
hl.bind("SUPER + SHIFT + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-menu theme"), { description = "Pick new theme" })
hl.bind("SUPER + BACKSPACE", hl.dsp.exec_cmd("hyprctl dispatch setprop \"address:$(hyprctl activewindow -j | jq -r '.address')\" opaque toggle"), { description = "Toggle window transparency" })
hl.bind("SUPER + COMMA", hl.dsp.exec_cmd("makoctl dismiss"), { description = "Dismiss last notification" })
hl.bind("SUPER + SHIFT + COMMA", hl.dsp.exec_cmd("makoctl dismiss --all"), { description = "Dismiss all notifications" })
hl.bind("SUPER + CTRL + COMMA", hl.dsp.exec_cmd("makoctl mode -t do-not-disturb && makoctl mode | grep -q 'do-not-disturb' && notify-send 'Silenced notifications' || notify-send 'Enabled notifications'"), { description = "Toggle silencing notifications" })
hl.bind("SUPER + CTRL + I", hl.dsp.exec_cmd("omarchy-toggle-idle"), { description = "Toggle locking on idle" })
hl.bind("SUPER + CTRL + N", hl.dsp.exec_cmd("omarchy-toggle-nightlight"), { description = "Toggle nightlight" })
hl.bind("CTRL + F1", hl.dsp.exec_cmd("omarchy-cmd-apple-display-brightness -5000"), { description = "Apple Display brightness down" })
hl.bind("CTRL + F2", hl.dsp.exec_cmd("omarchy-cmd-apple-display-brightness +5000"), { description = "Apple Display brightness up" })
hl.bind("SHIFT + CTRL + F2", hl.dsp.exec_cmd("omarchy-cmd-apple-display-brightness +60000"), { description = "Apple Display full brightness" })
hl.bind("PRINT", hl.dsp.exec_cmd("~/.config/hypr/scripts/cmd-screenshot region"), { description = "Screenshot of region" })
hl.bind("SHIFT + PRINT", hl.dsp.exec_cmd("~/.config/hypr/scripts/cmd-screenshot windows"), { description = "Screenshot of window" })
hl.bind("CTRL + PRINT", hl.dsp.exec_cmd("~/.config/hypr/scripts/cmd-screenshot fullscreen"), { description = "Screenshot of display" })
hl.bind("ALT + PRINT", hl.dsp.exec_cmd("omarchy-cmd-screenrecord region"), { description = "Screen record a region" })
hl.bind("ALT + SHIFT + PRINT", hl.dsp.exec_cmd("omarchy-cmd-screenrecord region audio"), { description = "Screen record a region with audio" })
hl.bind("CTRL + ALT + PRINT", hl.dsp.exec_cmd("omarchy-cmd-screenrecord output"), { description = "Screen record display" })
hl.bind("CTRL + ALT + SHIFT + PRINT", hl.dsp.exec_cmd("omarchy-cmd-screenrecord output audio"), { description = "Screen record display with audio" })
hl.bind("SUPER + PRINT", hl.dsp.exec_cmd("pkill hyprpicker || hyprpicker -a"), { description = "Color picker" })
hl.bind("CTRL + SUPER + S", hl.dsp.exec_cmd("omarchy-menu share"), { description = "Share" })