mirror of
https://git.aramjonghu.nl/AramJonghu/hypr.git
synced 2026-06-06 20:38:24 +02:00
23 lines
551 B
Bash
Executable File
23 lines
551 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
PANEL_CMD="hyprpanel"
|
|
PANEL_KILL="pkill .hyprpanel-wrap"
|
|
|
|
while true; do
|
|
ACTIVE_WS=$(hyprctl -j activeworkspace | jq '.id')
|
|
|
|
CLIENTS_ON_WS=$(hyprctl -j clients \
|
|
| jq "[.[] | select(.workspace.id == $ACTIVE_WS)] | length")
|
|
|
|
if [ "$CLIENTS_ON_WS" -gt 0 ]; then
|
|
# Workspace is NOT empty → kill panel
|
|
pgrep -f .hyprpanel-wrap >/dev/null && $PANEL_KILL
|
|
else
|
|
# Workspace is empty → launch panel
|
|
pgrep -f .hyprpanel-wrap >/dev/null || $PANEL_CMD &
|
|
fi
|
|
|
|
sleep 0.5
|
|
done
|
|
|