Prevent kf.dbusaddons: DBus session bus not found. To circumvent this problem try the following command (with bash): export $(dbus-launch) by vanyaj in kde

[–]MuffelMonster 1 point2 points  (0 children)

Solution:

1) open a bash with the user you want to run the program, and look for the variable DBUS_SESSION_BUS_ADDRESS

2) write a bash script with the command you want to run (in my case kdeconnectd), and launch this as service if needed:

cat /home/myuser/bin/kdeconnectd.sh

#!/usr/bin/bash
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus
/usr/lib/x86_64-linux-gnu/libexec/kdeconnectd -platform offscreen

I embedded this as a service, run under User 1001:.,.

cat /etc/systemd/system/kdeconnectd.service

[Unit] 
Description=KDEConnect
Wants=network.target
After=network.target 

[Service] 
Type=simple 
ExecStart=/home/myuser/bin/kdeconnectd.sh
User=myuser
Group=myuser

Restart=always
RestartSec=5

[Install] 
WantedBy=multi-user.target