Media Playing Module with Buttons

- Replace clicks and scroll actions with dedicated buttons
  for media playing module
- Add media-playing-change module to display current media
  source and left-click to change
- Add media-playing-prev/next to play previous or next
  track
- Add media-playing-play-pause to display pause button
  when media is playing and play button when media is
  paused
- Update media-playing to use Zscroll to scroll through
  artist and title text when over limit
- Add some extra helper scripts
This commit is contained in:
Sravan Balaji
2022-07-31 17:30:50 -04:00
parent 6e15a7f4ea
commit 60a43475a9
8 changed files with 253 additions and 112 deletions

View File

@@ -255,7 +255,7 @@ font-5 = "IPAPGothic:size=11;3"
; modules-left = cpu ram
; modules-center = xwindow xbacklight
; modules-right = ipc clock
modules-left = powermenu-left powermenu powermenu-right dwm media-playing-left media-playing media-playing-right
modules-left = powermenu-left powermenu powermenu-right dwm media-playing-left media-playing-change media-playing-prev media-playing-play-pause media-playing-next media-playing media-playing-right
; modules-center =
modules-right = kernel-left kernel kernel-right cpu-left cpu cpu-right memory-left memory memory-right filesystem-left filesystem filesystem-right date-left date date-right time-left time time-right deadd-notification-center-left deadd-notification-center deadd-notification-center-right
@@ -522,63 +522,70 @@ content-padding = ${sizes.module-padding}
[module/media-playing]
type = custom/script
; Available tokens:
; %counter%
; Command to be executed (using "/bin/sh -c [command]")
exec = ~/.config/dwm-flexipatch/polybar/scripts/get-media-playing.sh
; Conditional command that, if defined, needs to exit successfully
; before the main exec command is invoked.
; Default: ""
; exec-if = pgrep -x myservice
; Will the script output continous content?
; Default: false
tail = false
; Seconds to sleep between updates
; Default: 5 (0 if `tail = true`)
exec = ~/.config/dwm-flexipatch/polybar/scripts/scroll-media-playing.sh
tail = true
interval = ${intervals.media-playing}
; Available tags:
; <output> - deprecated
; <label> (default)
format = <label>
; format-padding = ${sizes.module-padding}
; format-background = ${colors.background}
; format-foreground =
; Available tokens:
; %output%
; Default: %output%
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = ${sizes.module-padding}
label-padding = 1
; Available tokens:
; %counter%
; %pid%
;
; "click-(left|middle|right)" will be executed using "/bin/sh -c [command]"
[module/media-playing-change]
type = custom/script
exec = /home/sravan/.config/dwm-flexipatch/polybar/scripts/get-media-source-icon.sh
interval = ${intervals.media-playing}
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --change"
[module/media-playing-prev]
type = custom/script
exec = echo "玲"
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --prev"
[module/media-playing-play-pause]
type = custom/script
exec = /home/sravan/.config/dwm-flexipatch/polybar/scripts/get-media-status-icon.sh
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --play-pause"
; click-middle = echo middle %counter%
click-right = "/home/sravan/.scripts/playerctl.sh --rofi"
double-click-left = "/home/sravan/.scripts/playerctl.sh --change"
; double-click-middle = echo double middle %counter%
; double-click-right = echo double right %counter%
; Available tokens:
; %counter%
; %pid%
;
; "scroll-(up|down)" will be executed using "/bin/sh -c [command]"
scroll-up = "/home/sravan/.scripts/playerctl.sh --next"
scroll-down = "/home/sravan/.scripts/playerctl.sh --prev"
[module/media-playing-next]
type = custom/script
exec = echo "怜"
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --next"
[module/date-left]
type = custom/text