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

Users browsing this thread: 1 Guest(s)
phillbush
Long time nixers
I dedicated the last weekend to write yet another X11 utility: xnotify.
It is a notification launcher that reads notification from the stdin and displays it on your screen.
You can create a fifo in order to echo stuff into it.

For example:

Code:
echo "Hello World" > /tmp/xnotify.fifo

Would create a notification with “Hello World” as its content.

Here's a demo gif that illustrates its usage.

[Image: 93690391-49b11780-fac7-11ea-96da-ab850dca1b9f.gif]

To launch xnotify, add the following to your ~/.xinitrc:

Code:
rm -f /tmp/xnotify.fifo
mkfifo /tmp/xnotify.fifo
xnotify </tmp/xnotify.fifo 3<>/tmp/xnotify.fifo &

You can use it together with tiramisu, an application that outputs notifications to the stdout.

I still have to improve the text and image placement on the notification window, so any idea is welcome.

So, what do you think?
sokx
Members
Maybe add an option to automatically shrink the notification like in dunst? Other than that I think it looks great and thanks for bringing tiramisu to my attention.
phillbush
Long time nixers
(21-09-2020, 11:47 AM)sokx Wrote: Maybe add an option to automatically shrink the notification like in dunst?

Interesting. Does it shrinks the notification width, height, or both?
I do not use dunst so I have no idea.
In dunst the notification height is fixed or does it depend on its content (like, when there is a icon, the notification gets bigger)?
evbo
Members
Funny, I just saw your post on /r/suckless. Looks like a great little tool!
sokx
Members
(21-09-2020, 12:05 PM)phillbush Wrote: Interesting. Does it shrinks the notification width, height, or both?
I do not use dunst so I have no idea.
In dunst the notification height is fixed or does it depend on its content (like, when there is a icon, the notification gets bigger)?
Sorry, don't know why I assumed that everyone knows how dunst works. If you enable shrinking in dunst, each notification that is smaller than the geometry specified in the config file will get their size based on the font size, padding, line height and image size. Wish I could just take a screenshot for you, but I'm not on *nix atm and couldn't find anything on google.
phillbush
Long time nixers
(21-09-2020, 01:27 PM)sokx Wrote: Sorry, don't know why I assumed that everyone knows how dunst works. If you enable shrinking in dunst, each notification that is smaller than the geometry specified in the config file will get their size based on the font size, padding, line height and image size. Wish I could just take a screenshot for you, but I'm not on *nix atm and couldn't find anything on google.
No problem, I read dunst's manpage and I now understand how it works (and I stole some of its features too).