From 755ca204e4cf2ffd09acc2a85b378ea5041de1df Mon Sep 17 00:00:00 2001 From: Joseph Montanaro Date: Fri, 2 Oct 2026 09:57:17 -0400 Subject: [PATCH] migrate keybinds to new Lua format --- dot_config/hypr/bindings.conf | 70 --------------- dot_config/hypr/bindings.lua | 165 ++++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+), 70 deletions(-) delete mode 100644 dot_config/hypr/bindings.conf create mode 100644 dot_config/hypr/bindings.lua diff --git a/dot_config/hypr/bindings.conf b/dot_config/hypr/bindings.conf deleted file mode 100644 index b02bd6a..0000000 --- a/dot_config/hypr/bindings.conf +++ /dev/null @@ -1,70 +0,0 @@ -# Application bindings -$terminal = uwsm-app -- xdg-terminal-exec -$browser = omarchy-launch-browser - -bindd = SUPER, return, Terminal, exec, $terminal --dir=$(omarchy-cmd-terminal-cwd) -bindd = SUPER, F, File manager, exec, uwsm app -- nautilus --new-window -bindd = SUPER, B, Browser, exec, $browser -bindd = SUPER SHIFT, B, Browser (private), exec, $browser --private -bindd = SUPER, M, Music, exec, omarchy-launch-or-focus spotify -bindd = SUPER, N, Notes, exec, heynote -bindd = SUPER, T, Activity, exec, omarchy-launch-tui btop -bindd = SUPER ALT, D, Docker, exec, omarchy-launch-tui lazydocker - -# If your web app url contains #, type it as ## to prevent hyperland treat it as comments -bindd = SUPER, A, Claude, exec, omarchy-launch-webapp "https://claude.ai/new" -bindd = SUPER, E, Email, exec, omarchy-launch-webapp "https://mail.google.com/mail/u/0/" -bindd = SUPER, Y, YouTube, exec, omarchy-launch-webapp "https://youtube.com/" -bindd = SUPER, G, GitLab, exec, omarchy-launch-webapp "https://gitlab.modg.net/" -bindd = SUPER ALT, G, Google Messages, exec, omarchy-launch-or-focus-webapp "Google Messages" "https://messages.google.com/web/conversations" -bindd = SUPER, O, modgoffice, exec, omarchy-launch-webapp "https://office.modg.org" - -# lazy apps: Launch if not currently running, otherwise just switch to that app -bindd = SUPER, D, Open/focus DataGrip, exec, ~/.local/bin/lazy-app class:jetbrains-datagrip ~/.local/share/JetBrains/Toolbox/apps/datagrip/bin/datagrip - -# omarchy uses swapwindow for these binds, but I prefer movewindow so that it can cross monitor boundaries -unbind = SUPER SHIFT, LEFT -unbind = SUPER SHIFT, RIGHT -unbind = SUPER SHIFT, UP -unbind = SUPER SHIFT, DOWN -bindd = SUPER SHIFT, left, Move window to the left, movewindow, l -bindd = SUPER SHIFT, right, Move window to the right, movewindow, r -bindd = SUPER SHIFT, up, Move window up, movewindow, u -bindd = SUPER SHIFT, down, Move window down, movewindow, d - -bindd = SUPER ALT, left, Move current workspace to the left, movecurrentworkspacetomonitor, l -bindd = SUPER ALT, right, Move current workspace to the right, movecurrentworkspacetomonitor, r -bindd = SUPER ALT, up, Move current workspace up, movecurrentworkspacetomonitor, u -bindd = SUPER ALT, down, Move current workspace down, movecurrentworkspacetomonitor, d - -# create a new workspace -bindd = SUPER, grave, Create a mew workspace, exec, ~/.local/bin/new-workspace - -# keybinds for background apps -bindd = SUPER, S, Show/hide Slack, togglespecialworkspace, slack -bindd = SUPER, period, 1Password quick access, exec, 1password --quick-access -bindd = SUPER CTRL, period, Show/hide 1Password, togglespecialworkspace, 1password -bindd = SUPER, Z, Show Creddy, exec, creddy shortcut show-window - -# I'm used to super+L to lock screen -bindd = SUPER, L, Lock screen, exec, omarchy-lock-screen - -# I don't want ctrl+alt+delete to affect my "special" apps -unbind = CTRL ALT, DELETE -bindd = CTRL ALT, DELETE, Close all windows (except special), exec, ~/.local/bin/close-non-special-windows - -# for WHATEVER reason, hyprland refuses to use the numeric symbols for keypad keys, -# so we have to use the navigation symbols instead -bindd = SUPER, KP_End, Switch to workspace 1, workspace, 1 -bindd = SUPER, KP_Down, Switch to workspace 2, workspace, 2 -bindd = SUPER, KP_Next, Switch to workspace 3, workspace, 3 -bindd = SUPER, KP_Left, Switch to workspace 4, workspace, 4 -bindd = SUPER, KP_Begin, Switch to workspace 5, workspace, 5 -bindd = SUPER, KP_Right, Switch to workspace 6, workspace, 6 -bindd = SUPER, KP_Home, Switch to workspace 7, workspace, 7 -bindd = SUPER, KP_Up, Switch to workspace 8, workspace, 8 -bindd = SUPER, KP_Prior, Switch to workspace 9, workspace, 9 - -# I miss notifications a lot -bindd = SUPER ALT, N, Toggle latest notification, exec, ~/.local/bin/toggle-last-notification - diff --git a/dot_config/hypr/bindings.lua b/dot_config/hypr/bindings.lua new file mode 100644 index 0000000..ed9e0a8 --- /dev/null +++ b/dot_config/hypr/bindings.lua @@ -0,0 +1,165 @@ +-- Keep only your personal keybinding overrides here. Add new bindings or +-- unbind defaults before replacing them. + +-- See current bindings and descriptions: +-- omarchy menu keybindings --print + +-- To disable every Omarchy default binding, set this in +-- ~/.config/hypr/hyprland.lua before require("default.hypr.omarchy"), then add +-- only the bindings you want below: +-- omarchy_default_bindings = false + +-- To disable all preinstalled app/webapp bindings, set: +-- omarchy_preinstalled_bindings = false + +-- Add a new binding. +-- o.bind("SUPER + SHIFT + R", "SSH", "alacritty -e ssh your-server") + +-- Change an existing binding by unbinding it first, then binding the key again. +-- This example changes SUPER+SPACE from the launcher to the Omarchy root menu. +-- hl.unbind("SUPER + SPACE") +-- o.bind("SUPER + SPACE", "Omarchy menu", "omarchy-menu toggle root") + +-- Disable a default binding without replacing it. +-- hl.unbind("SUPER + SHIFT + B") + +-- Logitech MX Keys examples: +-- o.bind("SUPER + SHIFT + S", nil, "omarchy-capture-screenshot") +-- o.bind("SUPER + H", nil, "voxtype record toggle") +-- o.bind("SUPER + PERIOD", nil, "omarchy-shell shell toggle omarchy.emojis") + + +--- ********************** +--- WINDOW MANAGEMENT +--- ********************** +--- I prefer `move` over `swap` because it works closer to how I expect +hl.unbind("SUPER + SHIFT + LEFT") +hl.unbind("SUPER + SHIFT + RIGHT") +hl.unbind("SUPER + SHIFT + UP") +hl.unbind("SUPER + SHIFT + DOWN") +o.bind("SUPER + SHIFT + LEFT", "Move window to the left", hl.dsp.window.move({ direction = "l" })) +o.bind("SUPER + SHIFT + RIGHT", "Move window to the right", hl.dsp.window.move({ direction = "r" })) +o.bind("SUPER + SHIFT + UP", "Move window up", hl.dsp.window.move({ direction = "u" })) +o.bind("SUPER + SHIFT + DOWN", "Move window down", hl.dsp.window.move({ direction = "d" })) + +-- these default to "Move window to group on " +hl.unbind("SUPER + ALT + LEFT") +hl.unbind("SUPER + ALT + RIGHT") +hl.unbind("SUPER + ALT + UP") +hl.unbind("SUPER + ALT + DOWN") +o.bind("SUPER + ALT + LEFT", "Move current workspace to the left", hl.dsp.workspace.move({ monitor = "l" })) +o.bind("SUPER + ALT + RIGHT", "Move current workspace to the right", hl.dsp.workspace.move({ monitor = "r" })) +o.bind("SUPER + ALT + UP", "Move current workspace up", hl.dsp.workspace.move({ monitor = "u" })) +o.bind("SUPER + ALT + DOWN", "Move current workspace down", hl.dsp.workspace.move({ monitor = "d" })) + +-- for WHATEVER reason, hyprland refuses to use the numeric symbols for keypad keys, +-- so we have to use the navigation symbols instead +o.bind("SUPER + KP_End", "Switch to workspace 1", hl.dsp.focus({ workspace = "1" })) +o.bind("SUPER + KP_Down", "Switch to workspace 2", hl.dsp.focus({ workspace = "2" })) +o.bind("SUPER + KP_Next", "Switch to workspace 3", hl.dsp.focus({ workspace = "3" })) +o.bind("SUPER + KP_Left", "Switch to workspace 4", hl.dsp.focus({ workspace = "4" })) +o.bind("SUPER + KP_Begin", "Switch to workspace 5", hl.dsp.focus({ workspace = "5" })) +o.bind("SUPER + KP_Right", "Switch to workspace 6", hl.dsp.focus({ workspace = "6" })) +o.bind("SUPER + KP_Home", "Switch to workspace 7", hl.dsp.focus({ workspace = "7" })) +o.bind("SUPER + KP_Up", "Switch to workspace 8", hl.dsp.focus({ workspace = "8" })) +o.bind("SUPER + KP_Prior", "Switch to workspace 9", hl.dsp.focus({ workspace = "9" })) + +-- find the numerically-next empty workspace and create it on the current monitor +o.bind("SUPER + grave", "Create a new workspace", function() + for i = 1, 100 do + local workspace = hl.get_workspace(i) + if not workspace then + hl.dispatch(hl.dsp.focus({ workspace = i })) + break + end + end +end) + +-- I don't fullscreen often, so it's fine if it's less reachable, and I want this for files +hl.unbind("SUPER + F") +o.bind("SUPER + F11", "Full screen", hl.dsp.window.fullscreen({ mode = "fullscreen" })) + +-- I don't really use window grouping either +hl.unbind("SUPER + G") +o.bind("SUPER + CTRL + G", "Toggle window grouping", hl.dsp.group.toggle()) + +-- I don't want ctrl + alt + delete to affect my special windows +hl.unbind("CTRL + ALT + DELETE") +o.bind("CTRL + ALT + DELETE", "Close all windows", function() + for _, window in pairs(hl.get_windows()) do + if not window.workspace.special then + hl.dispatch(hl.dsp.window.close({ window = "address:" .. window.address })) + end + end + hl.dispatch(hl.dsp.focus({ workspace = 2 })) +end) + +--- ********************** +--- APPLICATIONS +--- ********************** + +-- I don't use all the default apps, and I don't like the default super + shift prefix +-- so I unbind all default app keybinds (except terminal) +hl.unbind("SUPER + SHIFT + RETURN") -- Browser +hl.unbind("SUPER + SHIFT + F") -- File manager +hl.unbind("SUPER + ALT + SHIFT + F") -- File manager (cwd) +hl.unbind("SUPER + SHIFT + B") -- Browser +hl.unbind("SUPER + SHIFT + ALT + B") -- Browser (private) +hl.unbind("SUPER + SHIFT + N") -- Editor +hl.unbind("SUPER + ALT + RETURN") -- Tmux +hl.unbind("SUPER + CTRL + RETURN") -- Herdr +hl.unbind("SUPER + SHIFT + M") -- Music +hl.unbind("SUPER + SHIFT + ALT + M") -- Music TUI +hl.unbind("SUPER + SHIFT + D") -- Docker +hl.unbind("SUPER + SHIFT + G") -- Signal +hl.unbind("SUPER + SHIFT + O") -- Obsidian +hl.unbind("SUPER + SHIFT + W") -- Omawrite +hl.unbind("SUPER + SHIFT + SLASH") -- Passwords +hl.unbind("SUPER + SHIFT + A") -- ChatGPT +hl.unbind("SUPER + SHIFT + ALT + A") -- Grok +hl.unbind("SUPER + SHIFT + C") -- Calendar +hl.unbind("SUPER + SHIFT + E") -- Email +hl.unbind("SUPER + SHIFT + ALT + E") -- New email +hl.unbind("SUPER + SHIFT + Y") -- YouTube +hl.unbind("SUPER + SHIFT + ALT + G") -- WhatsApp +hl.unbind("SUPER + SHIFT + CTRL + G") -- Google Messages +hl.unbind("SUPER + SHIFT + P") -- Google Photos +hl.unbind("SUPER + SHIFT + S") -- Google Maps +hl.unbind("SUPER + SHIFT + X") -- X +hl.unbind("SUPER + SHIFT + ALT + X") -- X Post + +o.bind("SUPER + B", "Browser", { omarchy = "browser" }) +o.bind("SUPER + ALT + B", "Browser (private)", { omarchy = "browser --private" }) +o.bind("SUPER + F", "File manager", { omarchy = "nautilus" }) +o.bind("SUPER + N", "Notes", { launch = "heynote" }) +o.bind("SUPER + D", "Launch or focus DataGrip", { launch = "datagrip", focus = "^jetbrains-datagrip$" }) + +-- persistent background(-ish) apps +hl.unbind("SUPER + S") -- defaults to "scratchpad" +o.bind("SUPER + S", "Slack", hl.dsp.workspace.toggle_special("slack")) +o.bind("SUPER + period", "1Password Quick Access", "1password --quick-access") +hl.unbind("SUPER + CTRL + period") -- defaults to "transcode" +o.bind("CTRL + SUPER + period", "1Password", hl.dsp.workspace.toggle_special("1password")) +o.bind("SUPER + Z", "Show Creddy", "creddy shortcut show-window") + +-- I don't want to run most webapps as completely standalone windows, +-- but it is convenient to have hotkeys for some of them +o.bind("SUPER + A", "Claude", "omarchy-launch-browser https://claude.ai/new") +o.bind("SUPER + E", "Email", "omarchy-launch-browser https://mail.google.com/mail/u/0") +o.bind("SUPER + ALT + E", "Email (personal)", "omarchy-launch-browser https://mail.google.com/mail/u/1") +o.bind("SUPER + G", "GitLab", "omarchy-launch-browser https://gitlab.modg.net") + +-- I want to be able to summon a new browser tab from wherever I am +o.bind("SUPER + I", "New browser tab", function() + -- Omarchy tags any properly-integrated browser with one of these tags + local browser = hl.get_window("tag:(chromium|firefox)-based-browser.*") + + if browser then + local window = "address:" .. browser.address + hl.dispatch(hl.dsp.send_shortcut({ mods = "CTRL", key = "T", window = window })) + hl.dispatch(hl.dsp.focus({ window = window })) + else + hl.exec_cmd("omarchy-launch-browser") + end +end) +