Use the helpers where applicable

This commit is contained in:
David Heinemeier Hansson
2026-05-19 22:18:13 +02:00
parent 42f03655df
commit 97d4e908af
7 changed files with 89 additions and 100 deletions
+7 -5
View File
@@ -10,8 +10,10 @@ hl.layer_rule({ match = { namespace = "^(omarchy-menu|omarchy-app-launcher|omarc
-- Bar settings floats centered with a sensible default size instead of
-- tiling — it's a transient dialog, not a workspace surface.
hl.window_rule({
match = { class = "^org.quickshell$", title = "^Omarchy Bar Settings$" },
o.window({
class = "^org.quickshell$",
title = "^Omarchy Bar Settings$",
}, {
float = true,
center = true,
size = { 760, 620 },
@@ -19,9 +21,9 @@ hl.window_rule({
-- Dev gallery is the main shell workbench; open it maximized like
-- SUPER+ALT+F so component previews have the whole workspace.
hl.window_rule({ match = { class = "^org.quickshell$", title = "^Omarchy shell dev gallery$" }, maximize = true })
o.window({ class = "^org.quickshell$", title = "^Omarchy shell dev gallery$" }, { maximize = true })
-- Per-widget settings dialog opens as a smaller FloatingWindow off the
-- bar settings panel; keep it floating with its own default size.
hl.window_rule({ match = { class = "^org.quickshell$", title = "^Widget settings " }, float = true })
hl.window_rule({ match = { class = "^org.quickshell$", title = "^Widget settings " }, size = { 380, 320 } })
o.window({ class = "^org.quickshell$", title = "^Widget settings " }, { float = true })
o.window({ class = "^org.quickshell$", title = "^Widget settings " }, { size = { 380, 320 } })
+16 -25
View File
@@ -1,44 +1,35 @@
-- Floating windows.
hl.window_rule({ match = { tag = "floating-window" }, float = true })
hl.window_rule({ match = { tag = "floating-window" }, center = true })
hl.window_rule({ match = { tag = "floating-window" }, size = { 875, 600 } })
o.window({ tag = "floating-window" }, { float = true })
o.window({ tag = "floating-window" }, { center = true })
o.window({ tag = "floating-window" }, { size = { 875, 600 } })
hl.window_rule({
match = {
class = "(org.omarchy.btop|org.omarchy.terminal|org.omarchy.bash|org.codeberg.dnkl.foot|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Omarchy|About|TUI.float|imv|mpv)",
},
o.window("(org.omarchy.btop|org.omarchy.terminal|org.omarchy.bash|org.codeberg.dnkl.foot|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Omarchy|About|TUI.float|imv|mpv)", {
tag = "+floating-window",
})
hl.window_rule({
match = {
o.window(
{
class = "(xdg-desktop-portal-gtk|sublime_text|DesktopEditors|org.gnome.Nautilus)",
title = "^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*)",
},
tag = "+floating-window",
})
hl.window_rule({ match = { class = "org.gnome.Calculator" }, float = true })
{ tag = "+floating-window" }
)
o.window("org.gnome.Calculator", { float = true })
-- Fullscreen screensaver.
hl.window_rule({ match = { class = "org.omarchy.screensaver" }, fullscreen = true })
hl.window_rule({ match = { class = "org.omarchy.screensaver" }, float = true })
hl.window_rule({ match = { class = "org.omarchy.screensaver" }, animation = "slide" })
o.window("org.omarchy.screensaver", { fullscreen = true })
o.window("org.omarchy.screensaver", { float = true })
o.window("org.omarchy.screensaver", { animation = "slide" })
-- No transparency on media windows.
hl.window_rule({
match = {
class = "^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$",
},
o.window("^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$", {
tag = "-default-opacity",
})
hl.window_rule({
match = {
class = "^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$",
},
o.window("^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$", {
opacity = "1 1",
})
-- Popped window rounding.
hl.window_rule({ match = { tag = "pop" }, rounding = 8 })
o.window({ tag = "pop" }, { rounding = 8 })
-- Prevent idle while open.
hl.window_rule({ match = { tag = "noidle" }, idle_inhibit = "always" })
o.window({ tag = "noidle" }, { idle_inhibit = "always" })
+2 -2
View File
@@ -4,10 +4,10 @@ hl.on("hyprland.start", function()
hl.exec_cmd("dbus-update-activation-environment --systemd --all")
hl.exec_cmd("quickshell -n -p $HOME/.local/share/omarchy/shell")
hl.exec_cmd("uwsm-app -- fcitx5 --disable notificationitem")
hl.exec_cmd(o.launch("fcitx5 --disable notificationitem"))
hl.exec_cmd("omarchy-first-run")
hl.exec_cmd("omarchy-powerprofiles-init")
hl.exec_cmd("uwsm-app -- omarchy-hyprland-monitor-watch")
hl.exec_cmd(o.launch("omarchy-hyprland-monitor-watch"))
-- Run post-boot hooks after startup config has loaded.
hl.exec_cmd("sleep 2 && omarchy-hook post-boot")
+1 -1
View File
@@ -10,7 +10,7 @@ o.bind("SHIFT + XF86MonBrightnessDown", "Brightness minimum", "omarchy-brightnes
o.bind("XF86KbdBrightnessUp", "Keyboard brightness up", "omarchy-brightness-keyboard up", { locked = true, repeating = true })
o.bind("XF86KbdBrightnessDown", "Keyboard brightness down", "omarchy-brightness-keyboard down", { locked = true, repeating = true })
o.bind("XF86KbdLightOnOff", "Keyboard backlight cycle", "omarchy-brightness-keyboard cycle", { locked = true })
o.bind("XF86TouchpadToggle", "Toggle touchpad", "omarchy-toggle-touchpad", { locked = true })
o.bind_toggle("XF86TouchpadToggle", "Toggle touchpad", "touchpad", { locked = true })
o.bind("XF86TouchpadOn", "Enable touchpad", "omarchy-toggle-touchpad on", { locked = true })
o.bind("XF86TouchpadOff", "Disable touchpad", "omarchy-toggle-touchpad off", { locked = true })
+59 -59
View File
@@ -1,76 +1,76 @@
hl.bind("SUPER + SPACE", hl.dsp.exec_cmd("omarchy-shell shell toggle omarchy.app-launcher \"{}\""), { description = "Launch apps" })
hl.bind("SUPER + CTRL + E", hl.dsp.exec_cmd("omarchy-shell shell toggle omarchy.emoji-picker \"{}\""), { description = "Emoji picker" })
hl.bind("SUPER + CTRL + C", hl.dsp.exec_cmd("omarchy-shell menu toggle capture"), { description = "Capture menu" })
hl.bind("SUPER + CTRL + O", hl.dsp.exec_cmd("omarchy-shell menu toggle toggle"), { description = "Toggle menu" })
hl.bind("SUPER + CTRL + H", hl.dsp.exec_cmd("omarchy-shell menu toggle hardware"), { description = "Hardware menu" })
hl.bind("SUPER + ALT + SPACE", hl.dsp.exec_cmd("omarchy-shell menu toggle root"), { description = "Omarchy menu" })
hl.bind("SUPER + SHIFT + code:201", hl.dsp.exec_cmd("omarchy-shell menu toggle root"), { description = "Omarchy menu" })
hl.bind("SUPER + ESCAPE", hl.dsp.exec_cmd("omarchy-shell menu toggle system"), { description = "System menu" })
hl.bind("XF86PowerOff", hl.dsp.exec_cmd("omarchy-shell menu toggle system"), { locked = true, description = "Power menu" })
hl.bind("SUPER + K", hl.dsp.exec_cmd("omarchy-menu-keybindings"), { description = "Show key bindings" })
hl.bind("SUPER + ALT + K", hl.dsp.exec_cmd("omarchy-menu-tmux-keybindings"), { description = "Show Tmux key bindings" })
hl.bind("XF86Calculator", hl.dsp.exec_cmd("gnome-calculator"), { description = "Calculator" })
o.bind("SUPER + SPACE", "Launch apps", "omarchy-shell shell toggle omarchy.app-launcher \"{}\"")
o.bind("SUPER + CTRL + E", "Emoji picker", "omarchy-shell shell toggle omarchy.emoji-picker \"{}\"")
o.bind("SUPER + CTRL + C", "Capture menu", "omarchy-shell menu toggle capture")
o.bind("SUPER + CTRL + O", "Toggle menu", "omarchy-shell menu toggle toggle")
o.bind("SUPER + CTRL + H", "Hardware menu", "omarchy-shell menu toggle hardware")
o.bind("SUPER + ALT + SPACE", "Omarchy menu", "omarchy-shell menu toggle root")
o.bind("SUPER + SHIFT + code:201", "Omarchy menu", "omarchy-shell menu toggle root")
o.bind("SUPER + ESCAPE", "System menu", "omarchy-shell menu toggle system")
o.bind("XF86PowerOff", "Power menu", "omarchy-shell menu toggle system", { locked = true })
o.bind("SUPER + K", "Show key bindings", "omarchy-menu-keybindings")
o.bind("SUPER + ALT + K", "Show Tmux key bindings", "omarchy-menu-tmux-keybindings")
o.bind("XF86Calculator", "Calculator", "gnome-calculator")
hl.bind("SUPER + SHIFT + SPACE", hl.dsp.exec_cmd("omarchy-toggle-bar"), { description = "Toggle top bar" })
hl.bind("SUPER + SHIFT + CTRL + UP", hl.dsp.exec_cmd("omarchy-style-bar-position top"), { description = "Move bar to top" })
hl.bind("SUPER + SHIFT + CTRL + DOWN", hl.dsp.exec_cmd("omarchy-style-bar-position bottom"), { description = "Move bar to bottom" })
hl.bind("SUPER + SHIFT + CTRL + LEFT", hl.dsp.exec_cmd("omarchy-style-bar-position left"), { description = "Move bar to left" })
hl.bind("SUPER + SHIFT + CTRL + RIGHT", hl.dsp.exec_cmd("omarchy-style-bar-position right"), { description = "Move bar to right" })
hl.bind("SUPER + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-shell menu toggle background"), { description = "Background switcher" })
hl.bind("SUPER + SHIFT + CTRL + SPACE", hl.dsp.exec_cmd("omarchy-shell menu toggle theme"), { description = "Theme menu" })
hl.bind("SUPER + BACKSPACE", hl.dsp.exec_cmd("omarchy-hyprland-window-transparency-toggle"), { description = "Toggle window transparency" })
hl.bind("SUPER + SHIFT + BACKSPACE", hl.dsp.exec_cmd("omarchy-hyprland-window-gaps-toggle"), { description = "Toggle window gaps" })
hl.bind("SUPER + CTRL + BACKSPACE", hl.dsp.exec_cmd("omarchy-hyprland-window-single-square-aspect-toggle"), { description = "Toggle single-window square aspect" })
o.bind_toggle("SUPER + SHIFT + SPACE", "Toggle top bar", "bar")
o.bind("SUPER + SHIFT + CTRL + UP", "Move bar to top", "omarchy-style-bar-position top")
o.bind("SUPER + SHIFT + CTRL + DOWN", "Move bar to bottom", "omarchy-style-bar-position bottom")
o.bind("SUPER + SHIFT + CTRL + LEFT", "Move bar to left", "omarchy-style-bar-position left")
o.bind("SUPER + SHIFT + CTRL + RIGHT", "Move bar to right", "omarchy-style-bar-position right")
o.bind("SUPER + CTRL + SPACE", "Background switcher", "omarchy-shell menu toggle background")
o.bind("SUPER + SHIFT + CTRL + SPACE", "Theme menu", "omarchy-shell menu toggle theme")
o.bind("SUPER + BACKSPACE", "Toggle window transparency", "omarchy-hyprland-window-transparency-toggle")
o.bind("SUPER + SHIFT + BACKSPACE", "Toggle window gaps", "omarchy-hyprland-window-gaps-toggle")
o.bind("SUPER + CTRL + BACKSPACE", "Toggle single-window square aspect", "omarchy-hyprland-window-single-square-aspect-toggle")
-- xkbcommon names the comma keysym "comma"; the upper-case "COMMA" does not match.
hl.bind("SUPER + comma", hl.dsp.exec_cmd("omarchy-shell notifications dismissOne"), { description = "Dismiss last notification" })
hl.bind("SUPER + SHIFT + comma", hl.dsp.exec_cmd("omarchy-shell notifications dismissAll"), { description = "Dismiss all notifications" })
hl.bind("SUPER + CTRL + comma", hl.dsp.exec_cmd("omarchy-toggle-notification-silencing"), { description = "Toggle silencing notifications" })
hl.bind("SUPER + ALT + comma", hl.dsp.exec_cmd("omarchy-shell notifications invokeLast"), { description = "Invoke last notification" })
hl.bind("SUPER + SHIFT + ALT + comma", hl.dsp.exec_cmd("omarchy-shell notifications showHistory"), { description = "Open notification history" })
o.bind("SUPER + comma", "Dismiss last notification", "omarchy-shell notifications dismissOne")
o.bind("SUPER + SHIFT + comma", "Dismiss all notifications", "omarchy-shell notifications dismissAll")
o.bind_toggle("SUPER + CTRL + comma", "Toggle silencing notifications", "notification-silencing")
o.bind("SUPER + ALT + comma", "Invoke last notification", "omarchy-shell notifications invokeLast")
o.bind("SUPER + SHIFT + ALT + comma", "Open notification history", "omarchy-shell notifications showHistory")
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("SUPER + CTRL + Delete", hl.dsp.exec_cmd("omarchy-hyprland-monitor-internal toggle"), { description = "Toggle laptop display" })
hl.bind("SUPER + CTRL + ALT + Delete", hl.dsp.exec_cmd("omarchy-hyprland-monitor-internal-mirror toggle"), { description = "Toggle laptop display mirroring" })
hl.bind("switch:on:Lid Switch", hl.dsp.exec_cmd("omarchy-hw-external-monitors && omarchy-hyprland-monitor-internal off"), { locked = true })
hl.bind("switch:off:Lid Switch", hl.dsp.exec_cmd("omarchy-hyprland-monitor-internal on"), { locked = true })
o.bind_toggle("SUPER + CTRL + I", "Toggle locking on idle", "idle")
o.bind_toggle("SUPER + CTRL + N", "Toggle nightlight", "nightlight")
o.bind("SUPER + CTRL + Delete", "Toggle laptop display", "omarchy-hyprland-monitor-internal toggle")
o.bind("SUPER + CTRL + ALT + Delete", "Toggle laptop display mirroring", "omarchy-hyprland-monitor-internal-mirror toggle")
o.bind("switch:on:Lid Switch", nil, "omarchy-hw-external-monitors && omarchy-hyprland-monitor-internal off", { locked = true })
o.bind("switch:off:Lid Switch", nil, "omarchy-hyprland-monitor-internal on", { locked = true })
hl.bind("PRINT", hl.dsp.exec_cmd("omarchy-capture-screenshot"), { description = "Screenshot" })
hl.bind("ALT + PRINT", hl.dsp.exec_cmd("omarchy-capture-screenrecording --stop-recording || omarchy-shell menu toggle trigger.capture.screenrecord"), { description = "Screenrecording" })
hl.bind("SUPER + PRINT", hl.dsp.exec_cmd("pkill hyprpicker || hyprpicker -a"), { description = "Color picker" })
hl.bind("SUPER + CTRL + PRINT", hl.dsp.exec_cmd("omarchy-capture-text-extraction"), { description = "Extract text (OCR) from screenshot" })
o.bind("PRINT", "Screenshot", "omarchy-capture-screenshot")
o.bind("ALT + PRINT", "Screenrecording", "omarchy-capture-screenrecording --stop-recording || omarchy-shell menu toggle trigger.capture.screenrecord")
o.bind("SUPER + PRINT", "Color picker", "pkill hyprpicker || hyprpicker -a")
o.bind("SUPER + CTRL + PRINT", "Extract text (OCR) from screenshot", "omarchy-capture-text-extraction")
hl.bind("SUPER + CTRL + S", hl.dsp.exec_cmd("omarchy-shell menu toggle share"), { description = "Share" })
o.bind("SUPER + CTRL + S", "Share", "omarchy-shell menu toggle share")
hl.bind("SUPER + CTRL + PERIOD", hl.dsp.exec_cmd("omarchy-transcode"), { description = "Transcode" })
o.bind("SUPER + CTRL + PERIOD", "Transcode", "omarchy-transcode")
hl.bind("SUPER + CTRL + R", hl.dsp.exec_cmd("omarchy-shell menu toggle reminder-set"), { description = "Set reminder" })
hl.bind("SUPER + CTRL + ALT + R", hl.dsp.exec_cmd("omarchy-reminder show"), { description = "Show reminders" })
hl.bind("SUPER + SHIFT + CTRL + R", hl.dsp.exec_cmd("omarchy-reminder clear"), { description = "Clear reminders" })
o.bind("SUPER + CTRL + R", "Set reminder", "omarchy-shell menu toggle reminder-set")
o.bind("SUPER + CTRL + ALT + R", "Show reminders", "omarchy-reminder show")
o.bind("SUPER + SHIFT + CTRL + R", "Clear reminders", "omarchy-reminder clear")
hl.bind("SUPER + CTRL + ALT + T", hl.dsp.exec_cmd("omarchy-notification-time"), { description = "Show time" })
hl.bind("SUPER + CTRL + ALT + B", hl.dsp.exec_cmd("omarchy-notification-battery"), { description = "Show battery remaining" })
hl.bind("SUPER + CTRL + ALT + W", hl.dsp.exec_cmd("omarchy-notification-weather"), { description = "Show weather" })
o.bind("SUPER + CTRL + ALT + T", "Show time", "omarchy-notification-time")
o.bind("SUPER + CTRL + ALT + B", "Show battery remaining", "omarchy-notification-battery")
o.bind("SUPER + CTRL + ALT + W", "Show weather", "omarchy-notification-weather")
hl.bind("SUPER + CTRL + A", hl.dsp.exec_cmd("omarchy-shell audioPanel toggle"), { description = "Audio panel" })
hl.bind("SUPER + CTRL + B", hl.dsp.exec_cmd("omarchy-shell bluetoothPanel toggle"), { description = "Bluetooth panel" })
hl.bind("SUPER + CTRL + D", hl.dsp.exec_cmd("omarchy-shell monitorPanel toggle"), { description = "Display panel" })
hl.bind("SUPER + CTRL + W", hl.dsp.exec_cmd("omarchy-shell networkPanel toggle"), { description = "Network panel" })
hl.bind("SUPER + CTRL + P", hl.dsp.exec_cmd("omarchy-shell powerPanel toggle"), { description = "Power panel" })
hl.bind("SUPER + CTRL + T", hl.dsp.exec_cmd("omarchy-launch-tui btop"), { description = "Activity" })
o.bind("SUPER + CTRL + A", "Audio panel", "omarchy-shell audioPanel toggle")
o.bind("SUPER + CTRL + B", "Bluetooth panel", "omarchy-shell bluetoothPanel toggle")
o.bind("SUPER + CTRL + D", "Display panel", "omarchy-shell monitorPanel toggle")
o.bind("SUPER + CTRL + W", "Network panel", "omarchy-shell networkPanel toggle")
o.bind("SUPER + CTRL + P", "Power panel", "omarchy-shell powerPanel toggle")
o.bind("SUPER + CTRL + T", "Activity", { tui = "btop" })
hl.bind("SUPER + CTRL + X", hl.dsp.exec_cmd("voxtype record toggle"), { description = "Toggle dictation" })
hl.bind("F9", hl.dsp.exec_cmd("voxtype record start"), { description = "Start dictation (push-to-talk)" })
hl.bind("F9", hl.dsp.exec_cmd("voxtype record stop"), { release = true, description = "Stop dictation (push-to-talk)" })
o.bind("SUPER + CTRL + X", "Toggle dictation", "voxtype record toggle")
o.bind("F9", "Start dictation (push-to-talk)", "voxtype record start")
o.bind("F9", "Stop dictation (push-to-talk)", "voxtype record stop", { release = true })
hl.bind("SUPER + CTRL + Z", function()
o.bind("SUPER + CTRL + Z", "Zoom in", function()
local zoom = hl.get_config("cursor.zoom_factor") or 1
hl.config({ cursor = { zoom_factor = zoom + 1 } })
end, { description = "Zoom in" })
end)
hl.bind("SUPER + CTRL + ALT + Z", function()
o.bind("SUPER + CTRL + ALT + Z", "Reset zoom", function()
hl.config({ cursor = { zoom_factor = 1 } })
end, { description = "Reset zoom" })
end)
hl.bind("SUPER + CTRL + L", hl.dsp.exec_cmd("omarchy-system-lock"), { description = "Lock system" })
o.bind("SUPER + CTRL + L", "Lock system", "omarchy-system-lock")
-4
View File
@@ -76,10 +76,6 @@ function o.launch_sole(match, command)
return "omarchy-launch-or-focus " .. shell_quote(match) .. " " .. shell_quote(o.launch(command))
end
function o.bind_menu(keys, description, menu, options)
o.bind(keys, description, menu and ("omarchy-menu " .. menu) or "omarchy-menu", options)
end
function o.bind_toggle(keys, description, toggle, options)
o.bind(keys, description, "omarchy-toggle-" .. toggle, options)
end
+4 -4
View File
@@ -6,8 +6,8 @@ o.window(".*", { suppress_event = "maximize" })
o.window(".*", { tag = "+default-opacity" })
-- Fix some dragging issues with XWayland.
hl.window_rule({
match = {
o.window(
{
class = "^$",
title = "^$",
xwayland = true,
@@ -15,8 +15,8 @@ hl.window_rule({
fullscreen = false,
pin = false,
},
no_focus = true,
})
{ no_focus = true }
)
-- App-specific tweaks (may remove default-opacity tag).
require("default.hypr.apps")