xnotify: popup a notification on your screen - Programming On Unix

Users browsing this thread: 1 Guest(s)
seninha
Long time nixers
Done!

I just updated xnotify to the new version that support tags and string output.

Tags works like this:
You specify a tag with the TAG: option.
Code:
printf 'TAG:music\tAlbum\tSong title\n' > $XNOTIFY_FIFO
This will spawn a notification tagged as "music", and will close all other notifications tagged as "music".
Thus you can use a volume or album/song notification that will never repeat.

String output work like this:
First you have to invoke xnotify with the -b NUMBER button where NUMBER is a number from 1 to 5 specifying the mouse button that will trigger the string output, and pipe the xnotify stdout to a script you made. The -b option can be omitted, in which case the button will be button 3 (the right button).
Code:
xnotify <$XNOTIFY_FIFO 3<>$XNOTIFY_FIFO  | myscript &
Then you create a notification with the CMD: option.
Code:
printf 'CMD:next\tAlbum\tSong title\n' > $XNOTIFY_FIFO
Thus, when you click on this notification with the right mouse button, xnotify will pipe the string "next" to your script (which, in this example, will make mpc play the next song).


Messages In This Thread
RE: xnotify: popup a notification on your screen - by seninha - 27-10-2020, 05:27 PM