2

I use arch linux with i3wm. My notifications does not work. When I type dunst in to command line it responds whith:

WARNING: No dunstrc found.

When I type notify-send --icon=gtk-info Test "This is a test" or dunstify --action="replyAction,reply" "Message received" it keeps running until I kill it with crt+c while no notification shows up.

This content of /etc/X11/xinit/xinitrc.d/30-dbus.sh file:

#!/bin/bash

# launches a session dbus instance
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && type dbus-launch >/dev/null; then
    eval $(dbus-launch --sh-syntax --exit-with-session)
fi

This is in my journalctl:

18:57:43 arch-thinkpad systemd[562]: Starting Dunst notification daemon...
18:57:43 arch-thinkpad dunst[49939]: CRITICAL: Cannot open X11 display.
18:57:43 arch-thinkpad systemd[562]: dunst.service: Main process exited, code=exited, status=1/FAILURE
18:57:43 arch-thinkpad systemd[562]: dunst.service: Failed with result 'exit-code'.
18:57:43 arch-thinkpad systemd[562]: Failed to start Dunst notification daemon.
18:59:43 arch-thinkpad dbus-daemon[708]: [session uid=1000 pid=708] Failed to activate service 'org.freedesktop.Notifications': timed out (service_start_timeout=120000ms)
18:59:43 arch-thinkpad dbus-daemon[708]: [session uid=1000 pid=708] Activating via systemd: service name='org.freedesktop.Notifications' unit='dunst.service' requested by ':1.112' (uid=1000 pid=17718 comm="/usr/lib/electron/electron /usr/bin/caprine ")

How can I fix this so programs can show notification throw dunst ?
Thank you for help

EDIT1: The No dunstrc found. error has been fiex whith this command: cp /usr/share/dunst/dunstrc ~/.config/dunst/dunstrc

3 Answers 3

5

Instead of installing dunst as a service, add it to your i3 config:

Edit ~/.config/i3/config and add:

exec --no-startup-id dunst
2
  • Thank you, this one worked. Commented Oct 28, 2020 at 19:43
  • @JanČerný you can accept the answer by clicking on the checkmark Commented Nov 2, 2020 at 13:45
1

from: https://wiki.archlinux.org/index.php/Dunst#Installation

Installation Install the dunst package.

An example configuration file is included at /usr/share/dunst/dunstrc. Copy this file to ~/.config/dunst/dunstrc and edit it accordingly.

1
  • I followed instructions and copied file successfully. Now when I run dunst, it just runs with no output until I kill it. Error in journalctl still remains same even after reboot. Commented Oct 28, 2020 at 15:08
1

Because of the Warning: That basically just means that systemd is trying to start the dunst notification daemon (small program that runs in your user desktop session, listening to libnotify based notifications and displaying them in a very minimal way). That's it.

Because of the Error: That has nothing to do with the former. If it can't open your X11 display, check what the .service definition actually runs, and debug from there. I would very likely just disable the dunst service in systemd, manually start dunst from my WM (.Xsession/.xinitrc) and call it a day.

Hope this helps.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.