mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-04-30 05:28:36 +00:00
Sort workspaces in lemonbar
This commit is contained in:
parent
a292d3e460
commit
0d7a671db3
1 changed files with 8 additions and 3 deletions
|
@ -31,7 +31,7 @@ exec 5>"$PANEL_FIFO"
|
||||||
main() {
|
main() {
|
||||||
REPORT="$1"
|
REPORT="$1"
|
||||||
|
|
||||||
local -a desktops
|
local -A desktops
|
||||||
local prefix suffix name
|
local prefix suffix name
|
||||||
|
|
||||||
for item in ${(s.:.)REPORT}; do
|
for item in ${(s.:.)REPORT}; do
|
||||||
|
@ -71,9 +71,14 @@ main() {
|
||||||
desktops[$name]="${prefix}${MAP[$name]}${suffix}"
|
desktops[$name]="${prefix}${MAP[$name]}${suffix}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Collect workspaces into OUTPUT array, but add them in a sorted order
|
||||||
|
# This is done due to weird behavior bspwm has with workspaces on multiple
|
||||||
|
# monitors, which I'm fixing with my swapdesktop script, which however
|
||||||
|
# doesn't order the workspaces afterwards, so we do that here.
|
||||||
OUTPUT=()
|
OUTPUT=()
|
||||||
for wstxt in $desktops; do
|
for wsname in $(echo ${(k)desktops} | xargs -n1 | sort -g | xargs); do
|
||||||
OUTPUT+=("$wstxt" "$WS_SEPARATOR")
|
wstext="${desktops[$wsname]}"
|
||||||
|
OUTPUT+=("$wstext" "$WS_SEPARATOR")
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue