Artix Linux Forum

Artix Linux => Applications & Software => Topic started by: mehdi on 26 April 2023, 07:52:32

Title: no bus socket in /run/user/1000/ directory
Post by: mehdi on 26 April 2023, 07:52:32
I want to add some cronjobs in my system. For notify-send to work, I need to add the below command in my crontab file:
Code: [Select]
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus; [path/to/script]
But there is no bus socket in the /run/user/1000/ directory:
Code: [Select]
$ ls -a /run/user/1000
.  ..  dbus-1  dconf  doc  gnupg  keyring  pulse  pipewire-0  pipewire-0.lock

Code: [Select]
$ pacman -Q | grep dbus
dbus 1.14.6-2
dbus-glib 0.112-2
dbus-python 1.2.18-3
dbus-runit 20220314-1
libdbusmenu-glib 16.04.0-5
libdbusmenu-gtk3 16.04.0-5
xdg-dbus-proxy 0.1.4-1

$ sv status dbus
run: dbus: (pid 846) 1806s; run: log: (pid 844) 1806s


How can I solve this issue?
Title: Re: no bus socket in /run/user/1000/ directory
Post by: Dudemanguy on 26 April 2023, 15:20:26
I think it might throw the sockets in /tmp somewhere. Not sure which one is the correct one though.
Title: Re: no bus socket in /run/user/1000/ directory
Post by: mehdi on 27 April 2023, 09:21:41
Yes it does. But it is not permanent and after every reboot I should change the address manually.
Title: Re: no bus socket in /run/user/1000/ directory
Post by: mehdi on 27 April 2023, 10:02:42
Based on this (https://forum.artixlinux.org/index.php/topic,2988.0.html) topic, and with some trial and error I was able to fix the problem. Turns out I don't need the dbus address in the crontab. The only format that works for me is like this:
Code: [Select]
* * * * * export DISPLAY=:0; . $HOME/.Xauthority; notify-send "message"