From e73d3acc3957b59a0d363e08c07ea9ccb7e2382a Mon Sep 17 00:00:00 2001 From: Steve Beaulac Date: Fri, 9 Oct 2026 00:51:49 -0400 Subject: [PATCH] Add Omarchy Hyprland bindings --- config/mise/config.toml | 5 +- config/pi/agent/settings.json | 113 ++++---- desktop/config/hypr/sjb/applications.lua | 51 ++++ desktop/config/hypr/sjb/bindings.lua | 245 ++++++++++++++++ desktop/config/hypr/sjb/extra.lua | 45 ++- desktop/config/hypr/sjb/functions.lua | 25 +- desktop/config/hypr/sjb/init.lua | 354 +---------------------- desktop/config/hypr/sjb/monitors.lua | 9 + desktop/config/hypr/sjb/omarchy.lua | 107 +++++++ desktop/config/hypr/sjb/utilities.lua | 112 +++++++ desktop/config/ostt/ostt.toml | 4 +- desktop/mise.toml | 10 +- desktop/script/hyprland-keybindings | 19 +- 13 files changed, 680 insertions(+), 419 deletions(-) create mode 100644 desktop/config/hypr/sjb/applications.lua create mode 100644 desktop/config/hypr/sjb/bindings.lua create mode 100644 desktop/config/hypr/sjb/omarchy.lua create mode 100644 desktop/config/hypr/sjb/utilities.lua diff --git a/config/mise/config.toml b/config/mise/config.toml index 7dc5f6c..9563f7c 100644 --- a/config/mise/config.toml +++ b/config/mise/config.toml @@ -35,6 +35,7 @@ worktrunk = "latest" } uv = "latest" tmux = "latest" +node = "latest" # url = 'https://releases.hashicorp.com/sentinel/{{version}}/sentinel_{{version}}_{{os(macos="darwin")}}_{{arch(x64="amd64")}}.zip' [tasks.setup_pi] @@ -72,7 +73,7 @@ run = [ "test -L ~/.agents/skills || ln -snf ~/.local/share/skills/skills ~/.agents/skills" ] -[tasks.herdr_setup] +[tasks.setup_herdr] run = [ 'herdr plugin install devashish2203/herdr-worktrunk --yes', 'herdr plugin install qu8n/herdr-automatic-rename --yes', @@ -81,7 +82,7 @@ run = [ 'herdr plugin install qu8n/herdr-automatic-rename --yes', ] -[tasks.tmux_setup] +[tasks.setup_tmux] run = [ 'test -d ~/.config/tmux/plugins/tpm || git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm', 'tmux run-shell ~/.config/tmux/plugins/tpm/bindings/install_plugins', diff --git a/config/pi/agent/settings.json b/config/pi/agent/settings.json index 8817097..633b461 100644 --- a/config/pi/agent/settings.json +++ b/config/pi/agent/settings.json @@ -1,57 +1,60 @@ { - "lastChangelogVersion": "0.99.2", - "theme": "light/dark", - "defaultProvider": "opencode-go", - "defaultModel": "mistral-large-4", - "defaultThinkingLevel": "high", - "hideThinkingBlock": true, - "compaction": { - "enabled": true - }, - "thinkingLevelMap": { - "minimal": null, - "low": "low", - "medium": "medium", - "high": "high", - "xhigh": null, - "max": "max" - }, - "enableInstallTelemetry": false, - "packages": [ - "npm:pi-lens", - "npm:@gotgenes/pi-permission-system", - "npm:pi-native-search", - "npm:context-mode", - "npm:pi-subagents", - "npm:@ff-labs/pi-fff", - "npm:@narumitw/pi-plan-mode", - "npm:@dietrichgebert/ponytail" - ], - "subagents": { - "agentOverrides": { - "reviewer": { - "model": "openai-codex/gpt-6-luna", - "thinking": "high" - }, - "planner": { - "model": "obelix/ornith-1.5-35B", - "thinking": "high" - }, - "worker": { - "model": "opencode-go/claude-haiku-5-5" - }, - "oracle": { - "model": "openai-codex/gpt-6.1-sol", - "thinking": "high" - } - } - }, - "defaultTools": [ - "+codemode" - ], - "quietStartup": true, - "steeringMode": "all", - "terminal": { - "showTerminalProgress": true + "lastChangelogVersion": "1.0.4", + "theme": "light/dark", + "defaultProvider": "opencode-go", + "defaultModel": "mistral-large-4", + "defaultThinkingLevel": "high", + "hideThinkingBlock": true, + "compaction": { + "enabled": true + }, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max" + }, + "enableInstallTelemetry": false, + "packages": [ + "npm:pi-lens", + "npm:@gotgenes/pi-permission-system", + "npm:pi-native-search", + "npm:context-mode", + "npm:pi-subagents", + "npm:@ff-labs/pi-fff", + "npm:@narumitw/pi-plan-mode", + "npm:@dietrichgebert/ponytail", + "npm:@plannotator/pi-extension", + "npm:pi-hermes-memory", + "npm:pi-msg-queue" + ], + "subagents": { + "agentOverrides": { + "reviewer": { + "model": "openai-codex/gpt-6-luna", + "thinking": "high" + }, + "planner": { + "model": "obelix/ornith-1.5-35B", + "thinking": "high" + }, + "worker": { + "model": "opencode-go/claude-haiku-5-5" + }, + "oracle": { + "model": "openai-codex/gpt-6.1-sol", + "thinking": "high" + } } -} + }, + "defaultTools": [ + "+codemode" + ], + "quietStartup": true, + "steeringMode": "all", + "terminal": { + "showTerminalProgress": true + } +} \ No newline at end of file diff --git a/desktop/config/hypr/sjb/applications.lua b/desktop/config/hypr/sjb/applications.lua new file mode 100644 index 0000000..8eb54f8 --- /dev/null +++ b/desktop/config/hypr/sjb/applications.lua @@ -0,0 +1,51 @@ +hl.bind(sjb.HYPR .. "Z", hl.dsp.submap("passthru"), { description = "Passthru Menu" }) +hl.define_submap("passthru", function() + hl.bind(sjb.HYPR .. "Z", hl.dsp.submap("reset"), { description = "Passthru: Exit" }) +end) + +hl.bind(sjb.HYPR .. "A", hl.dsp.exec_cmd("gtk-launch pi.desktop"), { description = "Open pi tui" }) + +hl.bind(sjb.HYPR .. "O", dispatch_focus_or_launch({ + match = "chrome-outlook.office.com", + cmd = "gtk-launch Outlook.desktop", +}), { description = "Email" }) + +hl.bind(sjb.HYPR .. "T", dispatch_focus_or_launch({ + match = "chrome-teams.microsoft.com", + cmd = "gtk-launch Team.desktop", +}), { description = "UWO Team" }) + +hl.bind(sjb.HYPR .. "Y", dispatch_focus_or_launch({ + match = "chrome-youtube.com", + cmd = "gtk-launch YouTube.desktop", +}), { description = "YouTube" }) + +hl.bind(sjb.HYPR .. "W", dispatch_focus_or_launch({ + match = "chrome-web.whatsapp.com", + cmd = "gtk-launch WhatsApp.desktop", +}), { description = "WhatsApp" }) + +hl.bind(sjb.HYPR .. "G", dispatch_focus_or_launch({ + match = "chrome-chatgpt.com", + cmd = "gtk-launch ChatGPT.desktop", +}), { description = "ChatGPT" }) + +hl.bind(sjb.HYPR .. "D", dispatch_focus_or_launch({ + match = "chrome-discord.com", + cmd = "gtk-launch Discord.desktop" +}), { description = "Discord" }) + +hl.bind(sjb.HYPR .. "M", dispatch_focus_or_launch({ + match = "chrome-messages.google.com", + cmd = "gtk-launch \"Google Messages.desktop\"", +}), { description = "Google Messages" }) + +hl.bind(sjb.HYPR .. "X", dispatch_focus_or_launch({ + match = "X", + cmd = "gtk-launch X.desktop", +}), { description = "X" }) + +hl.bind(sjb.HYPR .. "S", dispatch_focus_or_launch({ + match = "Spotify", + cmd = "gtk-launch spotify.desktop" +}), { description = "Music" }) diff --git a/desktop/config/hypr/sjb/bindings.lua b/desktop/config/hypr/sjb/bindings.lua new file mode 100644 index 0000000..bd87f83 --- /dev/null +++ b/desktop/config/hypr/sjb/bindings.lua @@ -0,0 +1,245 @@ +local terminal = "footclient" +local browser = "gtk-launch chromium.desktop" + +-- Keybindings + +hl.bind("SUPER + SHIFT + RETURN", hl.dsp.exec_raw(browser), { description = "Open browser" }) +hl.bind("SUPER + SHIFT + B", hl.dsp.exec_raw(browser), { description = "Open browser" }) +hl.bind("SUPER + RETURN", hl.dsp.exec_cmd("footclient -a terminal -T terminal"), + { description = "Open terminal" }) +hl.bind("SUPER + SHIFT + F", dispatch_focus_or_launch({ + match = "strata", + cmd = "gtk-launch io.github.lgse.Strata.desktop", +}), { description = "File Manager" }) + +hl.bind("SUPER + CTRL + RETURN", hl.dsp.exec_cmd("gtk-launch herdr.desktop"), + { description = "Open herdr terminal" }) +hl.bind("SUPER + ALT + RETURN", hl.dsp.exec_cmd("gtk-launch tmux.desktop"), + { description = "Open tmux terminal" }) + +hl.bind("SUPER + SHIFT + N", hl.dsp.exec_cmd("terminal-launcher quicknotes \"nvim +'Obsidian today'\""), + { description = "Open Obsidian today in a centered floating window" }) + +hl.bind("SUPER + SHIFT + A", hl.dsp.exec_cmd("terminal-launcher agenda \"nvim +'Org agenda t'\""), + { description = "Open Org agenda in a centered floating window" }) +hl.bind("SUPER + CONTROL + A", hl.dsp.exec_cmd("terminal-launcher capture \"nvim +'Org capture t'\""), + { description = "Open Org capture in a centered floating window" }) + +hl.bind("SUPER + SHIFT + I", sysinfo, { description = "Show system info" }) + +hl.bind("SUPER + SHIFT + Q", hl.dsp.exec_raw("ostt launch --paste"), { description = "Open ostt" }) +hl.bind("F9", hl.dsp.exec_raw("ostt launch --paste"), { description = "Open ostt" }) + +hl.bind("SUPER + Y", toggle_master_scrolling, + { description = "Layout: Toggle master/scrolling" }) +hl.bind("SUPER + W", hl.dsp.window.close(), { description = "Window: Close" }) + +hl.bind("SUPER + F", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" }), + { description = "Window: Toggle fullscreen" }) +hl.bind("SUPER + CONTROL + F", hl.dsp.window.fullscreen_state({ internal = 2, client = 0, action = "toggle" }), + { description = "Window: Toggle Tiled fullscreen" }) +hl.bind("SUPER + ALT + F", hl.dsp.window.fullscreen_state({ internal = 0, client = 2, action = "toggle" }), + { description = "Window: Toggle full width" }) + +hl.bind("SUPER + T", toggle_float_with_limit, + { description = "Window: Toggle floating/tiling (max 80%)" }) + +hl.bind("SUPER + P", toggle_pin, { description = "Window: Toggle Pin" }) + +hl.bind("SUPER + left", hl.dsp.focus({ direction = "l" }), { description = "Window: Focus left" }) +hl.bind("SUPER + right", hl.dsp.focus({ direction = "r" }), { description = "Window: Focus right" }) +hl.bind("SUPER + up", hl.dsp.focus({ direction = "u" }), { description = "Window: Focus up" }) +hl.bind("SUPER + down", hl.dsp.focus({ direction = "d" }), { description = "Window: Focus down" }) + +hl.bind("SUPER + H", hl.dsp.focus({ direction = "l" }), { description = "Window: Focus left" }) +hl.bind("SUPER + L", hl.dsp.focus({ direction = "r" }), { description = "Window: Focus right" }) +hl.bind("SUPER + K", hl.dsp.focus({ direction = "u" }), { description = "Window: Focus up" }) +hl.bind("SUPER + J", hl.dsp.focus({ direction = "d" }), { description = "Window: Focus down" }) -- hl.bind("SUPER + H", hl.dsp.window.resize("left"), { repeating = true, description = "Window: Resize left" }) + +-- hl.bind("SUPER + z", hl.dsp.focus({ last = true }), { description = "Window: Focus last" }) +hl.bind("SUPER + Z", hl.dsp.focus({ urgent_or_last = true }), { description = "Window: Focus last" }) + +hl.bind("SUPER + ALT + period", hl.dsp.layout("cycleprev"), { description = "Window: Swap with next" }) +hl.bind("SUPER + ALT + comma", hl.dsp.layout("cyclenext"), { description = "Window: Swap with prev" }) + +-- hl.bind("SUPER + ALT + comma", hl.dsp.workspace.move({ monitor = "-1" }), +-- { description = "Window: Move to previous workspace and follow" }) + +-- hl.bind("SUPER + ALT + period", hl.dsp.workspace.move({ monitor = "+1" }), +-- { description = "Window: Move to next workspace and follow" }) + +-- FIX: sjb +--hl.bind("SUPER + J", hl.dsp.layout("togglesplit"), { description = "Toggle window split" }) +--hl.bind("SUPER + P", hl.dsp.window.pseudo(), { description = "Pseudo window" }) + +hl.bind("ALT + Tab", cycle_next_window({ next = true }), { description = "Window: Cycle next" }) +hl.bind("ALT + SHIFT + Tab", cycle_next_window({ next = false }), { description = "Window: Cycle prev" }) + +hl.bind("CONTROL + ALT + TAB", hl.dsp.focus({ monitor = "+1" }), { description = "Focus on next monitor" }) +hl.bind("CONTROL + ALT + SHIFT + TAB", hl.dsp.focus({ monitor = "-1" }), { description = "Focus on previous monitor" }) + +hl.bind("SUPER + S", hl.dsp.workspace.toggle_special("scratchpad"), { description = "Toggle scratchpad" }) +hl.bind("SUPER + ALT + S", hl.dsp.window.move({ workspace = "special:scratchpad", follow = false }), + { description = "Move window to scratchpad" }) + +-- hl.bind("SUPER + TAB", hl.dsp.focus({ monitor = "+1" }), { description = "Monitor: move focus to next monitor" }) +hl.bind("SUPER + TAB", hl.dsp.focus({ workspace = "e+1" }), { description = "Next workspace" }) +hl.bind("SUPER + SHIFT + TAB", hl.dsp.focus({ workspace = "e-1" }), { description = "Previous workspace" }) +hl.bind("SUPER + CONTROL + TAB", hl.dsp.focus({ workspace = "previous" }), { description = "Former workspace" }) + +hl.bind("SUPER + ALT + SHIFT + LEFT", hl.dsp.workspace.move({ monitor = "l" }), + { description = "Move workspace to left monitor" }) +hl.bind("SUPER + ALT + SHIFT + RIGHT", hl.dsp.workspace.move({ monitor = "r" }), + { description = "Move workspace to right monitor" }) +hl.bind("SUPER + ALT + SHIFT + UP", hl.dsp.workspace.move({ monitor = "u" }), + { description = "Move workspace to up monitor" }) +hl.bind("SUPER + ALT + SHIFT + DOWN", hl.dsp.workspace.move({ monitor = "d" }), + { description = "Move workspace to down monitor" }) + +hl.bind("SUPER + SHIFT + LEFT", hl.dsp.window.swap({ direction = "l" }), { description = "Swap window to the left" }) +hl.bind("SUPER + SHIFT + RIGHT", hl.dsp.window.swap({ direction = "r" }), { description = "Swap window to the right" }) +hl.bind("SUPER + SHIFT + UP", hl.dsp.window.swap({ direction = "u" }), { description = "Swap window up" }) +hl.bind("SUPER + SHIFT + DOWN", hl.dsp.window.swap({ direction = "d" }), { description = "Swap window down" }) + +hl.bind("SUPER + ALT + Tab", hl.dsp.focus({ workspace = "next", on_current_monitor = true }), + { description = "Window: Focus previous in workspace" }) +hl.bind("SUPER + ALT + SHIFT + Tab", hl.dsp.focus({ workspace = "previous", on_current_monitor = true }), + { description = "Window: Focus previous in workspace" }) + +-- arrange split ratio +hl.bind("SUPER + SHIFT + M", toggle_master, { description = "Layout: Toggle master size" }) +hl.bind("SUPER + M", function() + local current_layout = hl.get_config("general.layout") + if current_layout == "master" then + hl.dispatch(hl.dsp.layout("swapwithmaster")) + end + if current_layout == "scrolling" then + hl.dispatch(hl.dsp.layout("consume_or_expel next")) + end +end, { description = "Layout: Swap with master" }) + +hl.bind("SUPER + period", function() + local current_layout = hl.get_config("general.layout") + if current_layout == "master" then + hl.dispatch(hl.dsp.layout("cycleprev")) + hl.dispatch(hl.dsp.layout("swapwithmaster")) + end + + if current_layout == "scrolling" then + hl.dispatch(hl.dsp.layout("swapcol r")) + hl.dispatch(hl.dsp.layout("focus l")) + end + -- hl.dispatch(hl.dsp.layout("focus r")) +end, { description = "Layout: Cycle next" }) + +hl.bind("SUPER + comma", function() + local current_layout = hl.get_config("general.layout") + if current_layout == "master" then + hl.dispatch(hl.dsp.layout("cyclenext")) + hl.dispatch(hl.dsp.layout("swapwithmaster")) + end + + if current_layout == "scrolling" then + hl.dispatch(hl.dsp.layout("swapcol l")) + hl.dispatch(hl.dsp.layout("focus r")) + end + -- hl.dispatch(hl.dsp.layout("focus l")) +end, { description = "Layout: Cycle previous" }) + +hl.bind("SUPER + SHIFT + comma", hl.dsp.window.move({ workspace = "-1" }), + { description = "Window: Move to previous workspace" }) + +hl.bind("SUPER + SHIFT + period", hl.dsp.window.move({ workspace = "+1" }), + { description = "Window: Move to next workspace" }) + + +hl.bind("SUPER + CONTROL + SHIFT + slash", + hl.dsp.exec_cmd("makoctl mode -t do-not-disturb"), + { description = "Toggle do-not-disturb" }) + +hl.bind("SUPER + CONTROL + Delete", hl.dsp.exec_cmd("hyprland-toggle-monitor eDP-1"), + { description = "Toggle laptop display" }) + +hl.on("keybinds.submap", function(name) + if name == "" then + hl.notification.create({ text = "Exited submap", duration = 2000, icon = "hint" }) + return + end + hl.notification.create({ text = "Entered submap: " .. name, duration = 2000, icon = "hint" }) +end) + +hl.bind("SUPER + F9", hl.dsp.submap("resize"), { description = "Resize Menu" }) +hl.define_submap("resize", function() + hl.bind("period", hl.dsp.window.resize({ x = 10, y = 10, relative = true }), + { repeating = true, description = "Resize: Increase" }) + hl.bind("comma", hl.dsp.window.resize({ x = -10, y = -10, relative = true }), + { repeating = true, description = "Resize: Decrease" }) + hl.bind("R", function() + window_resize_percentage(0.5, 0.5) + end, { description = "Resize: Reset" }) + hl.bind("S", function() + window_resize_percentage(0.25, 0.25) + end, { description = "Resize: Small" }) + hl.bind("D", function() + window_resize_percentage(0.7, 0.96) + hl.dispatch(hl.dsp.window.center()) + end, { description = "Resize: Large" }) + hl.bind("C", hl.dsp.window.center(), { description = "Resize: Center" }) + hl.bind("P", hl.dsp.window.pin(), { description = "Resize: Pin" }) + hl.bind("up", hl.dsp.window.move({ direction = "up" }), { description = "Resize: Move up" }) + hl.bind("down", hl.dsp.window.move({ direction = "down" }), { description = "Resize: Move down" }) + hl.bind("left", hl.dsp.window.move({ direction = "left" }), { description = "Resize: Move left" }) + hl.bind("right", hl.dsp.window.move({ direction = "right" }), { description = "Resize: Move right" }) + hl.bind("escape", hl.dsp.submap("reset"), { description = "Resize: Exit" }) + hl.bind("catchall", hl.dsp.submap("reset"), { description = "Resize: Exit" }) +end) + +local workspaceGroupSize = 10 +local numberkey = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 } + +function workspace_in_group(i) + local curr = hl.get_active_workspace().id + local newVal = math.floor((curr - 1) / workspaceGroupSize) * workspaceGroupSize + i + return newVal +end + +for i = 1, 10 do + hl.bind("SUPER + CONTROL + code:" .. numberkey[i], function() + hl.dispatch(hl.dsp.workspace.move({ monitor = "+1", workspace = workspace_in_group(i), follow = true })) + end, { description = "Workspace: Move monitor " .. i }) +end + +for i = 1, 10 do + hl.bind("SUPER + SHIFT + code:" .. numberkey[i], function() + hl.dispatch(hl.dsp.window.move({ workspace = workspace_in_group(i), follow = true })) + end, { description = "Workspace: Move " .. i }) +end + +for i = 1, 10 do + hl.bind("SUPER + code:" .. numberkey[i], function() + hl.dispatch(hl.dsp.focus({ workspace = workspace_in_group(i), on_current_monitor = true })) + end, { description = "Workspace: Focus " .. i }) +end + +-- Scroll through existing workspaces with mainMod + scroll +hl.bind("SUPER + mouse_down", hl.dsp.focus({ workspace = "e+1" }), { description = "Workspace: Next" }) +hl.bind("SUPER + mouse_up", hl.dsp.focus({ workspace = "e-1" }), { description = "Workspace: Previous" }) + +-- Move/resize windows with mainMod + LMB/RMB and dragging +hl.bind("SUPER + mouse:272", hl.dsp.window.drag(), { mouse = true, description = "Window: Drag" }) +hl.bind("SUPER + mouse:273", hl.dsp.window.resize(), { mouse = true, description = "Window: Resize" }) +hl.bind("mouse:275", hl.dsp.window.cycle_next({ next = true }), { click = true, description = "Window: Cycle next" }) +hl.bind("mouse:276", hl.dsp.window.cycle_next({ next = false }), { click = true, description = "Window: Cycle previous" }) + +hl.bind(sjb.HYPR .. "semicolon", hl.dsp.exec_cmd("~/.local/bin/set-wallpaper.sh categories/technics"), + { description = "get new wallpaper" }) + +-- Gestures +-- hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) +-- hl.gesture({ fingers = 3, direction = "down", mods = "ALT", action = "close" }) +-- hl.gesture({ fingers = 3, direction = "up", mods = "SUPER", scale = 1.5, action = "fullscreen" }) +-- hl.gesture({ fingers = 3, direction = "left", scale = 1.5, action = "float" }) +-- +-- hl.gesture({ fingers = 2, direction = "pinch", action = "cursorZoom", zoom_level = 2 }) +-- hl.gesture({ fingers = 2, direction = "pinch", action = "cursorZoom", zoom_level = 1.2, mode = "mult" }) +-- hl.gesture({ fingers = 2, direction = "pinch", action = "cursorZoom", zoom_level = 1, mode = "live" }) diff --git a/desktop/config/hypr/sjb/extra.lua b/desktop/config/hypr/sjb/extra.lua index a56cbef..2712e84 100644 --- a/desktop/config/hypr/sjb/extra.lua +++ b/desktop/config/hypr/sjb/extra.lua @@ -1,4 +1,3 @@ - -- Open rofi on first press, closes it on second hl.bind("SUPER + Space", hl.dsp.exec_raw("rofi -show combi --modes combi"), { release = true, description = "Open Application Menu" }) @@ -14,3 +13,47 @@ hl.bind("SUPER + slash", hl.bind("SUPER + Y", hl.dsp.exec_cmd("makoctl dismiss"), { description = "Dismiss notifications" }) +hl.bind(sjb.HYPR .. "V", hl.dsp.exec_cmd("pavucontrol"), { description = "Volume control" }) +hl.bind(sjb.HYPR .. "B", hl.dsp.exec_cmd("blueberry"), { description = "Bluetooth manager" }) + +hl.bind("SUPER + Escape", hl.dsp.exec_raw("loginctl lock-session"), { description = "Lock screen" }) +hl.bind("SUPER + SHIFT + escape", hl.dsp.exec_raw("systemctl suspend"), { description = "Suspend" }) +hl.bind("SUPER + ALT + escape", hl.dsp.exit(), { description = "Exit Hyprland" }) +hl.bind("SUPER + CONTROL + escape", hl.dsp.exec_raw("reboot"), { description = "Reboot" }) +hl.bind("SUPER + SHIFT + CONTROL + escape", hl.dsp.exec_raw("systemctl poweroff"), { description = "Power off" }) + +hl.bind("Print", + hl.dsp.exec_cmd("hyprshot -m window -o ~/Pictures/ -- tensaku-edit"), + { description = "Take screenshot" }) + +hl.bind("SHIFT + PRINT", + hl.dsp.exec_cmd("hyprshot -m region -o ~/Pictures/ -- tensaku-edit"), + { description = "Take screenshot" }) + +hl.bind("SUPER + PRINT", hl.dsp.exec_cmd("pkill hyprpicker || hyprpicker -a"), { description = "Pick color" }) +hl.bind("SUPER + CONTROL + PRINT", + hl.dsp.exec_cmd("hyprshot -m region --raw -z | /usr/bin/tesseract stdin stdout --oem 1 --psm 6 -l eng | wl-copy"), + { description = "Extract text (OCR) from screenshot" }) + +hl.bind("SUPER + ALT + Print", + hl.dsp.exec_cmd("~/.local/bin/screen-recorder -o ~/Videos/$(date +'%Y-%m-%d_%H%M%S')_recording.mp4"), + { description = "Start/Stop screen recording" }) + +hl.bind("SUPER + ALT + SHIFT + Print", + hl.dsp.exec_cmd("~/.local/bin/screen-recorder stop"), + { description = "Stop screen recording" }) + +hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), + { repeating = true, description = "Volume down" }) +hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), + { repeating = true, description = "Volume up" }) +hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { description = "Toggle mute" }) +hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), + { description = "Toggle mic mute" }) +hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 10%+"), + { repeating = true, description = "Brightness up" }) +hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 10%-"), + { repeating = true, description = "Brightness down" }) +hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { description = "Play/pause media" }) +hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { description = "Previous media" }) +hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { description = "Next media" }) diff --git a/desktop/config/hypr/sjb/functions.lua b/desktop/config/hypr/sjb/functions.lua index 7f4459d..bdfd735 100644 --- a/desktop/config/hypr/sjb/functions.lua +++ b/desktop/config/hypr/sjb/functions.lua @@ -1,3 +1,21 @@ +sjb = sjb or {} + +local function file_exists(path) + local file = io.open(path, "r") + if file then + file:close() + return true + end + + return false +end + +function sjb.omarchy_tools_available() + return file_exists("/usr/bin/omarchy-menu") +end + +sjb.HYPR = "SUPER + CONTROL + SHIFT + ALT + " + function sysinfo() local mem = io.popen("free -h | awk '/^Mem/ {print $3 \"/\" $2}'"):read("*a") local cpu = io.popen("top -bn1 | grep 'Cpu(s)' | awk '{print $2 + $4 \"%\"}'"):read("*a") @@ -191,8 +209,9 @@ function window_resize_percentage(px, py) end function toggle_master_scrolling() - local current = hl.get_config("general.layout") - local next_layout = current == "master" and "scrolling" or "master" + local ws = hl.get_active_workspace() - hl.config({ general = { layout = next_layout } }) + local next_layout = ws.tiled_layout == "master" and "scrolling" or "master" + hl.notification.create({ text = "Workspace layout set to " .. next_layout, icon = "hint", duration = 5000 }) + hl.workspace_rule({ workspace = ws.id, layout = next_layout }) end diff --git a/desktop/config/hypr/sjb/init.lua b/desktop/config/hypr/sjb/init.lua index bd75f1c..f144f8b 100644 --- a/desktop/config/hypr/sjb/init.lua +++ b/desktop/config/hypr/sjb/init.lua @@ -1,354 +1,16 @@ -local terminal = "foot" -local browser = "gtk-launch chromium.desktop" -local webapp = "chromium --new-window --ozone-platform=wayland --app=" -local music = "gtk-launch spotify.desktop" - -local HYPR = "SUPER + CONTROL + SHIFT + ALT + " - require("sjb/monitors") require("sjb/configuration") require("sjb/functions") require("sjb/rules") require("sjb/envs") require("sjb/autostart") -require("theme") +require("sjb/bindings") +require("sjb/applications") --- Keybindings - -hl.bind("SUPER + SHIFT + return", hl.dsp.exec_cmd("footclient -a terminal-herdr -T terminal-herdr herdr --session=main"), { description = "Open herdr terminal" }) -hl.bind("SUPER + return", hl.dsp.exec_cmd("footclient -a terminal-tmux -T terminal-tmux tmux new -A -s main"), { description = "Open tmux terminal" }) - -hl.bind("SUPER + N", hl.dsp.exec_cmd(terminal .. " -a quicknotes -e nvim +'Obsidian today'"), - { description = "Open Obsidian today in a centered floating window" }) -hl.bind("SUPER + A", hl.dsp.exec_cmd(terminal .. " -a agenda -e nvim +'Org agenda t'"), - { description = "Open Org agenda in a centered floating window" }) -hl.bind("SUPER + CONTROL + A", hl.dsp.exec_cmd(terminal .. " -a capture -e nvim +'Org capture t'"), - { description = "Open Org capture in a centered floating window" }) - -hl.bind("SUPER + B", hl.dsp.exec_raw(browser), { description = "Open browser" }) -hl.bind("SUPER + I", sysinfo, { description = "Show system info" }) - -hl.bind("SUPER + CONTROL + X", hl.dsp.exec_raw("ostt launch --paste"), { description = "Open ostt" }) -hl.bind("F9", hl.dsp.exec_raw("ostt launch --paste"), { description = "Open ostt" }) - -hl.bind( - "SUPER + Y", - toggle_master_scrolling, - { description = "Layout: Toggle master/scrolling" } -) -hl.bind("Print", - hl.dsp.exec_cmd("hyprshot -m window -o ~/Pictures/ -- tensaku-edit"), - { description = "Take screenshot" }) - -hl.bind("SHIFT + PRINT", - hl.dsp.exec_cmd("hyprshot -m region -o ~/Pictures/ -- tensaku-edit"), - { description = "Take screenshot" }) - -hl.bind("SUPER + PRINT", hl.dsp.exec_cmd("pkill hyprpicker || hyprpicker -a"), { description = "Pick color" }) -hl.bind("SUPER + CONTROL + PRINT", - hl.dsp.exec_cmd("hyprshot -m region --raw -z | /usr/bin/tesseract stdin stdout --oem 1 --psm 6 -l eng | wl-copy"), - { description = "Extract text (OCR) from screenshot" }) - -hl.bind("SUPER + ALT + Print", - hl.dsp.exec_cmd("~/.local/bin/screen-recorder -o ~/Videos/$(date +'%Y-%m-%d_%H%M%S')_recording.mp4"), - { description = "Start/Stop screen recording" }) - -hl.bind("SUPER + ALT + SHIFT + Print", - hl.dsp.exec_cmd("~/.local/bin/screen-recorder stop"), - { description = "Stop screen recording" }) - - -hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), - { repeating = true, description = "Volume down" }) -hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), - { repeating = true, description = "Volume up" }) -hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { description = "Toggle mute" }) -hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), - { description = "Toggle mic mute" }) -hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 10%+"), - { repeating = true, description = "Brightness up" }) -hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 10%-"), - { repeating = true, description = "Brightness down" }) -hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { description = "Play/pause media" }) -hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { description = "Previous media" }) -hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { description = "Next media" }) - -hl.bind("SUPER + W", hl.dsp.window.close(), { description = "Window: Close" }) -hl.bind("SUPER + F", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" }), - { description = "Window: Toggle fullscreen" }) -hl.bind("SUPER + CONTROL + F", hl.dsp.window.fullscreen_state({ internal = 2, client = 0, action = "toggle" }), - { description = "Window: Toggle fullscreen state 2" }) -hl.bind("SUPER + ALT + F", hl.dsp.window.fullscreen_state({ internal = 0, client = 2, action = "toggle" }), - { description = "Window: Toggle fullscreen state 2" }) - -hl.bind("SUPER + T", toggle_float_with_limit, - { description = "Window: Toggle floating/tiling (max 80%)" }) - --- hl.bind("SUPER + P", hl.dsp.window.pseudo(), { description = "Window: Toggle pseudo tiling" }) -hl.bind("SUPER + P", toggle_pin, { description = "Window: Toggle Pin" }) - --- hl.bind("SUPER + A", hl.dsp.window.alter_zorder({ mode = "top" }), { description = "Window: Move to top" }) - -hl.bind("SUPER + left", hl.dsp.focus({ direction = "l" }), { description = "Window: Focus left" }) -hl.bind("SUPER + right", hl.dsp.focus({ direction = "r" }), { description = "Window: Focus right" }) -hl.bind("SUPER + up", hl.dsp.focus({ direction = "u" }), { description = "Window: Focus up" }) -hl.bind("SUPER + down", hl.dsp.focus({ direction = "d" }), { description = "Window: Focus down" }) - -hl.bind("SUPER + H", hl.dsp.focus({ direction = "l" }), { description = "Window: Focus left" }) -hl.bind("SUPER + L", hl.dsp.focus({ direction = "r" }), { description = "Window: Focus right" }) -hl.bind("SUPER + K", hl.dsp.focus({ direction = "u" }), { description = "Window: Focus up" }) -hl.bind("SUPER + J", hl.dsp.focus({ direction = "d" }), { description = "Window: Focus down" }) -- hl.bind("SUPER + H", hl.dsp.window.resize("left"), { repeating = true, description = "Window: Resize left" }) - --- hl.bind("SUPER + z", hl.dsp.focus({ last = true }), { description = "Window: Focus last" }) -hl.bind("SUPER + Z", hl.dsp.focus({ urgent_or_last = true }), { description = "Window: Focus last" }) - -hl.bind("SUPER + ALT + period", function() - hl.dispatch(hl.dsp.layout("cycleprev")) -end, { description = "Window: Swap with next" }) -hl.bind("SUPER + ALT + comma", function() - hl.dispatch(hl.dsp.layout("cyclenext")) -end, { description = "Window: Swap with prev" }) - -hl.bind("ALT + Tab", cycle_next_window({ next = true }), { description = "Window: Cycle next" }) -hl.bind("ALT + SHIFT + Tab", cycle_next_window({ next = false }), { description = "Window: Cycle prev" }) - -hl.bind("CONTROL + ALT + TAB", hl.dsp.focus({ monitor = "+1" }), { description = "Focus on next monitor" }) -hl.bind("CONTROL + ALT + SHIFT + TAB", hl.dsp.focus({ monitor = "-1" }), { description = "Focus on previous monitor" }) - -hl.bind("SUPER + S", hl.dsp.workspace.toggle_special("scratchpad"), { description = "Toggle scratchpad" }) -hl.bind("SUPER + ALT + S", hl.dsp.window.move({ workspace = "special:scratchpad", follow = false }), - { description = "Move window to scratchpad" }) -hl.bind("SUPER + grave", hl.dsp.workspace.toggle_special("scratchpad"), { description = "Toggle scratchpad" }) -hl.bind("SUPER + SHIFT + grave", hl.dsp.window.move({ workspace = "special:scratchpad", follow = false }), - { description = "Move window to scratchpad" }) - --- hl.bind("SUPER + TAB", hl.dsp.focus({ monitor = "+1" }), { description = "Monitor: move focus to next monitor" }) -hl.bind("SUPER + TAB", hl.dsp.focus({ workspace = "e+1" }), { description = "Next workspace" }) -hl.bind("SUPER + SHIFT + TAB", hl.dsp.focus({ workspace = "e-1" }), { description = "Previous workspace" }) -hl.bind("SUPER + CONTROL + TAB", hl.dsp.focus({ workspace = "previous" }), { description = "Former workspace" }) - -hl.bind("SUPER + ALT + SHIFT + LEFT", hl.dsp.workspace.move({ monitor = "l" }), - { description = "Move workspace to left monitor" }) -hl.bind("SUPER + ALT + SHIFT + RIGHT", hl.dsp.workspace.move({ monitor = "r" }), - { description = "Move workspace to right monitor" }) -hl.bind("SUPER + ALT + SHIFT + UP", hl.dsp.workspace.move({ monitor = "u" }), - { description = "Move workspace to up monitor" }) -hl.bind("SUPER + ALT + SHIFT + DOWN", hl.dsp.workspace.move({ monitor = "d" }), - { description = "Move workspace to down monitor" }) - -hl.bind("SUPER + SHIFT + LEFT", hl.dsp.window.swap({ direction = "l" }), { description = "Swap window to the left" }) -hl.bind("SUPER + SHIFT + RIGHT", hl.dsp.window.swap({ direction = "r" }), { description = "Swap window to the right" }) -hl.bind("SUPER + SHIFT + UP", hl.dsp.window.swap({ direction = "u" }), { description = "Swap window up" }) -hl.bind("SUPER + SHIFT + DOWN", hl.dsp.window.swap({ direction = "d" }), { description = "Swap window down" }) - -hl.bind("SUPER + ALT + Tab", hl.dsp.focus({ workspace = "next", on_current_monitor = true }), - { description = "Window: Focus previous in workspace" }) -hl.bind("SUPER + ALT + SHIFT + Tab", hl.dsp.focus({ workspace = "previous", on_current_monitor = true }), - { description = "Window: Focus previous in workspace" }) - --- arrange split ratio -hl.bind("SUPER + X", toggle_master, { description = "Layout: Toggle master size" }) --- hl.bind("SUPER + equal", hl.dsp.layout("mfact exact 0.5")) -hl.bind("SUPER + M", function() - local current_layout = hl.get_config("general.layout") - if current_layout == "master" then - hl.dispatch(hl.dsp.layout("swapwithmaster")) - end - if current_layout == "scrolling" then - hl.dispatch(hl.dsp.layout("consume_or_expel next")) - end -end, { description = "Layout: Swap with master" }) - --- hl.bind("SUPER + M", hl.dsp.layout("rollnext")) -hl.bind("SUPER + period", function() - local current_layout = hl.get_config("general.layout") - if current_layout == "master" then - hl.dispatch(hl.dsp.layout("cycleprev")) - hl.dispatch(hl.dsp.layout("swapwithmaster")) - end - - if current_layout == "scrolling" then - hl.dispatch(hl.dsp.layout("swapcol r")) - hl.dispatch(hl.dsp.layout("focus l")) - end - -- hl.dispatch(hl.dsp.layout("focus r")) -end, { description = "Layout: Cycle next" }) - -hl.bind("SUPER + comma", function() - local current_layout = hl.get_config("general.layout") - if current_layout == "master" then - hl.dispatch(hl.dsp.layout("cyclenext")) - hl.dispatch(hl.dsp.layout("swapwithmaster")) - end - - if current_layout == "scrolling" then - hl.dispatch(hl.dsp.layout("swapcol l")) - hl.dispatch(hl.dsp.layout("focus r")) - end - -- hl.dispatch(hl.dsp.layout("focus l")) -end, { description = "Layout: Cycle previous" }) - -hl.bind("SUPER + SHIFT + comma", hl.dsp.window.move({ workspace = "-1" }), - { description = "Window: Move to previous workspace" }) - -hl.bind("SUPER + SHIFT + period", hl.dsp.window.move({ workspace = "+1" }), - { description = "Window: Move to next workspace" }) - -hl.bind("SUPER + ALT + comma", hl.dsp.workspace.move({ monitor = "-1" }), - { description = "Window: Move to previous workspace and follow" }) - -hl.bind("SUPER + ALT + period", hl.dsp.workspace.move({ monitor = "+1" }), - { description = "Window: Move to next workspace and follow" }) - -hl.bind("SUPER + C", hl.dsp.window.center(), { description = "Window: Center" }) - -hl.bind("SUPER + CONTROL + SHIFT + slash", - hl.dsp.exec_cmd("makoctl mode -t do-not-disturb"), - { description = "Toggle do-not-disturb" }) - -hl.bind("SUPER + CONTROL + Delete", hl.dsp.exec_cmd("hyprland-toggle-monitor eDP-1"), - { description = "Toggle laptop display" }) - -hl.bind("SUPER + Escape", hl.dsp.exec_raw("loginctl lock-session"), { description = "Lock screen" }) -hl.bind("SUPER + SHIFT + escape", hl.dsp.exec_raw("systemctl suspend"), { description = "Suspend" }) -hl.bind("SUPER + ALT + escape", hl.dsp.exit(), { description = "Exit Hyprland" }) -hl.bind("SUPER + CONTROL + escape", hl.dsp.exec_raw("reboot"), { description = "Reboot" }) -hl.bind("SUPER + SHIFT + CONTROL + escape", hl.dsp.exec_raw("systemctl poweroff"), { description = "Power off" }) - -hl.on("keybinds.submap", function(name) - if name == "" then - hl.notification.create({ text = "Exited submap", duration = 2000, icon = "hint" }) - return - end - hl.notification.create({ text = "Entered submap: " .. name, duration = 2000, icon = "hint" }) -end) - -hl.bind(HYPR .. "Z", hl.dsp.submap("passthru"), { description = "Passthru Menu" }) -hl.define_submap("passthru", function() - hl.bind("escape", hl.dsp.submap("reset"), { description = "Passthru: Exit" }) -end) - -hl.bind("SUPER + F9", hl.dsp.submap("resize"), { description = "Resize Menu" }) -hl.define_submap("resize", function() - hl.bind("period", hl.dsp.window.resize({ x = 10, y = 10, relative = true }), - { repeating = true, description = "Resize: Increase" }) - hl.bind("comma", hl.dsp.window.resize({ x = -10, y = -10, relative = true }), - { repeating = true, description = "Resize: Decrease" }) - hl.bind("R", function() - window_resize_percentage(0.5, 0.5) - end, { description = "Resize: Reset" }) - hl.bind("S", function() - window_resize_percentage(0.25, 0.25) - end, { description = "Resize: Small" }) - hl.bind("D", function() - window_resize_percentage(0.7, 0.96) - hl.dispatch(hl.dsp.window.center()) - end, { description = "Resize: Large" }) - hl.bind("C", hl.dsp.window.center(), { description = "Resize: Center" }) - hl.bind("P", hl.dsp.window.pin(), { description = "Resize: Pin" }) - hl.bind("up", hl.dsp.window.move({ direction = "up" }), { description = "Resize: Move up" }) - hl.bind("down", hl.dsp.window.move({ direction = "down" }), { description = "Resize: Move down" }) - hl.bind("left", hl.dsp.window.move({ direction = "left" }), { description = "Resize: Move left" }) - hl.bind("right", hl.dsp.window.move({ direction = "right" }), { description = "Resize: Move right" }) - hl.bind("escape", hl.dsp.submap("reset"), { description = "Resize: Exit" }) - hl.bind("catchall", hl.dsp.submap("reset"), { description = "Resize: Exit" }) -end) - -local workspaceGroupSize = 10 -local numberkey = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 } - -function workspace_in_group(i) - local curr = hl.get_active_workspace().id - local newVal = math.floor((curr - 1) / workspaceGroupSize) * workspaceGroupSize + i - return newVal +if sjb.omarchy_tools_available() then + require("sjb/omarchy") + require("sjb/utilities") +else + require("sjb/extra") end - -for i = 1, 10 do - hl.bind("SUPER + CONTROL + code:" .. numberkey[i], function() - hl.dispatch(hl.dsp.workspace.move({ monitor = "+1", workspace = workspace_in_group(i), follow = true })) - end, { description = "Workspace: Move monitor " .. i }) -end - -for i = 1, 10 do - hl.bind("SUPER + SHIFT + code:" .. numberkey[i], function() - hl.dispatch(hl.dsp.window.move({ workspace = workspace_in_group(i), follow = true })) - end, { description = "Workspace: Move " .. i }) -end - -for i = 1, 10 do - hl.bind("SUPER + code:" .. numberkey[i], function() - hl.dispatch(hl.dsp.focus({ workspace = workspace_in_group(i), on_current_monitor = true })) - end, { description = "Workspace: Focus " .. i }) -end - --- Scroll through existing workspaces with mainMod + scroll -hl.bind("SUPER + mouse_down", hl.dsp.focus({ workspace = "e+1" }), { description = "Workspace: Next" }) -hl.bind("SUPER + mouse_up", hl.dsp.focus({ workspace = "e-1" }), { description = "Workspace: Previous" }) - --- Move/resize windows with mainMod + LMB/RMB and dragging -hl.bind("SUPER + mouse:272", hl.dsp.window.drag(), { mouse = true, description = "Window: Drag" }) -hl.bind("SUPER + mouse:273", hl.dsp.window.resize(), { mouse = true, description = "Window: Resize" }) -hl.bind("mouse:275", hl.dsp.window.cycle_next({ next = true }), { click = true, description = "Window: Cycle next" }) -hl.bind("mouse:276", hl.dsp.window.cycle_next({ next = false }), { click = true, description = "Window: Cycle previous" }) - -hl.bind(HYPR .. "V", hl.dsp.exec_cmd("pavucontrol"), { description = "Volume control" }) -hl.bind(HYPR .. "B", hl.dsp.exec_cmd("blueberry"), { description = "Bluetooth manager" }) - -hl.bind(HYPR .. "semicolon", hl.dsp.exec_cmd("~/.local/bin/set-wallpaper.sh categories/technics"), - { description = "get new wallpaper" }) - -hl.bind(HYPR .. "A", hl.dsp.exec_cmd("gtk-launch pi.desktop"), { description = "Open pi tui" }) -hl.bind(HYPR .. "O", dispatch_focus_or_launch({ - match = "chrome-outlook.office.com", - cmd = "gtk-launch Outlook.desktop", -}), { description = "Email" }) - -hl.bind(HYPR .. "T", dispatch_focus_or_launch({ - match = "chrome-teams.microsoft.com", - cmd = "gtk-launch Team.desktop", -}), { description = "UWO Team" }) - -hl.bind(HYPR .. "Y", dispatch_focus_or_launch({ - match = "chrome-youtube.com", - cmd = "gtk-launch YouTube.desktop", -}), { description = "YouTube" }) - -hl.bind(HYPR .. "W", dispatch_focus_or_launch({ - match = "chrome-web.whatsapp.com", - cmd = "gtk-launch WhatsApp.desktop", -}), { description = "WhatsApp" }) - -hl.bind(HYPR .. "G", dispatch_focus_or_launch({ - match = "chrome-chatgpt.com", - cmd = "gtk-launch ChatGPT.desktop", -}), { description = "ChatGPT" }) - -hl.bind(HYPR .. "D", dispatch_focus_or_launch({ - match = "chrome-discord.com", - cmd = "gtk-launch Discord.desktop" -}), { description = "Discord" }) - -hl.bind(HYPR .. "M", dispatch_focus_or_launch({ - match = "chrome-messages.google.com", - cmd = "gtk-launch \"Google Messages.desktop\"", -}), { description = "Google Messages" }) - -hl.bind(HYPR .. "S", dispatch_focus_or_launch({ - match = "Spotify", - cmd = music, -}), { description = "Music" }) - -hl.bind(HYPR .. "F", dispatch_focus_or_launch({ - match = "strata", - cmd = "gtk-launch io.github.lgse.Strata.desktop", -}), { description = "File Manager" }) - --- Gestures --- hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) --- hl.gesture({ fingers = 3, direction = "down", mods = "ALT", action = "close" }) --- hl.gesture({ fingers = 3, direction = "up", mods = "SUPER", scale = 1.5, action = "fullscreen" }) --- hl.gesture({ fingers = 3, direction = "left", scale = 1.5, action = "float" }) --- --- hl.gesture({ fingers = 2, direction = "pinch", action = "cursorZoom", zoom_level = 2 }) --- hl.gesture({ fingers = 2, direction = "pinch", action = "cursorZoom", zoom_level = 1.2, mode = "mult" }) --- hl.gesture({ fingers = 2, direction = "pinch", action = "cursorZoom", zoom_level = 1, mode = "live" }) +-- require("theme") diff --git a/desktop/config/hypr/sjb/monitors.lua b/desktop/config/hypr/sjb/monitors.lua index 04ee1a0..04f5c7c 100644 --- a/desktop/config/hypr/sjb/monitors.lua +++ b/desktop/config/hypr/sjb/monitors.lua @@ -8,6 +8,14 @@ hl.monitor({ "1.333333" }) +hl.monitor({ + output = "desc:Apple Computer Inc LED Cinema W82104Y16JL", + mode = "preferred", + position = "auto-right", + scale = + "1.333333" +}) + hl.monitor({ output = "desc:Microstep MSI MAG342CQR DB6H252300057", mode = "3440x1440@144", @@ -16,6 +24,7 @@ hl.monitor({ scale = "1.0" }) + hl.monitor({ output = "desc:Ancor Communications Inc ASUS MG28U 0x00009B77", mode = "preferred", diff --git a/desktop/config/hypr/sjb/omarchy.lua b/desktop/config/hypr/sjb/omarchy.lua new file mode 100644 index 0000000..8fcc405 --- /dev/null +++ b/desktop/config/hypr/sjb/omarchy.lua @@ -0,0 +1,107 @@ +hl.bind("SUPER + SPACE", hl.dsp.exec_raw("omarchy-menu toggle"), { description = "Omarchy menu" }) +hl.bind("SUPER + ALT + SPACE", hl.dsp.exec_raw("omarchy-menu toggle apps"), { description = "Apps menu" }) +hl.bind("SUPER + CTRL + E", hl.dsp.exec_raw("omarchy-shell shell toggle omarchy.emojis"), { description = "Emojis" }) +hl.bind("SUPER + CTRL + C", hl.dsp.exec_raw("omarchy-menu toggle capture"), { description = "Capture menu" }) +hl.bind("SUPER + CTRL + O", hl.dsp.exec_raw("omarchy-menu toggle toggle"), { description = "Toggle menu" }) +hl.bind("SUPER + CTRL + H", hl.dsp.exec_raw("omarchy-menu toggle hardware"), { description = "Hardware menu" }) +hl.bind("SUPER + SHIFT + code:201", hl.dsp.exec_raw("omarchy-menu toggle root"), { description = "Omarchy menu" }) +hl.bind("SUPER + ESCAPE", hl.dsp.exec_raw("omarchy-menu toggle system"), { description = "System menu" }) +hl.bind("SUPER + CTRL + Q", hl.dsp.exec_raw("omacalc"), { description = "Calculator" }) +hl.bind("XF86Calculator", hl.dsp.exec_raw("omacalc"), { description = "Calculator" }) +hl.bind("XF86PowerOff", hl.dsp.exec_raw("omarchy-menu toggle system", { locked = true }), { description = "Power menu" }) + +hl.bind("SUPER + SHIFT + SPACE", hl.dsp.exec_raw('omarchy-toggle-bar'), { description = "Toggle top bar" }) + +hl.bind("SUPER + CTRL + SPACE", hl.dsp.exec_raw("omarchy-menu toggle background"), + { description = "Background switcher" }) +hl.bind("SUPER + SHIFT + CTRL + SPACE", hl.dsp.exec_raw("omarchy-menu toggle theme"), { description = "Theme menu" }) +hl.bind("SUPER + BACKSPACE", hl.dsp.exec_raw("omarchy-hyprland-window-transparency-toggle"), + { description = "Toggle window transparency" }) +hl.bind("SUPER + SHIFT + BACKSPACE", hl.dsp.exec_raw("omarchy-hyprland-window-gaps-toggle"), + { description = "Toggle window gaps" }) +hl.bind("SUPER + CTRL + BACKSPACE", hl.dsp.exec_raw("omarchy-hyprland-window-single-square-aspect-toggle"), + { description = "Toggle single-window square aspect" }) + +-- xkbcommon names the comma keysym "comma"; the upper-case "COMMA" does not match. +hl.bind("SUPER + X", hl.dsp.exec_raw("omarchy-shell notifications dismissOne"), + { description = "Dismiss last notification" }) +hl.bind("SUPER + SHIFT + X", hl.dsp.exec_raw("omarchy-shell notifications dismissAll"), + { description = "Dismiss all notifications" }) +hl.bind("SUPER + CTRL + X", hl.dsp.exec_raw("omarchy-toggle-notification-silencing"), + { description = "Toggle silencing notifications" }) +hl.bind("SUPER + ALT + X", hl.dsp.exec_raw("omarchy-shell notifications invokeLast"), + { description = "Invoke last notification" }) +hl.bind("SUPER + SHIFT + ALT + ", hl.dsp.exec_raw("omarchy-shell notifications showHistory"), + { description = "Open notification history" }) + +hl.bind("SUPER + O", hl.dsp.exec_raw("omarchy-hyprland-window-pop"), { description = "Pop window out (float & pin)" }) +hl.bind("SUPER + ALT + Home", hl.dsp.exec_raw("omarchy-hyprland-window-width save"), + { description = "Save window width" }) +hl.bind("SUPER + Home", hl.dsp.exec_raw("omarchy-hyprland-window-width restore"), + { description = "Restore window width" }) + +-- Volume, brightness, keyboard backlight, and touchpad controls. +hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_raw("omarchy-audio-output-volume raise"), + { locked = true, repeating = true, description = "Volume up" }) +hl.bind("XF86AudioLowerVolume", hl.dsp.exec_raw("omarchy-audio-output-volume lower"), + { locked = true, repeating = true, description = "Volume down" }) +hl.bind("XF86AudioMute", hl.dsp.exec_raw("omarchy-audio-output-volume mute-toggle"), + { locked = true, description = "Mute" }) +hl.bind("XF86AudioMicMute", hl.dsp.exec_raw("omarchy-audio-input-mute"), + { locked = true, description = "Mute microphone" }) +hl.bind("XF86MonBrightnessUp", hl.dsp.exec_raw("omarchy-brightness-display +5%"), + { locked = true, repeating = true, description = "Brightness up" }) +hl.bind("XF86MonBrightnessDown", hl.dsp.exec_raw("omarchy-brightness-display 5%-"), + { locked = true, repeating = true, description = "Brightness down" }) +hl.bind("SHIFT + XF86MonBrightnessUp", + hl.dsp.exec_raw("omarchy-brightness-display 100%"), + { locked = true, repeating = true, description = "Brightness maximum" }) +hl.bind("SHIFT + XF86MonBrightnessDown", + hl.dsp.exec_raw("omarchy-brightness-display 1%"), + { locked = true, repeating = true, description = "Brightness minimum" }) +hl.bind("XF86KbdBrightnessUp", hl.dsp.exec_raw("omarchy-brightness-keyboard up"), + { locked = true, repeating = true, description = "Keyboard brightness up" }) +hl.bind("XF86KbdBrightnessDown", hl.dsp.exec_raw("omarchy-brightness-keyboard down"), + { locked = true, repeating = true, description = "Keyboard brightness down" }) +hl.bind("XF86KbdLightOnOff", hl.dsp.exec_raw("omarchy-brightness-keyboard cycle"), + { locked = true, description = "Keyboard backlight cycle" }) +hl.bind("XF86TouchpadToggle", hl.dsp.exec_raw("omarchy-toggle-touchpad"), + { description = "Toggle touchpad", locked = true }) +hl.bind("XF86TouchpadOn", hl.dsp.exec_raw("omarchy-toggle-touchpad on"), + { locked = true, description = "Enable touchpad" }) +hl.bind("XF86TouchpadOff", hl.dsp.exec_raw("omarchy-toggle-touchpad off"), + { locked = true, description = "Disable touchpad" }) + +-- Precise volume and brightness controls. +hl.bind("ALT + XF86AudioRaiseVolume", + hl.dsp.exec_raw("omarchy-audio-output-volume +1"), + { locked = true, repeating = true, description = "Volume up precise" }) +hl.bind("ALT + XF86AudioLowerVolume", + hl.dsp.exec_raw("omarchy-audio-output-volume -1"), + { locked = true, repeating = true, description = "Volume down precise" }) +hl.bind("ALT + XF86MonBrightnessUp", + hl.dsp.exec_raw("omarchy-brightness-display +1%"), + { locked = true, repeating = true, description = "Brightness up precise" }) +hl.bind("ALT + XF86MonBrightnessDown", + hl.dsp.exec_raw("omarchy-brightness-display 1%-"), + { locked = true, repeating = true, description = "Brightness down precise" }) + +-- Media controls. +hl.bind("XF86AudioNext", hl.dsp.exec_raw("omarchy-shell media next"), { locked = true, description = "Next track" }) +hl.bind("ALT + XF86AudioPlay", hl.dsp.exec_raw("omarchy-shell media next"), { locked = true, description = "Next track" }) +hl.bind("XF86AudioPause", hl.dsp.exec_raw("omarchy-shell media playPause"), { locked = true, description = "Pause" }) +hl.bind("XF86AudioPlay", hl.dsp.exec_raw("omarchy-shell media playPause"), { locked = true, description = "Play" }) +hl.bind("XF86AudioPrev", hl.dsp.exec_raw("omarchy-shell media previous"), + { locked = true, description = "Previous track" }) +hl.bind("ALT + SHIFT + XF86AudioPlay", hl.dsp.exec_raw("omarchy-shell media previous"), + { locked = true, description = "Previous track" }) +hl.bind("XF86Eject", hl.dsp.exec_raw("eject"), { locked = true, description = "Eject media" }) + +hl.bind("SHIFT + XF86AudioMute", hl.dsp.exec_raw("omarchy-audio-output-switch"), + { locked = true, description = "Switch audio output" }) +hl.bind("SHIFT + XF86AudioPause", hl.dsp.exec_raw("omarchy-audio-source-switch"), + { locked = true, description = "Switch media source" }) +hl.bind("SHIFT + XF86AudioPlay", hl.dsp.exec_raw("omarchy-audio-source-switch"), + { locked = true, description = "Switch media source" }) + +hl.bind(sjb.HYPR .. "L", hl.dsp.exec_raw("omarchy-system-lock"), { description = "Lock system" }) diff --git a/desktop/config/hypr/sjb/utilities.lua b/desktop/config/hypr/sjb/utilities.lua new file mode 100644 index 0000000..cadbbc6 --- /dev/null +++ b/desktop/config/hypr/sjb/utilities.lua @@ -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" }) diff --git a/desktop/config/ostt/ostt.toml b/desktop/config/ostt/ostt.toml index 6ac5461..cdb3350 100644 --- a/desktop/config/ostt/ostt.toml +++ b/desktop/config/ostt/ostt.toml @@ -1,4 +1,4 @@ -config_version = "0.0.25" +config_version = "0.0.27" [transcription] provider = "whisper" @@ -21,7 +21,7 @@ x = 630 y = 790 [output.paste] -paste_key = "ctrl+shift+v" +#paste_key = "ctrl+shift+v" restore_clipboard = true restore_delay_ms = 750 post_popup_delay_ms = 1000 diff --git a/desktop/mise.toml b/desktop/mise.toml index 6693c4e..d2524e3 100644 --- a/desktop/mise.toml +++ b/desktop/mise.toml @@ -29,7 +29,6 @@ "~/.config/hypr/hyprlock.conf" = { source = "config/hypr/hyprlock.conf", mode = "symlink" } "~/.config/hypr/hyprpm.conf" = { source = "config/hypr/hyprpm.conf", mode = "symlink" } "~/.config/hypr/hyprland.lua/sjb" = { block = 'require("sjb.init")' } -"~/.config/hypr/hyprland.lua/extra" = { block = 'require("sjb.extra")' } "~/.config/kitty" = "config/kitty" "~/.config/rofi" = "config/rofi" @@ -68,6 +67,12 @@ run = [ 'fc-cache', ] +[tasks.omarchy] +run = [ + 'systemctl --user enable foot-server.service', + 'fc-cache', +] + [tasks.webapps] description = 'create all web application' run = [ @@ -88,5 +93,8 @@ run = [ 'sjb-webapp-installer "X" https://x.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/x.png', ] +[bootstrap.packages] +"pacman:gtksourceview5" = "latest" + [tasks.bootstrap] depends = ['desktop', 'webapps'] diff --git a/desktop/script/hyprland-keybindings b/desktop/script/hyprland-keybindings index 48f5fcc..cfca7ae 100755 --- a/desktop/script/hyprland-keybindings +++ b/desktop/script/hyprland-keybindings @@ -23,17 +23,18 @@ dynamic_bindings() { -e 's/^0,/,/' \ -e 's/^1,/SHIFT,/' \ -e 's/^4,/CTRL,/' \ - -e 's/^5,/SHIFT CTRL,/' \ + -e 's/^5,/SHIFT + CTRL,/' \ -e 's/^8,/ALT,/' \ - -e 's/^9,/SHIFT ALT,/' \ - -e 's/^12,/CTRL ALT,/' \ - -e 's/^13,/SHIFT CTRL ALT,/' \ + -e 's/^9,/SHIFT + ALT,/' \ + -e 's/^12,/CTRL + ALT,/' \ + -e 's/^13,/SHIFT + CTRL + ALT,/' \ -e 's/^64,/SUPER,/' \ - -e 's/^65,/SUPER SHIFT,/' \ - -e 's/^68,/SUPER CTRL,/' \ - -e 's/^69,/SUPER SHIFT CTRL,/' \ - -e 's/^72,/SUPER ALT,/' \ - -e 's/^73,/SUPER SHIFT ALT,/' \ + -e 's/^65,/SUPER + SHIFT,/' \ + -e 's/^68,/SUPER + CTRL,/' \ + -e 's/^69,/SUPER + SHIFT + CTRL,/' \ + -e 's/^72,/SUPER + ALT,/' \ + -e 's/^73,/SUPER + SHIFT + ALT,/' \ + -e 's/^76,/SUPER + CTRL + ALT,/' \ -e 's/^77,/HYPR,/' }