dot_testing/simplestatus/bspwm

21 lines
457 B
Bash
Executable File

#!/bin/sh
used_desk=$(bspc query -D -d .occupied --names | tr '\n' ' ')
current_desk=$(bspc query -D -d .focused --names)
final_string=""
current_printed=0
for i in $used_desk; do
[ "$i" = "$current_desk" ] && \
final_string=${final_string}"%{R}$i%{R} " && \
current_printed=1 || \
final_string=${final_string}"$i "
done
[ $current_printed -eq 0 ] &&
final_string=${final_string}"%{R}$current_desk%{R}"
printf "%s" "$final_string"
exit