๐ I Spy Notify: watch for Freedesktop notifications and execute scripts
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
I made "I Spy Notify", which lets you watch Linux desktop notifications and run scripts for each notification. It's great for (but not limited to!) logging, displaying popups, and playing sounds.
You can visit the GitHub repository here: https://github.com/haritkapadia/i-spy-notify.
The project comes with an XDG Desktop file and a System-D service file. The configuration file is ~/.config/i-spy-notify.json
. Example configurations are in the doc/examples folder
. The project is written in C.
Here's some fun things I learned about Linux notifications while working on I Spy Notify.
- There are many ways to send image data over a notification. You can:
- Send a key word that is associated with an icon (for example, "camera-photo" represents an image of a camera in your current icon theme).
- Send a path to the image.
- Send the image as a byte stream (the format is basically an array of pixels, and is very similar to the
GdkPixbuf
struct).
- Notifications can be replaced by other notifications, if the application requests it.
- When an application sends a notification, it may first query the notification daemon for the server's capabilities, which explain what features of the standard that the daemon supports.
dbus-monitor
monitors a bus by sending a message to the bus that requests that the connection established bydbus-monitor
becomes a monitor connection. If there is already a notification daemon running (which there usually is), I create a monitor connection in the same way.
[link] [comments] ...