Merge pull request #23 from elenapan/fix_mpc_idle

only wake up when mpd is playing and not on other mpd events
This commit is contained in:
Siddharth Dushantha 2019-08-01 15:04:02 +02:00 committed by GitHub
commit 82346b178e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

4
kunst
View File

@ -218,7 +218,9 @@ main() {
# Waiting for an event from mpd; play/pause/next/previous # Waiting for an event from mpd; play/pause/next/previous
# this is lets kunst use less CPU :) # this is lets kunst use less CPU :)
mpc idle &> /dev/null while true; do
mpc idle player &>/dev/null && (mpc status | grep "\[playing\]" &>/dev/null) && break
done
if [ ! $SILENT ];then if [ ! $SILENT ];then
echo "kunst: received event from mpd" echo "kunst: received event from mpd"
fi fi