btw i use nix
1#!/usr/bin/env bash
2
3stat=`playerctl status 2> /dev/null`
4if [ $? -ne 0 ]; then exit 0; fi
5title=`playerctl metadata title 2> /dev/null`
6if [ $? -ne 0 ]; then exit 0; fi
7artist=`playerctl metadata artist 2> /dev/null`
8if [ $? -ne 0 ]; then exit 0; fi
9
10if [ "$stat" == "Playing" ]; then
11 stat=""
12elif [ "$stat" == "Paused" ]; then
13 stat=""
14fi
15
16echo "$stat $title | $artist"
17