代码:
#!/bin/bash
sleep 2
DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION
XDG_RUNTIME_DIR=/run/user/$(id -u)
DISPLAY=:0.0
notify-send "Connecting..."
还尝试过:
#!/usr/bin/env bash
sleep 2
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
DISPLAY=":0"
/usr/bin/notify-send "Connecting..."
exit 0
正如您所看到的,我已尝试设置所有内容,但仍然不起作用。
Ubuntu 20.04 LTS