Giter VIP home page Giter VIP logo

dunst's Introduction

main codecov

Dunst

A highly configurable and lightweight notification daemon.

music

Table of Contents

Features

⚙️ Highly customizable

Customize fonts, icons, timeouts, and more. Are you unhappy with the default shortcuts and colors? No worries, you can change these all with a simple configuration file tweak.

click the images to see the dunstrc

screenshot1 screenshot2

📜 Scripting

screenshot_urgency

Run custom scripts on notifications matching a specified pattern. Have espeak read out your notifications, or play a song when your significant other signs on in pidgin!

📋 Rules

Change the look or behavior of notifications matching a specified pattern. You could use this to change the color of message notifications from your favorite jabber buddies, or to prevent important work email notifications from disappearing until you manually dismiss them.

⏸️ Pause

If you want to take a break and not receive any notifications for a while, just pause dunst. All notifications will be saved for you to catch up later.

Additionally, you can set a numeric pause level, which allows you to pause dunst selectively for some notifications, where more urgent notifications get through, but less urgent stay paused.

🕘 History

Catch an unread notification disappearing from the corner of your eye? Just tap a keyboard shortcut to replay the last notification, or continue tapping to see your notification history.

Documentation

Most documentation can be found in dunst's man pages. In dunst(1) contains some general instructions on how to run dunst and in dunst(5) all of dunst's configuration options are explained.

On the dunst wiki you can find guides and installation instructions and on the dunst website there is a FAQ with common issues.

Installation

Dunst is available in many package repositories. If it's not available in your distro's repositories, don't worry, it's not hard to build it yourself.

Dependencies

  • dbus (runtime)
  • libxinerama
  • libxrandr
  • libxss
  • glib
  • pango/cairo
  • libnotify (can build without, for dunstify, see make parameters)
  • wayland-client (can build without, see make parameters)
  • wayland-protocols (optional, for recompiling protocols)
  • xdg-utils (optional, xdg-open is the default 'browser' for opening URLs)
  • jq (optional, for installed completions and tools in contrib)

The names will be different depending on your distribution.

Building

git clone https://github.com/dunst-project/dunst.git
cd dunst
make
sudo make install

