This repository has been archived on 2020-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
kernelcheck/notify_all
2017-04-03 19:45:41 +02:00

14 lines
426 B
Bash
Executable File

#!/bin/sh
PATH=/usr/bin
XUSERS=($(who|egrep "\(:[0-9](\.[0-9])*\)"|awk '{print $1$5}'|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