diff --git a/bin/omarchy-launch-nautilus b/bin/omarchy-launch-nautilus new file mode 100755 index 00000000..0b10b7b2 --- /dev/null +++ b/bin/omarchy-launch-nautilus @@ -0,0 +1,5 @@ +#!/bin/bash + +# omarchy:summary=Launch Files + +exec setsid uwsm-app -- nautilus --new-window diff --git a/config/hypr/bindings.lua b/config/hypr/bindings.lua index 19b8e948..f75dc22b 100644 --- a/config/hypr/bindings.lua +++ b/config/hypr/bindings.lua @@ -1,31 +1,31 @@ -- Application bindings. -o.bind("SUPER + RETURN", "Terminal", "omarchy-launch-terminal") -o.bind("SUPER + ALT + RETURN", "Tmux", "omarchy-launch-terminal-tmux") -o.bind("SUPER + SHIFT + RETURN", "Browser", "omarchy-launch-browser") -o.bind_launch("SUPER + SHIFT + F", "File manager", "nautilus --new-window") -o.bind("SUPER + ALT + SHIFT + F", "File manager (cwd)", "omarchy-launch-nautilus-cwd") -o.bind("SUPER + SHIFT + B", "Browser", "omarchy-launch-browser") -o.bind("SUPER + SHIFT + ALT + B", "Browser (private)", "omarchy-launch-browser --private") -o.bind("SUPER + SHIFT + M", "Music", "omarchy-launch-or-focus spotify") -o.bind("SUPER + SHIFT + ALT + M", "Music TUI", "omarchy-launch-or-focus-tui cliamp") -o.bind("SUPER + SHIFT + N", "Editor", "omarchy-launch-editor") -o.bind("SUPER + SHIFT + D", "Docker", "omarchy-launch-tui lazydocker") -o.bind_sole("SUPER + SHIFT + G", "Signal", "^signal$", "signal-desktop") -o.bind_sole("SUPER + SHIFT + O", "Obsidian", "^obsidian$", "obsidian") -o.bind_launch("SUPER + SHIFT + W", "Typora", "typora --enable-wayland-ime") -o.bind_launch("SUPER + SHIFT + SLASH", "Passwords", "1password") +o.bind("SUPER + RETURN", "Terminal", { omarchy = "terminal" }) +o.bind("SUPER + ALT + RETURN", "Tmux", { omarchy = "terminal-tmux" }) +o.bind("SUPER + SHIFT + RETURN", "Browser", { omarchy = "browser" }) +o.bind("SUPER + SHIFT + F", "File manager", { omarchy = "nautilus" }) +o.bind("SUPER + ALT + SHIFT + F", "File manager (cwd)", { omarchy = "nautilus-cwd" }) +o.bind("SUPER + SHIFT + B", "Browser", { omarchy = "browser" }) +o.bind("SUPER + SHIFT + ALT + B", "Browser (private)", { omarchy = "browser --private" }) +o.bind("SUPER + SHIFT + M", "Music", { omarchy = "or-focus spotify" }) +o.bind("SUPER + SHIFT + ALT + M", "Music TUI", { tui = "cliamp", focus = true }) +o.bind("SUPER + SHIFT + N", "Editor", { omarchy = "editor" }) +o.bind("SUPER + SHIFT + D", "Docker", { tui = "lazydocker" }) +o.bind("SUPER + SHIFT + G", "Signal", { launch = "signal-desktop", focus = "^signal$" }) +o.bind("SUPER + SHIFT + O", "Obsidian", { launch = "obsidian", focus = "^obsidian$" }) +o.bind("SUPER + SHIFT + W", "Typora", { launch = "typora --enable-wayland-ime" }) +o.bind("SUPER + SHIFT + SLASH", "Passwords", { launch = "1password" }) -- Web app bindings. -o.bind_webapp("SUPER + SHIFT + A", "ChatGPT", "https://chatgpt.com") -o.bind_webapp("SUPER + SHIFT + ALT + A", "Grok", "https://grok.com") -o.bind_webapp("SUPER + SHIFT + C", "Calendar", "https://app.hey.com/calendar/weeks/") -o.bind_webapp("SUPER + SHIFT + E", "Email", "https://app.hey.com") -o.bind_webapp("SUPER + SHIFT + Y", "YouTube", "https://youtube.com/") -o.bind_webapp_sole("SUPER + SHIFT + ALT + G", "WhatsApp", "https://web.whatsapp.com/") -o.bind_webapp_sole("SUPER + SHIFT + CTRL + G", "Google Messages", "https://messages.google.com/web/conversations") -o.bind_webapp_sole("SUPER + SHIFT + P", "Google Photos", "https://photos.google.com/") -o.bind_webapp("SUPER + SHIFT + X", "X", "https://x.com/") -o.bind_webapp("SUPER + SHIFT + ALT + X", "X Post", "https://x.com/compose/post") +o.bind("SUPER + SHIFT + A", "ChatGPT", { webapp = "https://chatgpt.com" }) +o.bind("SUPER + SHIFT + ALT + A", "Grok", { webapp = "https://grok.com" }) +o.bind("SUPER + SHIFT + C", "Calendar", { webapp = "https://app.hey.com/calendar/weeks/" }) +o.bind("SUPER + SHIFT + E", "Email", { webapp = "https://app.hey.com" }) +o.bind("SUPER + SHIFT + Y", "YouTube", { webapp = "https://youtube.com/" }) +o.bind("SUPER + SHIFT + ALT + G", "WhatsApp", { webapp = "https://web.whatsapp.com/", focus = true }) +o.bind("SUPER + SHIFT + CTRL + G", "Google Messages", { webapp = "https://messages.google.com/web/conversations", focus = true }) +o.bind("SUPER + SHIFT + P", "Google Photos", { webapp = "https://photos.google.com/", focus = true }) +o.bind("SUPER + SHIFT + X", "X", { webapp = "https://x.com/" }) +o.bind("SUPER + SHIFT + ALT + X", "X Post", { webapp = "https://x.com/compose/post" }) -- Add extra bindings below. -- o.bind("SUPER + SHIFT + R", "SSH", "alacritty -e ssh your-server") @@ -37,4 +37,4 @@ o.bind_webapp("SUPER + SHIFT + ALT + X", "X Post", "https://x.com/compose/post") -- 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-launch-walker -m symbols") +-- o.bind("SUPER + PERIOD", nil, { omarchy = "walker -m symbols" }) diff --git a/default/hypr/bindings/clipboard.lua b/default/hypr/bindings/clipboard.lua index 5edde4cd..415b71f6 100644 --- a/default/hypr/bindings/clipboard.lua +++ b/default/hypr/bindings/clipboard.lua @@ -13,4 +13,4 @@ end o.bind("SUPER + C", "Universal copy", send_shortcut_once("CTRL", "Insert")) o.bind("SUPER + V", "Universal paste", send_shortcut_once("SHIFT", "Insert")) o.bind("SUPER + X", "Universal cut", send_shortcut_once("CTRL", "X")) -o.bind("SUPER + CTRL + V", "Clipboard manager", "omarchy-launch-walker -m clipboard") +o.bind("SUPER + CTRL + V", "Clipboard manager", { omarchy = "walker -m clipboard" }) diff --git a/default/hypr/bindings/utilities.lua b/default/hypr/bindings/utilities.lua index a4af2286..472dd06b 100644 --- a/default/hypr/bindings/utilities.lua +++ b/default/hypr/bindings/utilities.lua @@ -1,5 +1,5 @@ -o.bind("SUPER + SPACE", "Launch apps", "omarchy-launch-walker") -o.bind("SUPER + CTRL + E", "Emoji picker", "omarchy-launch-walker -m symbols") +o.bind("SUPER + SPACE", "Launch apps", { omarchy = "walker" }) +o.bind("SUPER + CTRL + E", "Emoji picker", { omarchy = "walker -m symbols" }) o.bind_menu("SUPER + CTRL + C", "Capture menu", "capture") o.bind_menu("SUPER + CTRL + O", "Toggle menu", "toggle") o.bind_menu("SUPER + CTRL + H", "Hardware menu", "hardware") @@ -52,10 +52,10 @@ 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") -o.bind("SUPER + CTRL + A", "Audio controls", "omarchy-launch-audio") -o.bind("SUPER + CTRL + B", "Bluetooth controls", "omarchy-launch-bluetooth") -o.bind("SUPER + CTRL + W", "Wifi controls", "omarchy-launch-wifi") -o.bind("SUPER + CTRL + T", "Activity", "omarchy-launch-tui btop") +o.bind("SUPER + CTRL + A", "Audio controls", { omarchy = "audio" }) +o.bind("SUPER + CTRL + B", "Bluetooth controls", { omarchy = "bluetooth" }) +o.bind("SUPER + CTRL + W", "Wifi controls", { omarchy = "wifi" }) +o.bind("SUPER + CTRL + T", "Activity", { tui = "btop" }) o.bind("SUPER + CTRL + X", "Toggle dictation", "voxtype record toggle") o.bind("F9", "Start dictation (push-to-talk)", "voxtype record start") diff --git a/default/hypr/helpers.lua b/default/hypr/helpers.lua index dd67ed90..ee78252e 100644 --- a/default/hypr/helpers.lua +++ b/default/hypr/helpers.lua @@ -6,6 +6,34 @@ local function shell_quote(value) return "'" .. tostring(value):gsub("'", "'\\''") .. "'" end +local function command_from(value, description) + if type(value) ~= "table" then + return value + end + + if value.omarchy then + return "omarchy-launch-" .. value.omarchy + elseif value.focus and value.launch then + return o.launch_sole(value.focus, value.launch) + elseif value.launch then + return o.launch(value.launch) + elseif value.webapp then + if value.focus then + return o.launch_webapp_sole(description, value.webapp) + else + return o.launch_webapp(value.webapp) + end + elseif value.tui then + if value.focus then + return "omarchy-launch-or-focus-tui " .. shell_quote(value.tui) + else + return "omarchy-launch-tui " .. shell_quote(value.tui) + end + end + + return value +end + function o.bind(keys, description, dispatcher, options) local opts = options or {} @@ -13,6 +41,8 @@ function o.bind(keys, description, dispatcher, options) opts.description = description end + dispatcher = command_from(dispatcher, description) + if type(dispatcher) == "string" then dispatcher = hl.dsp.exec_cmd(dispatcher) end @@ -34,10 +64,6 @@ function o.launch_on_start(command) o.exec_on_start(o.launch(command)) end -function o.bind_launch(keys, description, command, options) - o.bind(keys, description, o.launch(command), options) -end - function o.launch_webapp(url) return "omarchy-launch-webapp " .. shell_quote(url) end @@ -46,22 +72,10 @@ function o.launch_webapp_sole(name, url) return "omarchy-launch-or-focus-webapp " .. shell_quote(name) .. " " .. shell_quote(url) end -function o.bind_webapp(keys, description, url, options) - o.bind(keys, description, o.launch_webapp(url), options) -end - function o.launch_sole(match, command) return "omarchy-launch-or-focus " .. shell_quote(match) .. " " .. shell_quote(o.launch(command)) end -function o.bind_sole(keys, description, match, command, options) - o.bind(keys, description, o.launch_sole(match, command), options) -end - -function o.bind_webapp_sole(keys, description, url, options) - o.bind(keys, description, o.launch_webapp_sole(description, url), options) -end - function o.bind_menu(keys, description, menu, options) o.bind(keys, description, menu and ("omarchy-menu " .. menu) or "omarchy-menu", options) end diff --git a/default/hypr/plain-bindings.lua b/default/hypr/plain-bindings.lua index 1185f643..5f132a84 100644 --- a/default/hypr/plain-bindings.lua +++ b/default/hypr/plain-bindings.lua @@ -4,10 +4,10 @@ require("default.hypr.bindings.tiling-v2") require("default.hypr.bindings.utilities") -- Application bindings without Omarchy's preinstalled web apps, TUIs, or desktop apps. -o.bind("SUPER + RETURN", "Terminal", "omarchy-launch-terminal") -o.bind("SUPER + SHIFT + RETURN", "Browser", "omarchy-launch-browser") -o.bind_launch("SUPER + SHIFT + F", "File manager", "nautilus --new-window") -o.bind("SUPER + ALT + SHIFT + F", "File manager (cwd)", "omarchy-launch-nautilus-cwd") -o.bind("SUPER + SHIFT + B", "Browser", "omarchy-launch-browser") -o.bind("SUPER + SHIFT + ALT + B", "Browser (private)", "omarchy-launch-browser --private") -o.bind("SUPER + SHIFT + N", "Editor", "omarchy-launch-editor") +o.bind("SUPER + RETURN", "Terminal", { omarchy = "terminal" }) +o.bind("SUPER + SHIFT + RETURN", "Browser", { omarchy = "browser" }) +o.bind("SUPER + SHIFT + F", "File manager", { omarchy = "nautilus" }) +o.bind("SUPER + ALT + SHIFT + F", "File manager (cwd)", { omarchy = "nautilus-cwd" }) +o.bind("SUPER + SHIFT + B", "Browser", { omarchy = "browser" }) +o.bind("SUPER + SHIFT + ALT + B", "Browser (private)", { omarchy = "browser --private" }) +o.bind("SUPER + SHIFT + N", "Editor", { omarchy = "editor" })