Make parameters

  • DESTDIR=<PATH>: Set the destination directory of the installation. (Default: /)
  • PREFIX=<PATH>: Set the prefix of the installation. (Default: /usr/local)
  • BINDIR=<PATH>: Set the dunst executable's path (Default: ${PREFIX}/bin)
  • DATADIR=<PATH>: Set the path for shared files. (Default: ${PREFIX}/share)
  • BASHCOMPLETIONDIR=<PATH>: Set the path for installation of bash completion files. (Default: ${DATADIR}/bash-completion/completions)
  • FISHCOMPLETIONDIR=<PATH>: Set the path for installation of fish completion files. (Default: ${DATADIR}/fish/vendor_completions.d)
  • ZSHCOMPLETIONDIR=<PATH>: Set the path for installation of zsh completion files. (Default: ${DATADIR}/zsh/site-functions)
  • SYSCONFDIR=<PATH>: Set the base directory for system config files. (Default: ${PREFIX}/etc/xdg)
  • SYSCONFFILE=<PATH>: Set the absolute path to which the default dunstrc shall be installed. (Default: ${SYSCONFDIR}/dunst/dunstrc)
  • SYSCONF_FORCE_NEW=(0|1): Overwrite existing ${SYSCONFFILE}. (Default: 0 (don't overwrite))
  • MANDIR=<PATH>: Set the prefix of the manpage. (Default: ${DATADIR}/man)
  • SYSTEMD=(0|1): Disable/Enable the systemd unit. (Default: autodetect systemd)
  • WAYLAND=(0|1): Disable/Enable wayland support. (Default: 1 (enabled))
  • X11=(0|1): Disable/Enable X11 support. (Default: 1 (enabled))
  • DUNSTIFY=(0|1): Disable/Enable the libnotify dunstctl utility. (Default: 1 (enabled))
  • COMPLETIONS=(0|1): Disable/Enable installation of shell completions. (Default: 1 (enabled))
  • SERVICEDIR_SYSTEMD=<PATH>: The path to put the systemd user service file. Unused, if SYSTEMD=0. (Default: ${PREFIX}/lib/systemd/user)
  • SERVICEDIR_DBUS=<PATH>: The path to put the dbus service file. (Default: ${DATADIR}/dbus-1/services)
  • EXTRA_CFLAGS=<FLAGS>: Additional flags for the compiler.

Make sure to run all make calls with the same parameter set. So when building with make PREFIX=/usr, you have to install it with make PREFIX=/usr install, too.

Either X11 or WAYLAND should be set, otherwise dunst will not compile.

Notes on default of XDG_CONFIG_DIRS

Dunst uses a different default (${SYSCONFDIR}) for XDG_CONFIG_DIRS at runtime. This is a slight digression from the recommended value in the XDG Base Directory Specification (/etc/xdg), because the default config file gets installed to ${SYSCONFDIR}/dunst/dunstrc to avoid conflicts with /etc/xdg/dunst/dunstrc which might have been installed from a distribution repository. If you do want dunst to use the spec's recommended default, set XDG_CONFIG_DIR=/etc/xdg at runtime or SYSCONFDIR=/etc/xdg at compile time.

Notes on SYSCONFFILE

Changing SYSCONFFILE does not affect the search for config files, meaning it will not take effect if you choose to install dunstrc to a location that cannot be found by the algorithm outlined in the FILES section of dunst(1).

make install will not overwrite an already existing ${SYSCONFFILE} (i.e. /usr/local/etc/xdg/dunst/dunstrc), see SYSCONF_FORCE_NEW above. This is so you do not lose local changes to said file on upgrade. However, it is recommended to leave that file untouched and use a more important config location to override settings, see the FILES section in dunst(1) for more details.

make uninstall will not remove ${SYSCONFFILE}, use make uninstall-purge if you do want it removed as well.

Contributing

Contributions are very welcome. Before contributing, make sure to look at the contribution documentation in HACKING.md.

Make sure you test your code and where possible add automated tests. These tests are also checked on memory leaks (with make test-valgrind).

Troubleshooting

Cannot set settings via command line

This functionality was removed during the refactor. It might be re-added later in some form. See #940 for details.

Bug reports

Please use the issue tracker provided by GitHub to send us bug reports or feature requests.

Screenshots

screenshot3 progress

Maintainers

Please only refer to active maintainers for issues and bugs.

Ex-Maintainers

Author

Written by Sascha Kruse [email protected]

Copyright

Copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information)

dunst's People

Contributors

alebastr avatar bebehei avatar bynect avatar duarm avatar fwsmit avatar gjum avatar gs93 avatar jgriebler avatar knopwob avatar lukasrad02 avatar lukeshu avatar m-bartlett avatar matejdro avatar mgsloan avatar mkrasnitski avatar mrossinek avatar nick87720z avatar progandy avatar pwithams avatar ritze avatar rpbranco avatar seeryn avatar stapelberg avatar stebalien avatar tobast avatar tsipinakis avatar wavexx avatar whitepeter avatar xkr47 avatar zappolowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dunst's Issues

Wrong minutes calculation

Currently, the number of minutes exceeds '59' if delta is more than one hour.
I've fixed it locally with the following modifications.

diff -u a/dunst.c b/dunst.c
--- a/dunst.c   2012-08-02 19:19:32.000000000 +0400
+++ b/dunst.c   2012-08-10 11:21:42.434974194 +0400
@@ -411,8 +411,8 @@
                                 continue;

                         hours = t_delta / 3600;
-                        minutes = (t_delta / 60);
-                        seconds = (t_delta % 60);
+                        minutes = t_delta / 60 % 60;
+                        seconds = t_delta % 60;

                         for (end = n_buf[i].txt; *end != '\0'; end++) ;
                         if (hours > 0) {

when using synergy and "idle_threshold" > 0 massive cpu and mem use from programs that send notifications.

When using synergy if a notification time reaches the "idle_threshold" time when the mouse cursor is on another computer
dbus-daemon starts leaking memory at a rate of about 100MiB/5s and programs that send dbus messages (in my case evolution and nm-applet) start using 100% of a processing thread.

After moving the mouse cursor back to the computer running dunst the dunst window does not respond.
The only way to stop the cpu use is to kill the dunst process and reboot the computer to free the memory used by dbus-daemon.

This does not happen with "idle_threshold = 0".

Please add .service file for DBus activation

Currently, it's necessary to start dunst manually, e.g. in ~/.xsession.

Putting the following snippet as /usr/share/dbus-1/services/dunst.service results in dunst getting launched via DBus as soon as needed.

[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/bin/dunst

filter duplicate messages

When using NetworkManager, I get disconnect messages multiple times. Filtering identical messages would be a good feature, IMO.

Licensing makes it hard to include in distributions

Hey,

I’d like to package dunst for Debian so that people don’t have to follow a strange tutorial and can enjoy apt-get install dunst instead.

However, your licensing is a bit problematic :-/. As you might know, beerware is not exactly a license which Debian considers free. Would it be an option for you to provide a clear LICENSE file and use one of the licenses which are already present in your code? For example MIT/X11 from dmenu, or the BSD license from inih.

That’d be great!
Thanks,
Best regards,
Michael

Make history redisplays sticky

This is just an idea, I'm not sure if it's better, it's just how I envisioned the feature when I originally requested it and I thought I'd throw it out there. I expected redisplaying previous messages to be sticky and to have to manually clear them. I guess I'll have to use it how it is now for a bit to see how I like it.

format option

Add a option to change the format of the message. Example:

%a --> appname
%s --> summary
%b --> body
%i -->icon name

Rules can run scripts with matching notification data

As part of a rule you could specify the path to a shell script that would be run when a matching notification is received. Maybe script path could include format string characters designating what data is passed to the script.

I haven't actually thought of a use for this one, but thought I'd mention it in case you don't have enough work already :)

Maybe you do something when a torrent is complete. Or when you lose wireless access. Granted in an ideal world you'd do these things through the applications that send the notifications themselves, but I imagine in some cases using dunst would actually be easier.

Use scaled icon in notification

This is something that twmn does that I actually like. It's not a common thing for me to have icons in my notifications (for the most part I don't have any) but in the cases that I do, the icons are what make it.

I'm really digging dunst and will probably use it over twmn (stacking notifications, cool! Nice, easy config? GREAT!), and if this doesn't make it in it's not really a game changer but definitely something I think a lot of people would want.

not drawing notifications at all

dunst seems to be receiving them from dbus just fine (dunst -v prints them to command line like a champ!), but they're never actually getting drawn to the screen.

Did it from a "git clone https://github.com/knopwob/dunst.git && make"

Make spits out a few errors:


pod2man README.pod > dunst.1
dunst build options:
CFLAGS   = -g -ansi -pedantic -Wall -Os -I/usr/X11R6/include -I/usr/include/dbus-1.0 -I/usr/lib/i386-linux-gnu/dbus-1.0/include   -I/usr/include/freetype2 -D_BSD_SOURCE -DVERSION="" -DXINERAMA -DINI_ALLOW_MULTILINE=0
LDFLAGS  = -L/usr/X11R6/lib -lX11 -lXss -lXft -lXinerama -ldbus-1 -lxdg-basedir  
CC       = cc
CC -c draw.c
CC -c dunst.c
dunst.c: In function ‘update_lists’:
dunst.c:271:17: warning: passing argument 2 of ‘l_sort’ from incompatible pointer type [enabled by default]
list.h:54:6: note: expected ‘int (*)(void *, void *)’ but argument is of type ‘int (*)(struct notification *, struct notification *)’
CC -c list.c
CC -c dunst_dbus.c
dunst_dbus.c:78:5: warning: string length ‘1627’ is greater than the length ‘509’ ISO C90 compilers are required to support [-Woverlength-strings]
CC -c ini.c
CC -o dunst

dunst eats modifier key.

I noticed that Dunst eats my designated modifier key; even if there's no notification showing thus rendering that key useless in any other app.

I'm using DWM and Tmux (had the dunst modifier set to ctrl, making tmux useless)

monitor specification broken

Using the latest master (commit VERSION="pre-0.4.0") monitor specification is broken in dunstrc and the using the -mon command line option.

I have

monitor = 1

in my dunstrc but the notification shows up in monitor 0.
Invalid options like

monitor =  2 

do not produce error messages.

dunst -mon 1

produces this error.

dunst: unrecognized option '-mon'
usage: dunst [-h/--help] [-v] [-geometry geom] [-fn font] [-format fmt]
[-nb color] [-nf color] [-lb color] [-lf color] [-cb color] [ -cf color]
[-to secs] [-lto secs] [-cto secs] [-nto secs] [-key key] [-history_key key] [-all_key key] [-mon n]  [-follow none/mouse/keyboard] [-config dunstrc]

Publishing released tarballs

Hello,

can you please somewhere publish latest release tarball (and future ones)? Github downloads page should be ok.

I am going to create package for Fedora now. Thanks.

Single Line mode?

I'd love it if there was a way to have a single line mode. I set geometry to one line, which works great! But would there be a way to have "single_mode = true" and that notification, if enabled, would be pushed to the right (or left?) of the notification?

Add EXTRACFLAGS to CFLAGS

Hello,

review is good, I only need to add Fedora specific CFLAGs, would you mind including EXTRACFLAGS on the CFLAGS line, so I would be able to send them there?

It should be in the very end of the line:

CFLAGS=.... ${EXTRACFLAGS}

Thanks

make alerts sticky when user is inactive

it would be cool if dunst decided that the user was inactive (e.g. no key presses within a certain time) it could make all new alerts sticky so they'd still be there when you come back.

Not sure if X has a library for easily detecting inactivity.

wordwrap and dynamic width

Make it possible to have the window fit to the length of the notification until len > max_with and start wordwrapping then..

libiniparser unavailable in Debian

There is no package for libiniparser in Debian so the config file version of dunst cannot be built without first building libiniparser.

The build error looks like this for reference.

make
dunst build options:
CFLAGS   = -g -ansi -pedantic -Wall -Os -I/usr/X11R6/include -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0 -I/usr/include/freetype2 -D_BSD_SOURCE -DVERSION="" -DXINERAMA
LDFLAGS  = -L/usr/X11R6/lib -lX11 -lXext -lXss -ldbus-1 -lXft -lXrender -lfreetype -lz -lfontconfig -lpthread -liniparser -lrt -lXinerama
CC       = cc
CC -c dunst.c
dunst.c:18:23: fatal error: iniparser.h: No such file or directory
compilation terminated.
make: *** [dunst.o] Error 1

The libiniparser source can be found here for anyone who wants to build it themselves.
http://ndevilla.free.fr/iniparser/

keybindings: "history = ctrl+grave" makes ctrl+z unusable

I use http://neo-layout.org which has 'grave' bound to the third level of the z key.

xmodmap says:

xmodmap -pke | grep 'z Z'
keycode  56 = z Z grave Greek_zeta Undo Redo U2124

When dunst is running, ctrl+z is not available anymore. This is because you resolve the Keysym to a Keycode using XKeysymToKeycode without taking care about the level on which the Keysym is found. I’m not familiar enough with Xlib to provide any more hints.

The correct way to handle it would be to check only the first level, unless shift is specified as a modifier, in which case you should check the second level. In i3, the relevant function is http://code.stapelberg.de/git/i3/tree/src/config.c?h=next#n108

Man page reads "User Contributed Perl Documentation"

And this is the fix:

pod2man --name=%{name} -c "Katello Reference" --section=1 --release=%{version} - man/katello-configure.man1

(replace name and version with real name and VERSION as well as "Katello" strings)

utf-8/unicode issues

http://i.imgur.com/d9pOQ.png I have a script that notifies on song change, and I use little note blocks from unicode (that work fine elsewhere).

This is with the changes I had made, but I don't think that bit should make a difference.

[global]
    font = -*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*

    # The format of the message. Possible variables are:
    #   %a  appname
    #   %s  summary
    #   %b  body
    #   %i  iconname (including its path)
    #   %I  iconname (without its path)
    format = "%I %s %b"

    # Sort messages by urgency
    sort = yes

    # Show how many messages are currently hidden (because of geometry)
    indicate_hidden = yes

    # If indicate_hidden is set to yes, this will show the (x more) on
    # the same line as the notification, and will force only notification
    # to be shown at a time.
    single_line = yes

    # keybindings to remove notification
    # available modifiers are 'ctrl', 'mod1' (the alt-key), 'mod2', 'mod3'
    # and 'mod4' (windows-key)
    modifier = mod4

    # use xev to find the names for keys
    key = c
    # key to redisplay last message(s)
    history_key = grave


    # the geometry of the window
    # geometry [{width}]x{height}][+/-{x}+/-{y}]
    # The geometry of the message window.
    # The height is measured in lines everything else in pixels. If the width
    # is omitted but the height is given ("-geometry x2"), the message window
    # expands over the whole screen (dmenu-like). If width is 0,
    # the window expands to the longest message displayed.
    # A positive x is measured from the left, a negative from the
    # right side of the screen.  Y is measured from the top and down respectevly.
    geometry = "0x3"

    # Don't remove messages, if the user is idle (no mouse or keyboard input)
    # for longer than idle_threshold seconds.
    # Set to 0 to disable.
    idle_threshold = 120

[urgency_low]
    # IMPORTANT: colors have to be defined in quotation marks.
    # Otherwise the '#' and following  would be interpreted as a comment.
    background = "#222222"
    foreground = "#ababab"
    timeout = 3

[urgency_normal]
    background = "#222222"
    foreground = "#ababab"
    timeout = 3

[urgency_critical]
    background = "#ababab"
    foreground = "#222222"
    timeout = 5

Did some reading and apparently utf-8 + c isn't always nice. Hope to see it in the future. Again, will try to mess with the code some to get it to work if I can.

Switch monitor

Perhaps this is possible outside of Dunst using xrandr to set the primary monitor but at the moment, Dunst always displays on my left-hand monitor which I am not normally focused on.

Is it possible to change the monitor?

Dropbox

Dropbox is unable to send notifications, because it relies on org.freedesktop.DBus.Introspectable.Introspect.

This should be fixed in Master; Waiting for confirmation.

Crash after some time

I've compiled Dunst on my own on Ubuntu 12.04 with development libraries found in official repository. After starting it (either by command or automatically from my i3 window manager config file) program works fine for random period of time, usually more than few hours, and then just crashes with the following message:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  53 (X_CreatePixmap)
  Value in failed request:  0x0
  Serial number of failed request:  3767
  Current serial number in output stream:  3773

Show elapsed time since notification was sent

Some notifications would include how long it has been since they were originally sent. I'd expect this to be useful in several situations, such as when you have been idle and have sticky messages remaining and also perhaps when you redisplay historical messages.

"Torrent Complete (5 min)"
"Battery Low (30 sec)"
"john: coming over (1 hour)"

This is inspired by new Mac OS notification center thing.

Support redisplaying last n messages

Sometimes you miss a message and it could be nice to have one of the following:

1- a keybinding to redisplay last message

2- a command to communicate with the running dunst and tell it to redisplay the last n messages. "dunst --last 5" or something would redisplay them. dunst would have a setting of how many messages to remember.

The easiest solution is probably just for me to log everything to a temp file and check there. Thought I'd share the idea anyway though.

keybinding problems

you must find better way to bind your keys. if my modifier is ctrl then i can not do ctrl+c or any other ctrl+ hotkeys..
i use many programs that works with keybinding so i don't want to lose a key..

as a quick workstation i disabled all dunst's keybindings..

Include names of modifiers in example config

I'm not sure if I'm supposed to type modifier = super or modifier = win or modifier = Mod4Mask, so might be nice to have the various popular ones in a comment above this line in the example config.

Btw, since you've implemented all my suggestions I'm probably going to be creating several new issues here :)

Follow Focus

Display the notifications on the monitor that currently has the focus. This may either be the monitor that contains the mouse cursor or the monitor containing the window with the keyboard focus (configurable).

The implementation of this feature depends on wether there is a nice way to get the needed information.

Filter messages

Hi,

is it possible to filter out messages that match a pattern? E.g. never showing messages that matches in the summary filed
:irssi: &bitlbee: root.

I know you can make rules based on matching but I don't know how to then take the action of filtering the message out. Setting the timeout to 0 will not have that effect.

XDG specification woes

Hey,

I looked at your code to use $XDG_CONFIG_HOME, and unfortunately it is missing a lot of things:

  • There is no fallback for $XDG_CONFIG_HOME to ~/.config, as described by the spec
  • There is no fallback to $XDG_DATA_DIRS
  • There is no fallback to sysconfdir (/etc)
  • You don’t distribute your example config file in /etc

In case you want to fix this yourself, have a look at http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html and http://code.stapelberg.de/git/i3/tree/src/config.c#n175 (which is slightly more complex since it has override_config_path, which you can ignore).

I could also submit a patch in case you’re ok with it.

Best regards,
Michael

dunst crashes with "Segmentation fault"

dunst keeps crashing on me with a Segmentation fault.

I am not sure how to build a debug version of dunst to get a backtrace but if you walk me through it I can get one for you.

support middleware

If incoming notifications were a map it would be cool if they passed through a series of middleware functions that could return a possibly changed map. With C not sure how this would work, perhaps the middleware would have to be added at compile time.

Here are a few examples of things that could be middleware:

  • Change critical level messages from some app or containing some text to normal level
  • Increase duration on notifications from some app
  • Change sticky notifications (-t 0?) from some app to non-sticky
  • Set colors for notifications from some app
  • Determine if user is active and optionally set notification to be sticky
  • Rewrite the text of a notification from some app to be more succinct/better formatted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.