diff options
| author | 2015-11-12 20:39:25 +0100 | |
|---|---|---|
| committer | 2015-11-12 20:39:25 +0100 | |
| commit | 52a40f15945c1a2d0283aba7be40945c6f472749 (patch) | |
| tree | 24ba70e33a16362a7e4db13ee37322aecdf4020b | |
| parent | bb2a5f02e4ead4bf3aad21380066b06c24182e36 (diff) | |
| download | dotfiles-52a40f15945c1a2d0283aba7be40945c6f472749.tar.gz dotfiles-52a40f15945c1a2d0283aba7be40945c6f472749.tar.bz2 dotfiles-52a40f15945c1a2d0283aba7be40945c6f472749.zip | |
Added mpc support to panel
| -rwxr-xr-x | herbstluftwm/.config/herbstluftwm/panel_indicators.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/herbstluftwm/.config/herbstluftwm/panel_indicators.sh b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh index 6686d14..2a3d2e6 100755 --- a/herbstluftwm/.config/herbstluftwm/panel_indicators.sh +++ b/herbstluftwm/.config/herbstluftwm/panel_indicators.sh | |||
| @@ -12,17 +12,22 @@ music() | |||
| 12 | # Music | 12 | # Music |
| 13 | mpd_status=$(mpc | sed -nr "s/^\[(.*)\].*$/\1/p") | 13 | mpd_status=$(mpc | sed -nr "s/^\[(.*)\].*$/\1/p") |
| 14 | if [ $mpd_status = "playing" ]; then | 14 | if [ $mpd_status = "playing" ]; then |
| 15 | player_title=$(mpc -f "%title%" current) | ||
| 16 | player_artist=$(mpc -f "%artist%" current) | 15 | player_artist=$(mpc -f "%artist%" current) |
| 16 | player_title=$(mpc -f "%title%" current) | ||
| 17 | if [ -n "$player_artist" ]; then | 17 | if [ -n "$player_artist" ]; then |
| 18 | playing="$player_title - $player_artist" | 18 | playing="$player_artist - $player_title" |
| 19 | else | 19 | else |
| 20 | playing="$player_title" | 20 | playing="$player_title" |
| 21 | fi | 21 | fi |
| 22 | elif [ $(playerctl status) = "Playing" ]; then | 22 | elif [ $(playerctl status) = "Playing" ]; then |
| 23 | player_artist=$(playerctl metadata artist) | 23 | player_artist=$(playerctl metadata artist) |
| 24 | player_title=$(playerctl metadata title) | 24 | player_title=$(playerctl metadata title) |
| 25 | playing="$player_title - $player_artist" | 25 | if [ -n "$player_artist" ] && [ -n "$player_title" ]; then |
| 26 | playing="$player_artist - $player_title" | ||
| 27 | else | ||
| 28 | now_playing=$(playerctl metadata vlc:nowplaying) | ||
| 29 | playing="$now_playing" | ||
| 30 | fi | ||
| 26 | else | 31 | else |
| 27 | playing="" | 32 | playing="" |
| 28 | fi | 33 | fi |
