From 8bb6d35acd56425386be801d9320efec603e1a5d Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Fri, 3 Oct 2025 09:58:05 -0400 Subject: [PATCH] feat: Moves launch or focus script and makes it so that it can also close a window based on pattern. Updates keybinds that use it. --- env/.config/hypr/keybinds.conf | 13 +++---- env/.local/scripts/launch-or | 61 ++++++++++++++++++++++++++++++ env/.local/scripts/launch-or-focus | 28 -------------- env/.local/scripts/window-table | 5 ++- env/.zshenv | 2 +- 5 files changed, 71 insertions(+), 38 deletions(-) create mode 100755 env/.local/scripts/launch-or delete mode 100755 env/.local/scripts/launch-or-focus diff --git a/env/.config/hypr/keybinds.conf b/env/.config/hypr/keybinds.conf index ea0bc92..5a9d47f 100644 --- a/env/.config/hypr/keybinds.conf +++ b/env/.config/hypr/keybinds.conf @@ -4,8 +4,7 @@ # See https://wiki.hyprland.org/Configuring/Keywords/ $mainMod = SUPER # "Command/Windows" key as main modifier -# TODO: Use 'ALT' as window mod, need to change some tmux keybinds to do so. -$windowMod = ALT # Control + Option for window controls. +$windowMod = ALT # Option for window controls. $HYPER = ALT SHIFT SUPER CTRL # See https://wiki.hyprland.org/Configuring/Keywords/ @@ -18,7 +17,7 @@ $menu = uwsm app -- walker $scripts = ~/.local/scripts $pwa = $scripts/launch-webapp $tmuxSessionator = $scripts/tmux-sessionator -$clipboardHistory = $terminal --class=com.ghostty.clipse -e clipse +$clipboardHistory = com.ghostty.clipse $terminal --class=com.ghostty.clipse -e clipse $uninstallDesktop = $terminal --class=com.ghostty.float -e $scripts/uninstall-desktop-app $housecallPro = https://pro.housecallpro.com/app/calendar_new @@ -36,8 +35,8 @@ bindd = $mainMod, SPACE, Application launcher, exec, bindd = $mainMod, RETURN, New terminal, exec, $terminal bindd = $mainMod SHIFT, RETURN, New floating terminal, exec, $terminal --class=com.ghostty.float bindd = $mainMod, TAB, Focus previous workspace, workspace, previous -bindd = $mainMod, A, Chat-gpt [a]i - launch / focus, exec, $pwa --focus "https://chatgpt.com" -bindd = $mainMod SHIFT, A, Chat-gpt [a]i - new window, exec, $pwa "https://chatgpt.com" +bindd = $mainMod, A, [A]i - launch / focus, exec, $pwa --focus "https://chatgpt.com" +bindd = $mainMod SHIFT, A, [A]i - new window, exec, $pwa "https://chatgpt.com" bindd = $mainMod, B, New [b]rowser, exec, $browser bindd = $mainMod SHIFT, B, New private [b]rowser, exec, $browser --private-window bindd = $mainMod, C, [C]alendar, exec, $pwa --focus "https://www.icloud.com/calendar" @@ -45,7 +44,7 @@ bindd = $mainMod SHIFT, C, [C]onfig folder in tmux session, exec, bindd = $mainMod, D, [D]ispatch app - special workspace, exec, $pwa --special dispatch $housecallPro bindd = $mainMod SHIFT, D, [D]ispatch app - new window, exec, $pwa $housecallPro bindd = $mainMod, E, [E]mail - personal, exec, $pwa --focus "https://mail.proton.me" -bindd = $mainMod SHIFT, E, [E]mail - work, exec, $scripts/launch-or-focus thunderbird uwsm app -- thunderbird +bindd = $mainMod SHIFT, E, [E]mail - work, exec, $scripts/launch-or --focus thunderbird uwsm app -- thunderbird bindd = $mainMod, F, [F]ile manager - terminal, exec, $fileManager bindd = $mainMod SHIFT, F, [F]ile manager - application, exec, $fileBrowser bindd = $mainMod, G, [G]itea, exec, $pwa "https://git.housh.dev" @@ -64,7 +63,7 @@ bindd = $mainMod, S, Toggle [s]pecial workspace, toggle bindd = $mainMod, Y, [Y]ouTube, exec, $pwa --focus "https://youtube.com" bindd = $mainMod, U, [U]nifi, exec, $pwa "https://unifi.ui.com" bindd = $mainMod SHIFT, U, [U]ninstall desktop app, exec, $uninstallDesktop -bindd = $mainMod, V, Clipboard history, exec, $clipboardHistory +bindd = $mainMod, V, Clipboard history, exec, $scripts/launch-or --close $clipboardHistory bindd = $mainMod, W, Close current window, killactive, bindd = $mainMod SHIFT, W, Close all windows in active workspace, exec, $scripts/close-windows --active-workspace diff --git a/env/.local/scripts/launch-or b/env/.local/scripts/launch-or new file mode 100755 index 0000000..4079fdb --- /dev/null +++ b/env/.local/scripts/launch-or @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +usage() { + cat <