Files

166 lines
7.5 KiB
Lua

-- 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 <direction>"
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)