Dunst Notification Position

I installed a dunst update this morning via pacman and now my dunst notifications are appearing right/top instead of right/bottom as they did formerly. This is from the current /.config/dunst/dunstrc file:

  # The geometry of the window:
    #   [{width}]x{height}[+/-{x}+/-{y}]
    # The geometry of the message window.
    # The height is measured in number of notifications 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 respectively.
    # The width can be negative.  In this case the actual width is the
    # screen width minus the width defined in within the geometry option.
    geometry = "400x20-40-40"

This is exactly the same as what appears in my backup /dunstrc file which existed before the update.
What have I overlooked? Thanks.

You might find an answer in this thread:

Oh dear! Have the people with the net and the large syringe been called?

1 Like

Yes. I have been put out of my misery.

So, is whoever did this to dunst in the first place going to fix it?
Where did you comment that script?

No the new geometry settings are the preferred method. I just rolled back a version and kept my old config intact.

Which script? The mpd popup?

I tried rolling back from the archlinux archive and got this:

[drew@archlabs-drew ~]$ sudo pacman -U https://archive.archlinux.org/packages/d/dunst/dunst-1.6.1-2-x86_64.pkg.tar.zst https://archive.archlinux.org/packages/d/dunst/dunst-1.6.1-2-x86_64.pkg.tar.zst.sig
[sudo] password for drew:
loading packages...
warning: downgrading package dunst (1.7.0-1 => 1.6.1-2)
error: '/var/cache/pacman/pkg/dunst-1.6.1-2-x86_64.pkg.tar.zst.sig': package missing required signature
[drew@archlabs-drew ~]$

When I tried to roll back from the pacman cache I got this:

[drew@archlabs-drew ~]$ sudo pacman -U /var/cache/pacman/pkg/dunst*
loading packages...
warning: downgrading package dunst (1.7.0-1 => 1.5.0-1)
error: '/var/cache/pacman/pkg/dunst-1.6.1-2-x86_64.pkg.tar.zst': duplicate target
error: could not open file /var/cache/pacman/pkg/dunst-1.6.1-2-x86_64.pkg.tar.zst.sig: Unrecognized archive format
error: '/var/cache/pacman/pkg/dunst-1.6.1-2-x86_64.pkg.tar.zst.sig': cannot open package file
error: '/var/cache/pacman/pkg/dunst-1.7.0-1-x86_64.pkg.tar.zst': duplicate target
error: could not open file /var/cache/pacman/pkg/dunst-1.7.0-1-x86_64.pkg.tar.zst.sig: Unrecognized archive format
error: '/var/cache/pacman/pkg/dunst-1.7.0-1-x86_64.pkg.tar.zst.sig': cannot open package file
[drew@archlabs-drew ~]$


Neophyte needs help.

Use downgrade (install from the AUR) then just run downgrade dunst and choose 1.6.1.

Done. Fixed. Many thanks!

1 Like

Dunst - A customizable and lightweight notification-daemon 1.7.0 (2021-10-19)
I find this interesting as the update to 1.7.0 has not changed a thing with dunst on my machine it still works the same. I have not changed my config at all.

# The geometry of the window:
    #   [{width}]x{height}[+/-{x}+/-{y}]
    # The geometry of the message window.
    # The height is measured in number of notifications 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 respectively.
    # The width can be negative.  In this case the actual width is the
    # screen width minus the width defined in within the geometry option.
    geometry = "600x20+2000+50"

dunst configuration has changed in version 1.7.0. The old format, geometry = [{width}]x{height}[+/-{x}+/-{y}], no longer works. The new format is like,

    ### Geometry ###

    # dynamic width from 0 to 300
    # width = (0, 300)
    # constant width of 300
    width = 300

    # The maximum height of a single notification, excluding the frame.
    height = 300

    # Position the notification in the top right corner
    origin = top-right

    # Offset from the origin
    offset = 10x50

If you want to place the notification to the lower right corner, change

origin = top-right

to,

origin = bottom-right

See /etc/dunst/dunstrc as an example. I suggest that you copy /etc/dunst/dunstrc to $HOME/.config/dunst/ and change accordingly.

2 Likes

Thanks! I did see that on the dunst website but didn’t find it on my computer - probably because I was looking in the wrong place :frowning:
If I can find that new dunstrc template in /etc, I will go ahead and upgrade.

The other thing removed from the latest version are the keyboard shortcuts. I use them quite often.

So I spent some time with the new config and have it working as I like it. I had to add to my dwm config a couple of shortcuts to show history and close notifications:

The actions:

#define APP_DUNSTHIST           "dunstctl history-pop"
#define APP_DUNSTCLOSE          "dunstctl close"

The shortcuts:

{ ControlMask,                  XK_grave,               spawn,               SHCMD(APP_DUNSTHIST) },
{ ControlMask,                  XK_space,               spawn,               SHCMD(APP_DUNSTCLOSE) },

I just need to add these to my dk setup and I am complete. Done.

Okey Dokey but I’m still using my old config with the geometry set as above and all my notifications
are still on the same place of the screen.

I have had no time really over the past week, as we have been installing a new roof on my house, hopfully by the weekend will have time to look into this new config.

Thanks to everyone for the info…

1 Like