diff options
Diffstat (limited to 'polybar')
| -rwxr-xr-x | polybar/.config/polybar/cmus.sh | 20 | ||||
| -rw-r--r-- | polybar/.config/polybar/config | 37 |
2 files changed, 19 insertions, 38 deletions
diff --git a/polybar/.config/polybar/cmus.sh b/polybar/.config/polybar/cmus.sh deleted file mode 100755 index 7917d4c..0000000 --- a/polybar/.config/polybar/cmus.sh +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | prepend_zero () { | ||
| 4 | seq -f "%02g" $1 $1 | ||
| 5 | } | ||
| 6 | |||
| 7 | artist=$(echo -n $(cmus-remote -C status | grep "tag artist" | cut -c 12-)) | ||
| 8 | |||
| 9 | if [[ $artist = *[!\ ]* ]]; then | ||
| 10 | song=$(echo -n $(cmus-remote -C status | grep title | cut -c 11-)) | ||
| 11 | position=$(cmus-remote -C status | grep position | cut -c 10-) | ||
| 12 | minutes1=$(prepend_zero $(($position / 60))) | ||
| 13 | seconds1=$(prepend_zero $(($position % 60))) | ||
| 14 | duration=$(cmus-remote -C status | grep duration | cut -c 10-) | ||
| 15 | minutes2=$(prepend_zero $(($duration / 60))) | ||
| 16 | seconds2=$(prepend_zero $(($duration % 60))) | ||
| 17 | echo -n "$artist - $song [$minutes1:$seconds1/$minutes2:$seconds2]" | ||
| 18 | else | ||
| 19 | echo | ||
| 20 | fi | ||
diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index 8f9701d..8260bc9 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config | |||
| @@ -35,7 +35,7 @@ font-0 = Hermit:style=medium:pixelsize=10;1 | |||
| 35 | font-1 = FontAwesome:style=Regular:size=10;1 | 35 | font-1 = FontAwesome:style=Regular:size=10;1 |
| 36 | modules-left = pulseaudio battery date time bspwm | 36 | modules-left = pulseaudio battery date time bspwm |
| 37 | modules-center = | 37 | modules-center = |
| 38 | modules-right = spotify cmus xwindow | 38 | modules-right = spotify mpd |
| 39 | tray-position = right | 39 | tray-position = right |
| 40 | cursor-click = pointer | 40 | cursor-click = pointer |
| 41 | cursor-scroll = ns-resize | 41 | cursor-scroll = ns-resize |
| @@ -152,26 +152,26 @@ format = <label> | |||
| 152 | format-foreground = #7b8c58 | 152 | format-foreground = #7b8c58 |
| 153 | exec = python ~/.config/polybar/spotify.py -f '{artist}: {song}' | 153 | exec = python ~/.config/polybar/spotify.py -f '{artist}: {song}' |
| 154 | 154 | ||
| 155 | [module/cmus] | 155 | ;[module/cmus] |
| 156 | type = custom/script | 156 | ;type = custom/script |
| 157 | exec = ~/.config/polybar/cmus.sh | 157 | ;exec = ~/.config/polybar/cmus.sh |
| 158 | exec-if = pgrep -x cmus | 158 | ;exec-if = pgrep -x cmus |
| 159 | interval = 1 | 159 | ;interval = 1 |
| 160 | click-left = cmus-remote --next | 160 | ;click-left = cmus-remote --next |
| 161 | click-right = cmus-remote --prev | 161 | ;click-right = cmus-remote --prev |
| 162 | click-middle = cmus-remote --pause | 162 | ;click-middle = cmus-remote --pause |
| 163 | scroll-up = cmus-remote --volume +5% | 163 | ;scroll-up = cmus-remote --volume +5% |
| 164 | scroll-down = cmus-remote --volume -5% | 164 | ;scroll-down = cmus-remote --volume -5% |
| 165 | format = <label> | 165 | ;format = <label> |
| 166 | format-prefix = " " | 166 | ;format-prefix = " " |
| 167 | format-foreground = #7b8c58 | 167 | ;format-foreground = #7b8c58 |
| 168 | label = %output% | 168 | ;label = %output% |
| 169 | label-maxlen = 50 | 169 | ;label-maxlen = 50 |
| 170 | 170 | ||
| 171 | [module/mpd] | 171 | [module/mpd] |
| 172 | type = internal/mpd | 172 | type = internal/mpd |
| 173 | label-offline = mpd is offline | 173 | label-offline = mpd is offline |
| 174 | format-online = <label-song> <icon-prev> <toggle> <icon-next> | 174 | format-online = <label-song> <icon-prev> <toggle> <icon-next> |
| 175 | format-offline = <label-offline> | 175 | format-offline = <label-offline> |
| 176 | host = 127.0.0.1 | 176 | host = 127.0.0.1 |
| 177 | port = 6600 | 177 | port = 6600 |
| @@ -180,8 +180,9 @@ icon-stop = | |||
| 180 | icon-play = | 180 | icon-play = |
| 181 | icon-pause = | 181 | icon-pause = |
| 182 | icon-next = | 182 | icon-next = |
| 183 | label-song-maxlen = 25 | 183 | label-song-maxlen = 40 |
| 184 | label-song-ellipsis = true | 184 | label-song-ellipsis = true |
| 185 | label-song-foreground = #7b8c58 | ||
| 185 | bar-progress-width = 10 | 186 | bar-progress-width = 10 |
| 186 | bar-progress-indicator = | | 187 | bar-progress-indicator = | |
| 187 | bar-progress-fill = ─ | 188 | bar-progress-fill = ─ |
