Introduction
According to the Dunst website Dunst is a lightweight replacement for the notification daemons provided by most desktop environments. It’s very customizable, isn’t dependent on any toolkits, and therefore fits into those window manager centric setups we all love to customize to perfection.
When I installed Debian, I start from minimal install. So, I don’t have any notification by default. Then I choose Dunst. If you already have other notification daemon and want to try Dunst, Just simply add Dunst to your autostart. The default notification daemon should be overriden by Dunst.
Installation
Dunst is available in the official Debian repository
|
|
Then try to run it by dunst &
command and then disown
. Close the terminal. Open a new one,
then test it by sending a notification message.
|
|
Of course the default look doesn’t look like that. It needs to be configured first. Here is my configurations. It’s placed in ~./config/dunst/dunstrc
|
|
Geometry is the size of the notification. 300x60-20+48 means, my notification box has 300px width
& 60px height, placed on the right-top of the screen with 20px margin from the right & 48px margin
from the top. Negative value in -20 means it’s drawed on the right. If you change the value to
positive, the notification box would be drawed on the left of the screen. The positive value
in +48 means it’s drawed on the top. If you change the value to negative, the notification box
would be drawed on the bottom of the screen.
Padding is the margin between the text and the box outline. Frame width is how thick your
notification box outline. But I use Debian Jessie now, the Dunst version is too old and hasn’t
been supporting frame yet. I will upgrade my Debian Jessie setup to Stretch soon.
The font I use in the configurations above is custom and I haven’t uploaded it yet. So please
change it with a font you have. format = %s\n%b
, %s means summary (the title of the
notification), and %b means body (the messages of the notification). \n
is linebreak,
without it, your notification messages would be drawed on the right side of the title.
The format could be improved with markup. For example, make the title bold.
I have uploaded the fonts and write the description in this post
|
|
I didn’t enabled it because my bitmap font doesn’t support bold font. Creating bold bitmap font in 5px width of character is not very rational.
|
|
One of Dunst selling point is some actions could be controlled using keybind. Like Ctrl+Space to close the notification popup and Control+Backtick to see the previously closed notification. Dunst also could draw different outline color for each urgency level. In the configurations above I set the low urgency frame to green. The medium urgency frame to blue. And the critical urgency to orange. But again, my version of Dunst doesn’t support frame.
Utilization
Dunst by default handles every notification sent by any applications. But we could playing around with custom messages to send. This actually also works on any notification daemon, not only Dunst. But it looks even cooler if we did it on Dunst.
Showing Time
|
|
Or with formating
|
|
We could add keybind to our DE/WM to call that command. So we could live without statusbar. I use Openbox, so maybe like this
|
|
It will send the time info if I hit Super+T.
Showing Now Playing
I use mpd & ncmpcpp, so I could get the music info using mpc
|
|
Do you know? Ncmpcpp support execute a command on song change in its configurations. So, we could make ncmpcpp send a notification on song change. Just try it. I’m still on Jessie, and again, the ncmpcpp version on Debian Jessie is too old and doesn’t support that command. So, I couldn’t give an example. Maybe the code is like this. Hopefully it works.
|
|
Any Many Other Possibilities
You just need to use your imagination to unleash your creativity.
I use fish, so the subtitution command is (command)
.
If you’re using bash or any POSIX compliance shell, the subtitution command is $(command)
And as always, thanks for reading!