Notifications and notification daemon not working on window manager

Finally I solved problem myself.

I will leave instructions what I did.

The problem consists of two parts:

  1. Dbus cannot be accessed from within windows manager
  2. Notification daemon cannot get messages from dbus

1st problem solution:

Real problem was, that my windows manager was run from lxdm, which for some reason does not merges config files from /etc/X11/xinit/xinitrc.d except for lxde session (in LXDE dbus works, in awesome wm doesn't). In this folder exists file named 30-dbus with following content:

#!/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 part of the code defines $DBUS_SESSION_BUS_ADDRESS variable which defines a dbus port to use for various applications. echo $DBUS_SESSION_BUS_ADDRESS can be used as simple sanity check to see if dbus session exists (it should return dbus session file).

Config files from this folder can be merged with simple shell script on session start(code taken from .xinitrc):

#!/bin/bash

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

2nd problem solution:

While dbus running and is available to other programs it still needs more access for notifications to work properly, so I needed to run polkit agent, because Awesome WM does not have one. I had chosen lxpolkit, because I already had almost full lxde environment. In my case, just added to my ~/.config/awesome/rc.lua file: awful.util.spawn_with_shell("dex /etc/xdg/autostart/lxpolkit.desktop") , for some reason without this line it refused to start by default with lxdm.

I think gnome polkit agent should work fine too.