Add Omarchy Hyprland bindings

This commit is contained in:
2026-10-09 00:51:49 -04:00
parent 5b31d14829
commit e73d3acc39
13 changed files with 680 additions and 419 deletions
+112
View File
@@ -0,0 +1,112 @@
hl.bind("SUPER + CTRL + I", hl.dsp.exec_raw("omarchy-toggle-idle"), { description = "Toggle locking on idle" })
hl.bind("SUPER + CTRL + N", hl.dsp.exec_raw("omarchy-toggle-nightlight"), { description = "Toggle nightlight" })
hl.bind("SUPER + CTRL + Delete", hl.dsp.exec_raw("omarchy-hyprland-monitor-internal toggle"),
{ description = "Toggle laptop display" })
hl.bind("SUPER + CTRL + ALT + Delete", hl.dsp.exec_raw("omarchy-hyprland-monitor-internal-mirror toggle"),
{ description = "Toggle laptop display mirroring" })
hl.bind("switch:on:Lid Switch", hl.dsp.exec_raw("omarchy-system-lid-close"), { locked = true, description = nil })
hl.bind("switch:off:Lid Switch", hl.dsp.exec_raw("omarchy-hyprland-monitor-clamshell"),
{ locked = true, description = nil })
hl.bind("PRINT", hl.dsp.exec_raw("omarchy-capture-screenshot"), { description = "Screenshot" })
hl.bind("ALT + PRINT",
hl.dsp.exec_raw(
"omarchy-capture-screenrecording --stop-recording || omarchy-menu toggle trigger.capture.screenrecord"),
{ description = "Screenrecording" })
hl.bind("SUPER + ALT + code:34", hl.dsp.exec_raw("omarchy-capture-webcam-resize smaller"),
{ description = "Make webcam overlay smaller" })
hl.bind("SUPER + ALT + code:35", hl.dsp.exec_raw("omarchy-capture-webcam-resize larger"),
{ description = "Make webcam overlay larger" })
hl.bind("SUPER + PRINT", hl.dsp.exec_raw("pkill hyprpicker || hyprpicker -a"), { description = "Color picker" })
hl.bind("SUPER + CTRL + PRINT", hl.dsp.exec_raw("omarchy-capture-text"),
{ description = "Extract text (OCR) from screenshot" })
-- Keyboard control for the slurp region picker (see omarchy-capture-region).
-- The binds live exactly as long as a selection layer is on screen (slurp
-- opens one per monitor), so they cannot leak or get stuck.
-- Unbinding by key would take a same-key binding out of the user's own config
-- with it, so each handle is kept and removed individually.
local selection_layers = 0
local selection_binds = {}
hl.on("layer.opened", function(layer)
if layer.namespace == "selection" then
selection_layers = selection_layers + 1
if selection_layers == 1 then
selection_binds = {
hl.bind("RETURN", hl.dsp.exec_cmd("omarchy-capture-region --take-window"),
{ description = "Capture highlighted window" }),
hl.bind("CTRL + RETURN", hl.dsp.exec_cmd("omarchy-capture-region --take-fullscreen"),
{ description = "Capture entire screen" }),
hl.bind("TAB", hl.dsp.exec_cmd("omarchy-capture-region --select-window next"),
{ description = "Select next window to capture" }),
hl.bind("CTRL + TAB", hl.dsp.exec_cmd("omarchy-capture-region --select-window prev"),
{ description = "Select previous window to capture" }),
}
for _, direction in ipairs({ "left", "right", "up", "down" }) do
table.insert(
selection_binds,
hl.bind(direction:upper(), hl.dsp.exec_cmd("omarchy-capture-region --select-window " .. direction),
{ description = "Select window to capture" })
)
end
end
end
end)
hl.on("layer.closed", function(layer)
if layer.namespace == "selection" and selection_layers > 0 then
selection_layers = selection_layers - 1
if selection_layers == 0 then
for _, keybind in ipairs(selection_binds) do
keybind:unbind()
end
selection_binds = {}
end
end
end)
hl.bind("SUPER + CTRL + S", hl.dsp.exec_raw("omarchy-menu toggle share"), { description = "Share" })
hl.bind("SUPER + CTRL + PERIOD", hl.dsp.exec_raw("omarchy-transcode"), { description = "Transcode" })
hl.bind("SUPER + CTRL + R", hl.dsp.exec_raw("omarchy-menu toggle reminder-set"), { description = "Set reminder" })
hl.bind("SUPER + CTRL + ALT + R", hl.dsp.exec_raw("omarchy-reminder show"), { description = "Show reminders" })
hl.bind("SUPER + SHIFT + CTRL + R", hl.dsp.exec_raw("omarchy-reminder clear"), { description = "Clear reminders" })
hl.bind("SUPER + CTRL + ALT + T", hl.dsp.exec_raw("omarchy-notification-time"), { description = "Show time" })
hl.bind("SUPER + CTRL + ALT + B", hl.dsp.exec_raw("omarchy-notification-battery"),
{ description = "Show battery remaining" })
hl.bind("SUPER + CTRL + ALT + W", hl.dsp.exec_raw("omarchy-notification-weather"), { description = "Toggle weather" })
hl.bind("SUPER + SHIFT + CTRL + A", hl.dsp.exec_raw("omarchy-agent --pick"), { description = "Agent" })
hl.bind("SUPER + CTRL + A", hl.dsp.exec_raw("omarchy-shell shell toggle omarchy.audio"), { description = "Audio" })
hl.bind("SUPER + CTRL + B", hl.dsp.exec_raw("omarchy-shell shell tnoggle omarchy.bluetooth"),
{ description = "Bluetooth" })
hl.bind("SUPER + CTRL + D", hl.dsp.exec_raw("omarchy-shell shell toggle omarchy.monitor"), { description = "Display" })
hl.bind("SUPER + CTRL + ALT + D", hl.dsp.exec_raw("omarchy-shell shell toggle omarchy.clock"),
{ description = "Calendar" })
hl.bind("SUPER + CTRL + W", hl.dsp.exec_raw("omarchy-shell shell toggle omarchy.network"), { description = "Network" })
hl.bind("SUPER + CTRL + P", hl.dsp.exec_raw("omarchy-shell shell toggle omarchy.power"), { description = "Power" })
-- The letters above name a panel; the numbers count them. 1 is the leftmost
-- panel in the bar's right section, and a widget with no panel of its own (the
-- tray) is not counted, so the number matches the icon a user would point at.
-- A bar with fewer panels than this leaves the tail of the range doing nothing.
for panel = 1, 9 do
hl.bind(
"SUPER + CTRL + code:" .. tostring(panel + 9),
hl.dsp.exec_raw("omarchy-shell -q shell togglePanelAt right " .. panel),
{ description = "Bar panel " .. panel }
)
end
hl.bind("SUPER + CTRL + Z", function()
local zoom = hl.get_config("cursor.zoom_factor") or 1
hl.config({ cursor = { zoom_factor = zoom + 1 } })
end, { description = "Zoom in" })
hl.bind("SUPER + CTRL + ALT + Z", function()
hl.config({ cursor = { zoom_factor = 1 } })
end, { description = "Reset zoom" })