Krolyxon
Commit 91b55cc

Branches

Refs →

dotfiles-x11.localbinstatusbarsb-music

11 lines · 271 B · Bourne Again Shell (bash)

1#!/bin/sh
2
3filter() { mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;}
4
5pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 &
6
7if [ -z "$(filter)" ]; then
8 echo ""
9else
10 echo "[ $(filter) ]"
11fi