Dark minimalist setup for a sysadmin workstation: rounded blur windows with the DMS pink accent, keyboard-driven SSH hub (Mod+S), run-or-raise app binds, Alt+Tab window switching, OCR of screen regions, hotkey cheatsheet, DMS network-editor plugin and the systemd session target for portals. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
20 lines
944 B
Bash
Executable File
20 lines
944 B
Bash
Executable File
#!/bin/bash
|
|
# raise.sh <class-regex> <command...>
|
|
# Focus the app if it already has a window (also switches workspace/monitor). Pressing again while
|
|
# it is focused cycles through its other windows. If it is not running, launch <command>.
|
|
# RAISE_DRY=1 only prints what would happen.
|
|
re=$1; shift
|
|
act=$(hyprctl activewindow -j 2>/dev/null | jq -r '.address // ""')
|
|
target=$(hyprctl clients -j | jq -r --arg re "$re" --arg act "$act" '
|
|
[.[] | select(.class | test($re)) | select(.workspace.name | startswith("special") | not)]
|
|
| sort_by(.focusHistoryID) as $w
|
|
| if ($w | length) == 0 then ""
|
|
elif $w[0].address == $act and ($w | length) > 1 then $w[1].address
|
|
else $w[0].address end')
|
|
if [ -z "$target" ]; then
|
|
[ -n "$RAISE_DRY" ] && { echo "launch: $*"; exit 0; }
|
|
exec "$@"
|
|
fi
|
|
[ -n "$RAISE_DRY" ] && { echo "focus: $target"; exit 0; }
|
|
hyprctl dispatch "hl.dsp.focus({ window = \"address:$target\" })" >/dev/null
|