Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # lemonbar dock script
- dock() { # print list of icons
- message=$(i3-msg -t get_workspaces)
- len=$(echo $message | jq '.[].num' | wc -l)
- len=$((len - 1))
- output=""
- for i in {0..$len} ; do
- num=$(echo $message | jq ".[$i].num")
- if [[ $num -eq 1 ]] ; then
- ico="ONE"
- elif [[ $num -eq 2 ]] ; then
- ico="TWO"
- elif [[ $num -eq 3 ]] ; then
- ico="THREE"
- elif [[ $num -eq 4 ]] ; then
- ico="FOUR"
- elif [[ $num -eq 5 ]] ; then
- ico="FIVE"
- elif [[ $num -eq 6 ]] ; then
- ico="SIX"
- elif [[ $num -eq 7 ]] ; then
- ico="SEVEN"
- elif [[ $num -eq 8 ]] ; then
- ico="EIGHT"
- elif [[ $num -eq 9 ]] ; then
- ico="NINE"
- elif [[ $num -eq 10 ]] ; then
- ico="TEN"
- fi
- if [ $(echo $message | jq ".[$i].focused") = "true" ] ; then
- output="$output%{F#4F99D3} $ico "
- else
- output="$output%{F#545A60} $ico "
- fi
- if [ $i -lt $len ] ; then
- output="$output%{O5}"
- fi
- done
- echo $output
- }
- echo "%{c}$(dock)" >> ~/.scripts/lemonbar/dockcontents
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement