Anachron / i3blocks

Additional/custom blocks which fit my needs
GNU General Public License v3.0
585 stars 106 forks source link

playerctl: fix block when process is not running #44

Closed vKnmnn closed 4 years ago

vKnmnn commented 7 years ago

Hi there. The blocklet playerctl leaves (null) - (null) when spotify is not started and BLOCK_INSTANCE is set to spotify, i think it should disappear, when spotify is not running.

i tried fixing it by adding

ps -e | grep "${INSTANCE}" &> /dev/null
fi
if [ $? == 1 ]; then 
    exit 0

right after line 7, so the block disappears when spotify is stopped. not tested with other instances