dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.55k stars 340 forks source link

dunst not autostarted through DBus (anymore) #245

Closed blueyed closed 8 years ago

blueyed commented 8 years ago

dunst is not started anymore automatically for me.

I am using the dunst 1.1.0-1 package on Arch Linux.

If I remember correctly it has worked before, and might be linked to using startx currently.

The output from dbus-monitor after notify-send foo without dunst running.

If I start it manually, it displays the notification.

method call time=1447769632.833528 sender=:1.200 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1447769632.833541 sender=org.freedesktop.DBus -> destination=:1.200 serial=1 reply_serial=1
   string ":1.200"
signal time=1447769632.833546 sender=org.freedesktop.DBus -> destination=(null destination) serial=26 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.200"
   string ""
   string ":1.200"
signal time=1447769632.833554 sender=org.freedesktop.DBus -> destination=:1.200 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.200"
method call time=1447769632.833879 sender=:1.200 -> destination=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.Notifications',interface='org.freedesktop.Notifications',path='/org/freedesktop/Notifications'"
method return time=1447769632.833891 sender=org.freedesktop.DBus -> destination=:1.200 serial=3 reply_serial=2
method call time=1447769632.833913 sender=:1.200 -> destination=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',path='/org/freedesktop/DBus',arg0='org.freedesktop.Notifications'"
method return time=1447769632.833921 sender=org.freedesktop.DBus -> destination=:1.200 serial=4 reply_serial=3
method call time=1447769632.834159 sender=:1.200 -> destination=org.freedesktop.DBus serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=StartServiceByName
   string "org.freedesktop.Notifications"
   uint32 0
method call time=1447769632.837978 sender=:1.201 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1447769632.838023 sender=org.freedesktop.DBus -> destination=:1.201 serial=1 reply_serial=1
   string ":1.201"
signal time=1447769632.838058 sender=org.freedesktop.DBus -> destination=(null destination) serial=27 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.201"
   string ""
   string ":1.201"
signal time=1447769632.838095 sender=org.freedesktop.DBus -> destination=:1.201 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.201"
signal time=1447769632.838694 sender=org.freedesktop.DBus -> destination=:1.201 serial=28 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.201"
signal time=1447769632.838704 sender=org.freedesktop.DBus -> destination=(null destination) serial=29 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.201"
   string ":1.201"
   string ""
error time=1447769632.838941 sender=org.freedesktop.DBus -> destination=:1.200 error_name=org.freedesktop.DBus.Error.Spawn.ChildExited reply_serial=4
   string "Process org.freedesktop.Notifications exited with status 1"
method call time=1447769632.839183 sender=:1.200 -> destination=org.freedesktop.DBus serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',path='/org/freedesktop/DBus',arg0='org.freedesktop.Notifications'"
method return time=1447769632.839221 sender=org.freedesktop.DBus -> destination=:1.200 serial=6 reply_serial=5
signal time=1447769632.839328 sender=org.freedesktop.DBus -> destination=:1.200 serial=30 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.200"
signal time=1447769632.839339 sender=org.freedesktop.DBus -> destination=(null destination) serial=31 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.200"
   string ":1.200"
   string ""
method call time=1447769632.839605 sender=:1.202 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1447769632.839615 sender=org.freedesktop.DBus -> destination=:1.202 serial=1 reply_serial=1
   string ":1.202"
signal time=1447769632.839621 sender=org.freedesktop.DBus -> destination=(null destination) serial=32 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.202"
   string ""
   string ":1.202"
signal time=1447769632.839630 sender=org.freedesktop.DBus -> destination=:1.202 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.202"
method call time=1447769632.839785 sender=:1.202 -> destination=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.Notifications',interface='org.freedesktop.Notifications',path='/org/freedesktop/Notifications'"
method return time=1447769632.839797 sender=org.freedesktop.DBus -> destination=:1.202 serial=3 reply_serial=2
method call time=1447769632.839819 sender=:1.202 -> destination=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',path='/org/freedesktop/DBus',arg0='org.freedesktop.Notifications'"
method return time=1447769632.839827 sender=org.freedesktop.DBus -> destination=:1.202 serial=4 reply_serial=3
method call time=1447769632.839988 sender=:1.202 -> destination=org.freedesktop.DBus serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=StartServiceByName
   string "org.freedesktop.Notifications"
   uint32 0
method call time=1447769632.844386 sender=:1.203 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1447769632.844440 sender=org.freedesktop.DBus -> destination=:1.203 serial=1 reply_serial=1
   string ":1.203"
signal time=1447769632.844477 sender=org.freedesktop.DBus -> destination=(null destination) serial=33 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.203"
   string ""
   string ":1.203"
