-- defaults.lua — the stock Omarchy binds as they were live on the Arch install -- (vault shortcuts/keybinds.txt), re-expressed for NixOS + Caelestia with the -- same keys and descriptions. bindings.lua, lid.lua and caelestia.lua load -- after this file and unbind-then-rebind the keys they take over. -- -- Keys whose Omarchy service has no counterpart here (reminders, bar panels, -- Herdr, OCR, …) keep their place but run `omarchy-not-ported`, which names -- the gap in a notification instead of failing silently. Apps not in the -- toolbox closure (spotify, lazydocker, btop, tmux, …) are treated the same. local o = require("omarchy") local function launch(cmd) return "uwsm app -- " .. cmd end local function web(url) return launch("zen-beta --new-window " .. url) end local function gone(description, was) return string.format("omarchy-not-ported %q %q", description, was or "") end local function resize(x, y) return hl.dsp.window.resize({ x = x, y = y, relative = true }) end local sidebar = "caelestia shell drawers toggle sidebar" local locked = { locked = true } local held = { locked = true, repeating = true } local mouse = { mouse = true } -- ── Apps ───────────────────────────────────────────────────────────────────── o.bind("SUPER + RETURN", "Terminal", launch("kitty")) o.bind("SUPER + SHIFT + RETURN", "Browser", launch("zen-beta")) o.bind("SUPER + SHIFT + B", "Browser", launch("zen-beta")) o.bind("SUPER + SHIFT + ALT + B", "Browser (private)", launch("zen-beta --private-window")) o.bind("SUPER + SHIFT + F", "File manager", launch("nautilus --new-window")) o.bind("SUPER + SHIFT + ALT + F", "File manager (cwd)", launch("nautilus --new-window")) o.bind("SUPER + SHIFT + N", "Editor", launch("kitty -e ${EDITOR:-nano}")) o.bind("SUPER + SHIFT + O", "Obsidian", launch("obsidian")) -- bindings.lua rebinds (vault-open) o.bind("SUPER + SHIFT + ALT + M", "Music TUI", launch("kitty --class rmpc -e rmpc")) o.bind("SUPER + SHIFT + CTRL + A", "Agent", launch("kitty --class agent -e claude")) o.bind("CTRL + SUPER + Q", "Calculator", launch("kitty --class calculator -e qalc")) o.bind("XF86Calculator", "Calculator", launch("kitty --class calculator -e qalc")) o.bind("SUPER + SHIFT + M", "Music", gone("Music", "spotify")) o.bind("SUPER + SHIFT + D", "Docker", gone("Docker", "lazydocker")) o.bind("SUPER + SHIFT + G", "Signal", gone("Signal", "signal-desktop")) o.bind("SUPER + SHIFT + SLASH", "Passwords", gone("Passwords", "1password")) o.bind("SUPER + SHIFT + W", "Omawrite", gone("Omawrite", "Omarchy writing webapp")) o.bind("SUPER + SHIFT + E", "Email", gone("Email", "Omarchy mail webapp")) -- bindings.lua rebinds (Omamail) o.bind("SUPER + SHIFT + ALT + E", "New email", gone("New email", "Omarchy mail webapp")) o.bind("CTRL + SUPER + T", "Activity", gone("Activity", "btop")) o.bind("ALT + SUPER + RETURN", "Tmux", gone("Tmux", "tmux is not in the toolbox closure")) o.bind("CTRL + SUPER + RETURN", "Herdr", gone("Herdr")) o.bind("CTRL + SUPER + K", "Herdr keybindings", gone("Herdr keybindings")) -- ── Web apps (Zen windows) ─────────────────────────────────────────────────── o.bind("SUPER + SHIFT + A", "ChatGPT", web("https://chatgpt.com")) o.bind("SUPER + SHIFT + ALT + A", "Grok", web("https://grok.com")) o.bind("SUPER + SHIFT + C", "Calendar", web("https://calendar.google.com")) o.bind("SUPER + SHIFT + Y", "YouTube", web("https://youtube.com")) -- bindings.lua rebinds (bakx) o.bind("SUPER + SHIFT + ALT + G", "WhatsApp", web("https://web.whatsapp.com")) o.bind("SUPER + SHIFT + CTRL + G", "Google Messages", web("https://messages.google.com/web")) o.bind("SUPER + SHIFT + X", "X", web("https://x.com")) o.bind("SUPER + SHIFT + ALT + X", "X Post", web("https://x.com/compose/post")) o.bind("SUPER + SHIFT + P", "Google Photos", web("https://photos.google.com")) o.bind("SUPER + SHIFT + S", "Google Maps", web("https://maps.google.com")) -- ── Shell: menus, panels, notifications ────────────────────────────────────── o.bind("SUPER + SPACE", "Omarchy menu", hl.dsp.global("caelestia:launcher")) -- caelestia.lua rebinds o.bind("ALT + SUPER + SPACE", "Apps menu", hl.dsp.global("caelestia:launcher")) o.bind("SUPER + ESCAPE", "System menu", hl.dsp.global("caelestia:session")) -- caelestia.lua rebinds o.bind("CTRL + SUPER + P", "Power", hl.dsp.global("caelestia:session")) o.bind("XF86PowerOff", "Power menu", hl.dsp.global("caelestia:session"), locked) o.bind("SUPER + K", "Keybindings", "keybinds-menu") o.bind("SUPER + SHIFT + SPACE", "Toggle top bar", gone("Toggle top bar", "the Caelestia bar has no toggle")) o.bind("SUPER + SHIFT + CTRL + SPACE", "Theme menu", gone("Theme menu", "the theme is static Rosé Pine here")) o.bind("CTRL + SUPER + SPACE", "Background switcher", "wallpaper-picker") -- Caelestia launcher in wallpaper mode (home/modules/hyprland.nix) o.bind("CTRL + SUPER + O", "Toggle menu", gone("Toggle menu")) o.bind("CTRL + SUPER + D", "Display", gone("Display", "omarchy display menu")) o.bind("CTRL + SUPER + H", "Hardware menu", gone("Hardware menu")) o.bind("CTRL + SUPER + S", "Share", gone("Share")) o.bind("CTRL + SUPER + PERIOD", "Transcode", gone("Transcode")) o.bind("CTRL + SUPER + W", "Network", sidebar) -- caelestia.lua rebinds o.bind("CTRL + SUPER + B", "Bluetooth", sidebar) -- caelestia.lua rebinds o.bind("CTRL + SUPER + A", "Audio", sidebar) -- caelestia.lua rebinds o.bind("CTRL + SUPER + E", "Emojis", "caelestia emoji") o.bind("CTRL + SUPER + V", "Clipboard manager", "caelestia clipboard") o.bind("CTRL + SUPER + C", "Capture menu", "caelestia shell picker openFreeze") o.bind("CTRL + SUPER + N", "Toggle nightlight", "nightlight-toggle") o.bind("CTRL + SUPER + I", "Toggle locking on idle", "caelestia shell idleInhibitor toggle") o.bind("CTRL + SUPER + L", "Lock system", hl.dsp.global("caelestia:lock")) o.bind("CTRL + SUPER + R", "Set reminder", gone("Set reminder")) o.bind("CTRL + ALT + SUPER + R", "Show reminders", gone("Show reminders")) o.bind("SHIFT + CTRL + SUPER + R", "Clear reminders", gone("Clear reminders")) o.bind("CTRL + ALT + SUPER + B", "Show battery remaining", "nixdaemon-show battery") o.bind("CTRL + ALT + SUPER + T", "Show time", "nixdaemon-show time") o.bind("CTRL + ALT + SUPER + D", "Calendar", "nixdaemon-show calendar") o.bind("CTRL + ALT + SUPER + W", "Toggle weather", "caelestia shell drawers toggle dashboard") o.bind("SUPER + comma", "Dismiss last notification", hl.dsp.global("caelestia:clearNotifs")) -- caelestia.lua rebinds o.bind("SUPER + SHIFT + comma", "Dismiss all notifications", hl.dsp.global("caelestia:clearNotifs")) o.bind("CTRL + SUPER + comma", "Toggle silencing notifications", "caelestia shell notifs toggleDnd") -- caelestia.lua rebinds o.bind("ALT + SUPER + comma", "Invoke last notification", gone("Invoke last notification")) o.bind("SHIFT + ALT + SUPER + comma", "Open notification history", sidebar) for i = 1, 9 do o.bind("CTRL + SUPER + code:" .. (9 + i), "Bar panel " .. i, gone("Bar panel " .. i, "Omarchy bar panels")) end -- ── Capture ────────────────────────────────────────────────────────────────── o.bind("PRINT", "Screenshot region → editor", "screenshot region") o.bind("SHIFT + PRINT", "Screenshot screen → editor", "screenshot screen") o.bind("CTRL + PRINT", "Screenshot region → clipboard", "screenshot clipboard") o.bind("SHIFT + SUPER + PRINT", "Choose screenshot save folder", "screenshot folder") o.bind("ALT + PRINT", "Screenrecording", "caelestia record") o.bind("SUPER + PRINT", "Color picker", "hyprpicker -a") o.bind("CTRL + SUPER + PRINT", "Extract text (OCR) from screenshot", gone("Extract text (OCR) from screenshot", "tesseract")) -- ── Media and hardware keys ────────────────────────────────────────────────── o.bind("XF86AudioRaiseVolume", "Volume up", "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+", held) o.bind("XF86AudioLowerVolume", "Volume down", "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-", held) o.bind("ALT + XF86AudioRaiseVolume", "Volume up precise", "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 1%+", held) o.bind("ALT + XF86AudioLowerVolume", "Volume down precise", "wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-", held) o.bind("XF86AudioMute", "Mute", "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", locked) o.bind("XF86AudioMicMute", "Mute microphone", "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle", locked) o.bind("SHIFT + XF86AudioMute", "Switch audio output", "caelestia shell audio cycleOutput", locked) o.bind("XF86AudioPlay", "Play", hl.dsp.global("caelestia:mediaToggle"), locked) o.bind("XF86AudioPause", "Pause", hl.dsp.global("caelestia:mediaToggle"), locked) o.bind("XF86AudioNext", "Next track", hl.dsp.global("caelestia:mediaNext"), locked) o.bind("XF86AudioPrev", "Previous track", hl.dsp.global("caelestia:mediaPrev"), locked) o.bind("ALT + XF86AudioPlay", "Next track", hl.dsp.global("caelestia:mediaNext"), locked) o.bind("SHIFT + ALT + XF86AudioPlay", "Previous track", hl.dsp.global("caelestia:mediaPrev"), locked) o.bind("SHIFT + XF86AudioPlay", "Switch media source", gone("Switch media source", "playerctld shift"), locked) o.bind("SHIFT + XF86AudioPause", "Switch media source", gone("Switch media source", "playerctld shift"), locked) o.bind("XF86MonBrightnessUp", "Brightness up", "caelestia shell brightness set +5%", held) o.bind("XF86MonBrightnessDown", "Brightness down", "caelestia shell brightness set 5%-", held) o.bind("ALT + XF86MonBrightnessUp", "Brightness up precise", "caelestia shell brightness set +1%", held) o.bind("ALT + XF86MonBrightnessDown", "Brightness down precise", "caelestia shell brightness set 1%-", held) o.bind("SHIFT + XF86MonBrightnessUp", "Brightness maximum", "caelestia shell brightness set 100%", held) o.bind("SHIFT + XF86MonBrightnessDown", "Brightness minimum", "caelestia shell brightness set 1%", held) o.bind("XF86KbdBrightnessUp", "Keyboard brightness up", "brightnessctl -q -d '*kbd_backlight' set 1+", held) o.bind("XF86KbdBrightnessDown", "Keyboard brightness down", "brightnessctl -q -d '*kbd_backlight' set 1-", held) o.bind("XF86KbdLightOnOff", "Keyboard backlight cycle", "nixdaemon-show kbd-backlight-cycle", locked) o.bind("XF86Eject", "Eject media", gone("Eject media"), locked) o.bind("XF86TouchpadToggle", "Toggle touchpad", o.bin .. "/padx toggle --notify", locked) o.bind("XF86TouchpadOn", "Enable touchpad", o.bin .. "/padx on --notify", locked) o.bind("XF86TouchpadOff", "Disable touchpad", o.bin .. "/padx off --notify", locked) o.bind("switch:on:Lid Switch", "Laptop lid closed", o.bin .. "/lid-control close", locked) -- lid.lua rebinds o.bind("switch:off:Lid Switch", "Laptop lid opened", o.bin .. "/lid-control wake", locked) -- lid.lua rebinds -- ── Windows ────────────────────────────────────────────────────────────────── o.bind("SUPER + W", "Close window", hl.dsp.window.close()) o.bind("CTRL + ALT + DELETE", "Close all windows", function() for _, w in ipairs(hl.get_windows()) do hl.dispatch(hl.dsp.window.close({ window = w })) end end) o.bind("SUPER + F", "Full screen", hl.dsp.window.fullscreen({ mode = "fullscreen" })) o.bind("CTRL + SUPER + F", "Tiled full screen", hl.dsp.window.fullscreen_state({ internal = 0, client = 2 })) o.bind("ALT + SUPER + F", "Full width", hl.dsp.window.fullscreen({ mode = "maximized" })) o.bind("SUPER + T", "Toggle window floating/tiling", hl.dsp.window.float({ action = "toggle" })) o.bind("SUPER + O", "Pop window out (float & pin)", function() hl.dispatch(hl.dsp.window.float({ action = "enable" })) hl.dispatch(hl.dsp.window.pin({ action = "enable" })) end) o.bind("SUPER + P", "Pseudo window", hl.dsp.window.pseudo()) o.bind("SUPER + J", "Toggle window split", hl.dsp.layout("togglesplit")) o.bind("SUPER + BACKSPACE", "Toggle window transparency", hl.dsp.window.set_prop({ prop = "opaque", value = "toggle" })) o.bind("CTRL + SUPER + BACKSPACE", "Toggle single-window square aspect", gone("Toggle single-window square aspect")) local gaps_on = true o.bind("SUPER + SHIFT + BACKSPACE", "Toggle window gaps", function() gaps_on = not gaps_on if gaps_on then hl.config({ general = { gaps_in = 5, gaps_out = 20 } }) else hl.config({ general = { gaps_in = 0, gaps_out = 0 } }) end end) local layout = "dwindle" o.bind("SUPER + L", "Toggle workspace layout", function() layout = layout == "dwindle" and "master" or "dwindle" hl.config({ general = { layout = layout } }) end) -- Focus, swap, move o.bind("SUPER + LEFT", "Focus on left window", hl.dsp.focus({ direction = "left" })) o.bind("SUPER + RIGHT", "Focus on right window", hl.dsp.focus({ direction = "right" })) o.bind("SUPER + UP", "Focus on above window", hl.dsp.focus({ direction = "up" })) o.bind("SUPER + DOWN", "Focus on below window", hl.dsp.focus({ direction = "down" })) o.bind("SUPER + SHIFT + LEFT", "Swap window to the left", hl.dsp.window.swap({ direction = "left" })) -- bindings.lua rebinds o.bind("SUPER + SHIFT + RIGHT", "Swap window to the right", hl.dsp.window.swap({ direction = "right" })) o.bind("SUPER + SHIFT + UP", "Swap window up", hl.dsp.window.swap({ direction = "up" })) o.bind("SUPER + SHIFT + DOWN", "Swap window down", hl.dsp.window.swap({ direction = "down" })) o.bind("ALT + TAB", "Focus on next window", hl.dsp.window.cycle_next()) o.bind("ALT + TAB", "Reveal active window on top", hl.dsp.window.bring_to_top()) o.bind("SHIFT + ALT + TAB", "Focus on previous window", hl.dsp.window.cycle_next({ next = false })) o.bind("SHIFT + ALT + TAB", "Reveal active window on top", hl.dsp.window.bring_to_top()) -- Resize (keycodes 20/21 = the -/= keys, layout independent, as Omarchy) o.bind("SUPER + code:20", "Expand window left", resize(-100, 0)) o.bind("SUPER + code:21", "Shrink window left", resize(100, 0)) o.bind("SUPER + SHIFT + code:20", "Shrink window up", resize(0, -100)) o.bind("SUPER + SHIFT + code:21", "Expand window down", resize(0, 100)) o.bind("ALT + SUPER + code:20", "Expand window left a little", resize(-50, 0)) o.bind("ALT + SUPER + code:21", "Shrink window left a little", resize(50, 0)) o.bind("SHIFT + ALT + SUPER + code:20", "Shrink window up a little", resize(0, -50)) o.bind("SHIFT + ALT + SUPER + code:21", "Expand window down a little", resize(0, 50)) o.bind("CTRL + SUPER + code:20", "Expand window left a lot", resize(-200, 0)) o.bind("CTRL + SUPER + code:21", "Shrink window left a lot", resize(200, 0)) o.bind("SHIFT + CTRL + SUPER + code:20", "Shrink window up a lot", resize(0, -200)) o.bind("SHIFT + CTRL + SUPER + code:21", "Expand window down a lot", resize(0, 200)) o.bind("SUPER + Home", "Restore window width", gone("Restore window width", "omarchy window width memory")) o.bind("ALT + SUPER + Home", "Save window width", gone("Save window width", "omarchy window width memory")) -- "Make webcam overlay smaller/larger" (ALT+SUPER, keycodes unknown): not carried; Omarchy webcam overlay. -- Mouse o.bind("SUPER + mouse:272", "Move window", hl.dsp.window.drag(), mouse) o.bind("SUPER + mouse:273", "Resize window", hl.dsp.window.resize(), mouse) o.bind("SUPER + mouse_down", "Scroll active workspace forward", hl.dsp.focus({ workspace = "e+1" })) o.bind("SUPER + mouse_up", "Scroll active workspace backward", hl.dsp.focus({ workspace = "e-1" })) -- Universal clipboard: terminals get CTRL+SHIFT, everything else CTRL local terminal_class = "^(kitty|dropterm|Alacritty|foot|org%.codeberg%.dnkl%.foot|com%.mitchellh%.ghostty)$" local function universal(key) return function() local w = hl.get_active_window() local mods = (w and (w.class or ""):match(terminal_class)) and "CTRL SHIFT" or "CTRL" hl.dispatch(hl.dsp.send_shortcut({ mods = mods, key = key })) end end o.bind("SUPER + C", "Universal copy", universal("C")) o.bind("SUPER + V", "Universal paste", universal("V")) o.bind("SUPER + X", "Universal cut", universal("X")) -- ── Workspaces ─────────────────────────────────────────────────────────────── for i = 1, 10 do local code = "code:" .. (9 + i) -- keycodes 10..19 = keys 1..9,0 (layout independent, as Omarchy) o.bind("SUPER + " .. code, "Switch to workspace " .. i, hl.dsp.focus({ workspace = i })) o.bind("SUPER + SHIFT + " .. code, "Move window to workspace " .. i, hl.dsp.window.move({ workspace = i })) o.bind("SUPER + SHIFT + ALT + " .. code, "Move window silently to workspace " .. i, hl.dsp.window.move({ workspace = i, follow = false })) end o.bind("SUPER + TAB", "Next workspace", hl.dsp.focus({ workspace = "e+1" })) o.bind("SUPER + SHIFT + TAB", "Previous workspace", hl.dsp.focus({ workspace = "e-1" })) o.bind("CTRL + SUPER + TAB", "Former workspace", hl.dsp.focus({ workspace = "previous" })) o.bind("SUPER + S", "Toggle scratchpad", hl.dsp.workspace.toggle_special("scratchpad")) o.bind("ALT + SUPER + S", "Move window to scratchpad", hl.dsp.window.move({ workspace = "special:scratchpad" })) o.bind("CTRL + ALT + TAB", "Focus on next monitor", hl.dsp.focus({ monitor = "+1" })) o.bind("SHIFT + CTRL + ALT + TAB", "Focus on previous monitor", hl.dsp.focus({ monitor = "-1" })) o.bind("SHIFT + ALT + SUPER + LEFT", "Move workspace to left monitor", hl.dsp.workspace.move({ monitor = "l" })) o.bind("SHIFT + ALT + SUPER + RIGHT", "Move workspace to right monitor", hl.dsp.workspace.move({ monitor = "r" })) o.bind("SHIFT + ALT + SUPER + UP", "Move workspace to up monitor", hl.dsp.workspace.move({ monitor = "u" })) o.bind("SHIFT + ALT + SUPER + DOWN", "Move workspace to down monitor", hl.dsp.workspace.move({ monitor = "d" })) -- ── Groups ─────────────────────────────────────────────────────────────────── o.bind("SUPER + G", "Toggle window grouping", hl.dsp.group.toggle()) o.bind("ALT + SUPER + G", "Move active window out of group", hl.dsp.window.move({ out_of_group = true })) o.bind("ALT + SUPER + TAB", "Next window in group", hl.dsp.group.next()) o.bind("SHIFT + ALT + SUPER + TAB", "Previous window in group", hl.dsp.group.prev()) o.bind("ALT + SUPER + mouse_down", "Next window in group", hl.dsp.group.next()) o.bind("ALT + SUPER + mouse_up", "Previous window in group", hl.dsp.group.prev()) for i = 1, 5 do o.bind("ALT + SUPER + code:" .. (9 + i), "Switch to group window " .. i, hl.dsp.group.active({ index = i })) end o.bind("CTRL + SUPER + LEFT", "Move grouped window focus left", hl.dsp.group.move_window({ forward = false })) o.bind("CTRL + SUPER + RIGHT", "Move grouped window focus right", hl.dsp.group.move_window({ forward = true })) o.bind("ALT + SUPER + LEFT", "Move window to group on left", hl.dsp.window.move({ direction = "left", group_aware = true })) o.bind("ALT + SUPER + RIGHT", "Move window to group on right", hl.dsp.window.move({ direction = "right", group_aware = true })) o.bind("ALT + SUPER + UP", "Move window to group on top", hl.dsp.window.move({ direction = "up", group_aware = true })) o.bind("ALT + SUPER + DOWN", "Move window to group on bottom", hl.dsp.window.move({ direction = "down", group_aware = true })) -- ── Monitor scale and zoom ─────────────────────────────────────────────────── local function rescale(delta) return function() local m = hl.get_active_monitor() if not m then return end local s = math.max(1, (m.scale or 1) + delta) if m.name == "eDP-1" then hl.monitor({ output = "eDP-1", mode = "2560x1440@240", position = "0x0", scale = s }) else hl.monitor({ output = m.name, mode = "preferred", position = "auto", scale = s }) end end end o.bind("SUPER + SLASH", "Monitor scaling up", rescale(0.25)) o.bind("ALT + SUPER + SLASH", "Monitor scaling down", rescale(-0.25)) local zoom = 1.0 o.bind("CTRL + SUPER + Z", "Zoom in", function() zoom = zoom + 0.5 hl.config({ cursor = { zoom_factor = zoom } }) end) o.bind("CTRL + ALT + SUPER + Z", "Reset zoom", function() zoom = 1.0 hl.config({ cursor = { zoom_factor = 1.0 } }) end) -- Laptop display toggles were Omarchy monitor scripts; display recovery is lid.lua's SUPER+CTRL+F12. o.bind("CTRL + SUPER + Delete", "Toggle laptop display", gone("Toggle laptop display", "omarchy monitor script")) o.bind("CTRL + ALT + SUPER + Delete", "Toggle laptop display mirroring", gone("Toggle laptop display mirroring", "omarchy monitor script"))