Super hacky shell wrapper around lemonbar that aims to poll as little as possible, minimising bar updates to the screen and reduce resource usage.
git clone https://mcol.xyz/code/lemontools
Log | Files | Refs | README | LICENSE

commit c566ea901188c82eb781f8420c9f8f6baaa15b35
parent 5c1931c4b90a84c0a8fcdf82d7b5dd163468abb0
Author: mcol <mcol@posteo.net>
Date:   Sun, 17 Feb 2019 13:08:54 +0000

added mpc_play module for mpc control icon

Diffstat:
Amodules/mpc_play | 40++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+), 0 deletions(-)

diff --git a/modules/mpc_play b/modules/mpc_play @@ -0,0 +1,40 @@ +#---------------------------------------------------------------------------------- +# mpc/mpd module +#---------------------------------------------------------------------------------- + +# This module displays a pause/play icon to control mpd playback +# +# Settings: +# $mpc_play_format_playing : format string when music is playing +# $mpc_play_format_paused : format string when music is paused +# see defaults below + + +update_mpc_play() { + local output= + + if mpc status | grep -q '\[paused\]' + then + output=$(eval echo $mpc_play_format_paused) + else + output=$(eval echo $mpc_play_format_playing) + fi + + output=${mpc_play_pre}$output${mpc_play_post} + send "mpc_play='$output'" +} + + +_mpc_play() { + get_clicks mpc_play + + [[ -z "$mpc_play_format_playing" ]] && + mpc_play_format_playing='${pad}${pad}' + [[ -z "$mpc_play_format_paused" ]] && + mpc_play_format_paused='${pad}${pad}' + + update_mpc_play & +} + + +# vim: ft=sh