improve: uniquely identify terminal apps for window rules and focus. Unify waybar behaviour to use launch-or-focus (#3389)

* improve: uniquely identify btop when launched from waybar.

* align btop app id

* add migration to uniquely identify btop

* also add unique app ids to lazydocker and terminal editor

* introduce new omarchy-launch-tui that sets class.

* align all the tuis and behaviour in waybar

* update migration accordingly

* fixes

* separate terminal from tui

* fix: double setsid uswm-app --

* Standardize namespace on org.omarchy and lowercase

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
This commit is contained in:
Patrick Roza
2025-11-19 08:54:17 +01:00
committed by GitHub
parent 438fa96291
commit eec075bdf9
13 changed files with 30 additions and 19 deletions

View File

@@ -1,13 +1,13 @@
#!/bin/bash
screensaver_in_focus() {
hyprctl activewindow -j | jq -e '.class == "com.omarchy.Screensaver"' >/dev/null 2>&1
hyprctl activewindow -j | jq -e '.class == "org.omarchy.screensaver"' >/dev/null 2>&1
}
exit_screensaver() {
hyprctl keyword cursor:invisible false
pkill -x tte 2>/dev/null
pkill -f com.omarchy.Screensaver 2>/dev/null
pkill -f org.omarchy.screensaver 2>/dev/null
exit 0
}

View File

@@ -1,3 +1,3 @@
#!/bin/bash
exec setsid uwsm-app -- xdg-terminal-exec --app-id=com.omarchy.Omarchy -e bash -c 'fastfetch; read -n 1 -s'
exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.terminal -e bash -c 'fastfetch; read -n 1 -s'

View File

@@ -4,7 +4,7 @@ omarchy-cmd-present "$EDITOR" || EDITOR=nvim
case "$EDITOR" in
nvim | vim | nano | micro | hx | helix)
exec setsid uwsm-app -- xdg-terminal-exec "$EDITOR" "$@"
exec omarchy-launch-tui "$EDITOR" "$@"
;;
*)
exec setsid uwsm-app -- "$EDITOR" "$@"

View File

@@ -1,4 +1,4 @@
#!/bin/bash
cmd="$*"
exec setsid uwsm-app -- xdg-terminal-exec --app-id=com.omarchy.Omarchy --title=Omarchy -e bash -c "omarchy-show-logo; $cmd; omarchy-show-done"
exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.terminal --title=Omarchy -e bash -c "omarchy-show-logo; $cmd; omarchy-show-done"

View File

@@ -6,7 +6,7 @@ if ! command -v tte &>/dev/null; then
fi
# Exit early if screensave is already running
pgrep -f com.omarchy.Screensaver && exit 0
pgrep -f org.omarchy.screensaver && exit 0
# Allow screensaver to be turned off but also force started
if [[ -f ~/.local/state/omarchy/toggles/screensaver-off ]] && [[ $1 != "force" ]]; then
@@ -22,19 +22,19 @@ for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
case $terminal in
*Alacritty*)
hyprctl dispatch exec -- \
alacritty --class=com.omarchy.Screensaver \
alacritty --class=org.omarchy.screensaver \
--config-file ~/.local/share/omarchy/default/alacritty/screensaver.toml \
-e omarchy-cmd-screensaver
;;
*ghostty*)
hyprctl dispatch exec -- \
ghostty --class=com.omarchy.Screensaver \
ghostty --class=org.omarchy.screensaver \
--font-size=18 \
-e omarchy-cmd-screensaver
;;
*kitty*)
hyprctl dispatch exec -- \
kitty --class=com.omarchy.Screensaver \
kitty --class=org.omarchy.screensaver \
--override font_size=18 \
-e omarchy-cmd-screensaver
;;

3
bin/omarchy-launch-tui Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.$(basename $1) -e "$1" "${@:2}"

View File

@@ -1,3 +1,3 @@
#!/bin/bash
exec setsid omarchy-launch-or-focus com.omarchy.Impala "uwsm-app -- xdg-terminal-exec --app-id=com.omarchy.Impala -e impala"
exec setsid omarchy-launch-or-focus org.omarchy.impala "omarchy-launch-tui impala"

View File

@@ -9,4 +9,4 @@ if pgrep -x "1password" >/dev/null; then
fi
# Avoid running screensaver when locked
pkill -f com.omarchy.Screensaver
pkill -f org.omarchy.screensaver

View File

@@ -37,7 +37,7 @@ menu() {
}
terminal() {
xdg-terminal-exec --app-id=com.omarchy.Omarchy "$@"
xdg-terminal-exec --app-id=org.omarchy.terminal "$@"
}
present_terminal() {
@@ -173,7 +173,7 @@ show_setup_menu() {
options="$options\n Defaults\n󰱔 DNS\n Security\n Config"
case $(menu "Setup" "$options") in
*Audio*) xdg-terminal-exec --app-id=com.omarchy.Wiremix -e wiremix ;;
*Audio*) omarchy-launch-or-focus org.omarchy.wiremix "omarchy-launch-tui wiremix" ;;
*Wifi*)
rfkill unblock wifi
omarchy-launch-wifi