chs: re-add drifted files

This commit is contained in:
Prad Nukala committed 2026-08-14 15:01:38 -04:00
1 parent 10fb7dfffc
commit b6b0f19dde
5 files changed
+18 -10

No files matched your search

+8 -3
View File
@@ -11,8 +11,10 @@ declare -A KITTY_CMDS=(
# Handle webapp cycling and launching
if [[ "$APP" == "webapp" ]]; then
# Cycle through all WebApps
INSTANCES=($(niri msg -j windows | jq -r '.[] | select(.app_id | startswith("WebApp-")) | .id'))
# Cycle all WebApps: Firefox SSAs (WebApp-*) and Chromium/Brave SSAs (chrome-*-Default).
# Falls back to launching YouTube if none are open. Excludes real browsers (chromium/brave-*).
INSTANCES=($(niri msg -j windows | jq -r '.[] | select((.app_id // "") | ascii_downcase | test("^(webapp-|chrome-)")) | .id'))
FALLBACK_APP="webapp-youtube"
elif [[ "$APP" == webapp-* ]]; then
# Extract the webapp name (e.g., "webapp-claude" -> "Claude")
WEBAPP_NAME=$(echo "$APP" | sed 's/webapp-//' | sed 's/.*/\u&/')
@@ -21,7 +23,7 @@ elif [[ "$APP" == webapp-* ]]; then
if [ -z "$APP_ID" ]; then
# No instance running, launch via gtk-launch
DESKTOP_FILE=$(find ~/.local/share/applications -name "WebApp-${WEBAPP_NAME}*.desktop" -print -quit 2>/dev/null)
DESKTOP_FILE=$(find ~/.local/share/applications -iname "WebApp-${WEBAPP_NAME}*.desktop" -print -quit 2>/dev/null)
if [ -n "$DESKTOP_FILE" ]; then
gtk-launch "$(basename "$DESKTOP_FILE")"
else
@@ -73,6 +75,9 @@ if [ ${#INSTANCES[@]} -eq 0 ]; then
niri msg action spawn -- $DEFAULT_SPAWN
exit 0
fi
if [ -n "${FALLBACK_APP:-}" ]; then
exec "$0" "$FALLBACK_APP"
fi
# Removed "kitty" from this block so it falls through to the spawn command
if [[ "$APP" == "webapp" || "$APP" == "ghostty" ]]; then
echo "No ${APP} windows running"
@@ -0,0 +1,3 @@
#!/bin/bash
# Cycle through all open WebApps; launch YouTube if none are open.
exec "$(dirname "$(readlink -f "$0")")/niri-launch" webapp