Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- PATH=/usr/bin:/bin
- XUSERS=($(who|grep -E "\(:[0-9](\.[0-9])*\)"|awk '{print $1$NF}'|sort -u))
- for XUSER in "${XUSERS[@]}"; do
- NAME=(${XUSER/(/ })
- DISPLAY=${NAME[1]/)/}
- DBUS_ADDRESS=unix:path=/run/user/$(id -u ${NAME[0]})/bus
- sudo -u ${NAME[0]} DISPLAY=${DISPLAY} \
- DBUS_SESSION_BUS_ADDRESS=${DBUS_ADDRESS} \
- PATH=${PATH} \
- notify-send "$@"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement