Extract notification window focus helper

This commit is contained in:
David Heinemeier Hansson
2026-05-21 11:44:11 +02:00
parent d132e0ec61
commit e5b585d6b3
2 changed files with 29 additions and 10 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# omarchy:summary=Focus a Hyprland window by application class
# omarchy:args=<app-name>
# omarchy:examples=omarchy hyprland focus app Slack
usage() {
echo "Usage: omarchy-hyprland-focus-app <app-name>" >&2
exit 1
}
app=${1:-}
[[ -n $app ]] || usage
address=$(
hyprctl clients -j 2>/dev/null |
jq -r --arg name "${app,,}" \
'[.[] | select((.class // "") | ascii_downcase | startswith($name))] | first.address // empty'
)
[[ -n $address ]] || exit 1
hyprctl dispatch focuswindow "address:$address" >/dev/null