Make bitbar chunkwm script a bit less fragile
This commit is contained in:
parent
98be7e5531
commit
a7b26b45ab
@ -10,12 +10,21 @@ current_desktop=$(chunkc tiling::query --desktop id)
|
||||
last_desktop=$(chunkc get _last_active_desktop)
|
||||
monitor=$(chunkc tiling::query --monitor-for-desktop $current_desktop)
|
||||
desktops=$(chunkc tiling::query --desktops-for-monitor $monitor)
|
||||
highlighed=$(awk '{
|
||||
gsub("'${current_desktop}'", "'${TEAL}${current_desktop}${NC}'");
|
||||
gsub("'${last_desktop}'", "'${RED}${last_desktop}${NC}'");
|
||||
print; }' <<< $desktops)
|
||||
highlighted=""
|
||||
for desktop in $desktops
|
||||
do
|
||||
if (( $desktop == $current_desktop ))
|
||||
then
|
||||
highlighted+=" ${TEAL}$desktop${NC}"
|
||||
elif (( $desktop == $last_desktop ))
|
||||
then
|
||||
highlighted+=" ${RED}$desktop${NC}"
|
||||
else
|
||||
highlighted+=" $desktop"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ${highlighed}
|
||||
echo -e ${highlighted}
|
||||
echo "---"
|
||||
for i in ~/.chunkwm_layouts/*
|
||||
do
|
||||
|
Loading…
Reference in New Issue
Block a user