signal time=1447769632.844521 sender=org.freedesktop.DBus -> destination=:1.203 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.203"
signal time=1447769632.845057 sender=org.freedesktop.DBus -> destination=:1.203 serial=34 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.203"
signal time=1447769632.845067 sender=org.freedesktop.DBus -> destination=(null destination) serial=35 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.203"
   string ":1.203"
   string ""
error time=1447769632.845291 sender=org.freedesktop.DBus -> destination=:1.202 error_name=org.freedesktop.DBus.Error.Spawn.ChildExited reply_serial=4
   string "Process org.freedesktop.Notifications exited with status 1"
signal time=1447769632.845797 sender=org.freedesktop.DBus -> destination=:1.202 serial=36 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.202"
signal time=1447769632.845807 sender=org.freedesktop.DBus -> destination=(null destination) serial=37 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.202"
   string ":1.202"
   string ""
ghost commented 8 years ago

This may not be the key, and may not apply to Arch but ToriOS uses /etc/X11/Xsession jwm The startup script also sets a bunch of environment variables, but the key to Xsession is /etc/X11/Xsession.options

# $Id: Xsession.options 189 2005-06-11 00:04:27Z branden $
#
# configuration options for /etc/X11/Xsession
# See Xsession.options(5) for an explanation of the available options.
allow-failsafe
allow-user-resources
allow-user-xsession
use-ssh-agent
use-session-dbus

Hope this helps some

Narrat commented 8 years ago

How does your .xinitrc look like, since you're using plain startx?

blueyed commented 8 years ago
#!/bin/sh

exec 2> ~/.xsession-errors
source ~/.xprofile
exec ~/.dotfiles/usr/bin/session-run-awesome.sh

~/.dotfiles/usr/bin/session-run-awesome.sh is a more sophisticated exec awesome.

~/.xprofile looks similar to that:

export DESKTOP_SESSION=gnome
sh_setup_x_theme="$(~/.dotfiles/usr/bin/sh-setup-x-theme "")"
eval "$sh_setup_x_theme"
unset MY_X_THEME_VARIANT
unset _ZSH_LAST_CMD_TITLE
if [ -x /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 ]; then
  /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
else
  /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &
fi
setxkbmap -layout de -variant nodeadkeys -option -option 'caps:ctrl_modifier' -option 'lv3:ralt_switch_multikey'
xcape -t 200 -e 'Caps_Lock=Escape;Control_L=Control_L|O;Shift_L=parenleft;Shift_R=parenright;Control_R=Menu'
xset b 100
xset s 300 5
xset r rate 200 25
autorandr -c --force
synclient MaxTapTime=0
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 200
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
xinput set-prop "TPPS/2 IBM TrackPoint" "Device Accel Constant Deceleration" 0.95
rofi -width 80 &
compton &
_ZSH_ENVOY_SH_FILE=/run/user/$(id -u)/envoy.sh
envoy -t gpg-agent --defer ~/.ssh/id_rsa ~/.ssh/id_*_rsa -p > $_ZSH_ENVOY_SH_FILE
source $_ZSH_ENVOY_SH_FILE
~/.dotfiles/usr/bin/weechat-notify-from-remote.sh &
xss-lock --ignore-blank -n dim-screen.sh -- slock &
/usr/bin/redshift-gtk -l 52.5099259:13.421095700000023 -v &
nm-applet &
copyq &

Now I have put dunst >> /tmp/dunst.log & in there, but it used to get started automatically IIRC.

blueyed commented 8 years ago

I have these dbus processes:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
dbus       457  0.0  0.0  37408  4016 ?        Ss   Nov20   0:03 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
user    1261  0.0  0.0  37044  3812 ?        Ss   Nov20   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
user    1275  0.0  0.0  36676  3552 ?        S    Nov20   0:00 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
Narrat commented 8 years ago

Does your script to start awesome handle the call to dbus-launch? The xinitrc itself doesn't source /etc/X11/xinitrc/xinitrc.d/ where 50-systemd-user.sh resides. It handles that the wm is started with a dbus-session

The old way to achieve this was a line like this in the .xinitrc

exec dbus-launch openbox-session

That's currently the only thing I can think of. Without this I don't have a session "combined" with the wm and I notice similar effects.

Edit: https://wiki.archlinux.org/index.php/Xinitrc#Configuration Edit2: http://dbus.freedesktop.org/doc/dbus-launch.1.html

blueyed commented 8 years ago

Thanks!

I've found the following, where dbus-update-activation-environment DISPLAY XAUTHORITY fixes it.

% cat /etc/X11/xinit/xinitrc.d/50-systemd-user.sh
#!/bin/sh

systemctl --user import-environment DISPLAY XAUTHORITY

if which dbus-update-activation-environment >/dev/null 2>&1; then
        dbus-update-activation-environment DISPLAY XAUTHORITY
fi

I will add the following to ~/.xinitrc (from /etc/X11/xinit/xinitrc):

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi