You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't have sudo in my system and I don't want to use it. So my snap-sync tells this after run without arguments:
root is not in the sudoers file.
root is not in the sudoers file.
Exited due to error on line 163.
exit status: 1
command: sudo -u $u DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(sudo -u $u id -u)/bus notify-send -a $name "$1" "$2" --icon="dialog-$3"
bash line: 171
function name: notify
The text was updated successfully, but these errors were encountered:
Also, even if I added root in sudoers, I get another error at line 163 because users command generates root user because I am logged in as root (because of not using sudo). So, your script doesn't respect non-sudo linux use. Also with sudo use it generates error if the root is logged in (because root cannot connect to DISPLAY to get notification). So I've fixed notify function to:
notify() {
for u in $(users | tr ' ' '\n' | sort -u); do
if [ $u != 'root' ]; then # I've added this line
sudo -u $u DISPLAY=:0 \
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(sudo -u $u id -u)/bus \
notify-send -a $name "$1" "$2" --icon="dialog-$3"
fi
done
}
And this variant seems to work properly (with root added to sudoers). But fully no-sudo variant still isn't working.
I don't have sudo in my system and I don't want to use it. So my snap-sync tells this after run without arguments:
The text was updated successfully, but these errors were encountered: