1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-22 23:08:01 +00:00

[polybar] Improve loop code at task_manager

This commit is contained in:
Daniel Carrillo 2020-04-07 18:29:53 +02:00
parent 07f564f956
commit 953c14a5b0

View File

@ -68,17 +68,15 @@ show_tasks()
mv $STATUS_FILE.current $STATUS_FILE mv $STATUS_FILE.current $STATUS_FILE
counter=1
num_windows=$(wc -l $STATUS_FILE | cut -f 1 -d " ") num_windows=$(wc -l $STATUS_FILE | cut -f 1 -d " ")
while [ $counter -le "$max_tasks" ]; do for counter in $(seq 1 "$max_tasks"); do
if [ $counter -le "$num_windows" ]; then if [ "$counter" -le "$num_windows" ]; then
polybar-msg hook taskbar$counter 2 > /dev/null polybar-msg hook taskbar"$counter" 2 > /dev/null
else else
polybar-msg hook taskbar"$counter" 1 > /dev/null polybar-msg hook taskbar"$counter" 1 > /dev/null
fi fi
sleep 0.1 sleep 0.1
counter=$((counter+1))
done done
} }