summaryrefslogtreecommitdiff
path: root/polybar
diff options
context:
space:
mode:
authorShubham Saini <shubham6405@gmail.com>2020-03-20 09:06:50 +0000
committerShubham Saini <shubham6405@gmail.com>2020-03-20 09:06:50 +0000
commitf0007b61952d1bea99a4c68920c0d0ba6f7f0cd7 (patch)
tree3cc1ea69e0447ae71566dc9cf658640654f13194 /polybar
parentd379b850ba86ca759f1cd2343bf3bd8c24c11245 (diff)
added ncmpcpp
Diffstat (limited to 'polybar')
-rwxr-xr-xpolybar/.config/polybar/cmus.sh20
-rw-r--r--polybar/.config/polybar/config37
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
3prepend_zero () {
4 seq -f "%02g" $1 $1
5}
6
7artist=$(echo -n $(cmus-remote -C status | grep "tag artist" | cut -c 12-))
8
9if [[ $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]"
18else
19 echo
20fi
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
35font-1 = FontAwesome:style=Regular:size=10;1 35font-1 = FontAwesome:style=Regular:size=10;1
36modules-left = pulseaudio battery date time bspwm 36modules-left = pulseaudio battery date time bspwm
37modules-center = 37modules-center =
38modules-right = spotify cmus xwindow 38modules-right = spotify mpd
39tray-position = right 39tray-position = right
40cursor-click = pointer 40cursor-click = pointer
41cursor-scroll = ns-resize 41cursor-scroll = ns-resize
@@ -152,26 +152,26 @@ format = <label>
152format-foreground = #7b8c58 152format-foreground = #7b8c58
153exec = python ~/.config/polybar/spotify.py -f '{artist}: {song}' 153exec = python ~/.config/polybar/spotify.py -f '{artist}: {song}'
154 154
155[module/cmus] 155;[module/cmus]
156type = custom/script 156;type = custom/script
157exec = ~/.config/polybar/cmus.sh 157;exec = ~/.config/polybar/cmus.sh
158exec-if = pgrep -x cmus 158;exec-if = pgrep -x cmus
159interval = 1 159;interval = 1
160click-left = cmus-remote --next 160;click-left = cmus-remote --next
161click-right = cmus-remote --prev 161;click-right = cmus-remote --prev
162click-middle = cmus-remote --pause 162;click-middle = cmus-remote --pause
163scroll-up = cmus-remote --volume +5% 163;scroll-up = cmus-remote --volume +5%
164scroll-down = cmus-remote --volume -5% 164;scroll-down = cmus-remote --volume -5%
165format = <label> 165;format = <label>
166format-prefix = " " 166;format-prefix = " "
167format-foreground = #7b8c58 167;format-foreground = #7b8c58
168label = %output% 168;label = %output%
169label-maxlen = 50 169;label-maxlen = 50
170 170
171[module/mpd] 171[module/mpd]
172type = internal/mpd 172type = internal/mpd
173label-offline = mpd is offline 173label-offline = mpd is offline
174format-online = <label-song> <icon-prev> <toggle> <icon-next> 174format-online = <label-song> <icon-prev> <toggle> <icon-next>
175format-offline = <label-offline> 175format-offline = <label-offline>
176host = 127.0.0.1 176host = 127.0.0.1
177port = 6600 177port = 6600
@@ -180,8 +180,9 @@ icon-stop = 
180icon-play =  180icon-play = 
181icon-pause =  181icon-pause = 
182icon-next =  182icon-next = 
183label-song-maxlen = 25 183label-song-maxlen = 40
184label-song-ellipsis = true 184label-song-ellipsis = true
185label-song-foreground = #7b8c58
185bar-progress-width = 10 186bar-progress-width = 10
186bar-progress-indicator = | 187bar-progress-indicator = |
187bar-progress-fill = ─ 188bar-progress-fill = ─