我正在关注这个回答但我无法让我的 dbus 服务工作,这是我的 dbus 服务
~/.local/share/dbus-1/services/conf.behavior.lid.service
[D-BUS Service]
Name=conf.behavior.lid.service
# For direct (non-systemd) start; required but may be /bin/false to require systemd
Exec=/home/[my_user]/.local/bin/lid-behavior-conf.sh
但是当我跑步时:
gdbus call --session \
--dest org.freedesktop.DBus \
--object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.StartServiceByName conf.behavior.lid 1
我得到:
Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown:
The name is not activatable
答案1
正确的命令是:gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.StartServiceByName 'conf.behavior.lid.service' '1'