move move old scripts
This commit is contained in:
1 parent
93b262977b
commit
208fbd96b4
27 files changed
+346
No files matched your search
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# Send a notification message to all active graphical user sessions
|
||||
# Usage: sudo ./notify_all_gui_users.sh "Your message here"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 \"message\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MESSAGE="$1"
|
||||
|
||||
loginctl list-sessions --no-legend | while read -r session uid user seat tty; do
|
||||
# Only graphical sessions
|
||||
if [[ "$seat" == seat* ]]; then
|
||||
BUS="/run/user/$uid/bus"
|
||||
|
||||
if [[ -S "$BUS" ]]; then
|
||||
echo XNotify $user $uid $MESSAGE
|
||||
sudo -u "$user" \
|
||||
DBUS_SESSION_BUS_ADDRESS="unix:path=$BUS" \
|
||||
notify-send "$MESSAGE"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user