Notifier for 'Music On Console' using libnotify.
- GNU/Linux
- Libraries : libnotify
- Build: gcc, make, pkg-config
- External:
- Our onsongchange.sh script.
- Some notifier running: notify-osd, xfce4-notifyd, dunst, etc.
make
-- or --
make debug
make install (default PREFIX=/usr)
-- or --
PREFIX=/usr/local make install
Note: If you don't install change this line of the onsongchange.sh
since the script needs moc_notify
to know the name of the FIFO. To get this name, manually run moc_notify -f
moc_notify [option] &
-v Show the version.
-f Show the name of the fifo file, internaly.
-h Show help.
Note: run in background (&)
1 - Copy the script onsongchange.sh to your MOC directory:
cp scripts/onsongchange.sh ~/.moc
chmod +x ~/.moc/onsongchange.sh
Note: If you installed with make install
you will find the script in $PREFIX/share/moc_notify
2 - Edit your MOC configuration file: ~/.moc/config
# Enable the "OnSongChange" event.
OnSongChange="/home/YOU/.moc/onsongchange.sh %a %t %r %f"
3 - Restart MOC.
Please see onsongchange.sh script to see how to get the cover art.
- The script file does not have the attribute of execution (see
man chmod
)
user.err: mocp: Error when running OnSongChange command ~/.moc/onsongchange.sh : permission denied
- Wrong shell path or name, see
#!/usr/bin/bas
user.err: mocp: Error when running OnSongChange command ~/.moc/onsongchange.sh : The file or directory does not exist
- Could not connect: Connection refused
dbus-launch moc_notify
printf "title @ body @ icon" > $FIFO
printf "title @ body \r newline @ icon" > $FIFO
"I do not want that (@) delimiter in my script. How I can change it?"
MOC_NOTIFY_DELIM="?" /usr/bin/moc_notify &
Make sure moc_notify
is running, then:
echo "Artist@Title@audio-x-generic" > $(moc_notify -f)
and test the script:
~/.moc/onsongchange.sh "Artist" "Title" "Album"
moc_notify
see if the FIFO
file is deleted or moved, for this it uses inotify
from version 2.x
.
- Journalctl - systemd
journalctl -f -t moc_notify
- Socklog - runit
sudo tail -f /var/log/socklog/everything/current