Skip to content

Commit

Permalink
adding rofi script to open hidden windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuxRoy committed Aug 4, 2024
1 parent 6b9680a commit 1f29bb3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions rofi-hidden-windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

applications=()
nodeids=()
for node in $(bspc query -N -n .hidden); do
classname=$(bspc query --node "$node" -T | jq -r '.client.className // ""')
if [[ -n "$classname" ]]; then
nodeids+=("$node")
applications+=("$classname [$node]")
fi
done

if [[ ${#applications[@]} -gt 0 ]]; then
selected=$(rofi -dmenu -i <<< "$(printf "%s\n" "${applications[@]}")")
else
notify-send "No hidden windows" -t 3000
exit 0
fi

if [[ -n "$selected" ]]; then
selectedid=$(echo "$selected" | awk -F '[\\[\\]]' '{print $2}')
bspc node $selectedid -g hidden=off
fi

0 comments on commit 1f29bb3

Please sign in to comment.