i want to get info via ssh-session, which user is currently using the machine. i get the users which are logged in with "w" or "who" but how can i see which one has currently the desktop open to send him a message using yad?
edit: i found a dirty code.. but works for now:
#!/bin/bash
tty=$(cat /sys/class/tty/tty0/active)
active_user=$(w | grep $tty | awk '{print $1;}')
#to get the display also:
disp=$(who | awk -v term="$tty" '/\(:/ $0 ~ term { gsub(/\(|\)/, "", $0); print $5 }')