Closed ghost closed 5 years ago
Yes, the interval
should be short enough. If moc is paused you should only do something like echo ""
. So you module is empty.
What is the exact output of mocp -Q %state
?
Try this:
#!/bin/sh
state=$(mocp -Q %state)
if [ "$state" != "STOP" ] || [ "$state" != "PAUSED" ];then
SONG=$(mocp -Q %song)
if [ -n "$SONG" ]; then
echo "$SONG - $(mocp -Q %album)"
else
basename "$(mocp -Q %file)"
fi
else
echo ""
fi
You can change the values STOP and PAUSED, I dont know what tha output ofmocp
is exactly.
Can you run the script on a terminal? What is the output?
You want it to disappear when there's no song playing? Do I understand that right?
Ah okay. So you problem is that you dont have a button to start it again because the button is away?
The script in the repo should disappear when mocp
returns stopped
. My script in this issue should disapper if mocp
returns stopped
or paused
.
What is your interval
value in your config of your polybar module?
I dont have a moc here, so i cant test much.
But you could take a look what moc
returns wit mocp -Q %state
. This should be the same value like in that condition.
At the moment I have no idea whats wrong here and I cant reproduce it.
I dont have moc installed at the moment. But I guess if you look at
mocp -Q %state
and it returnsstopped
then you could adapt the script.