ubuntu - Showing Zenity popup to all users -


i want show zenity popup (or other graphical display) other users on machine when log in via ssh. how can achieve pop other users?

when connect via ssh should show logged in users, also, if users not logged in when connect, , subsequently log in, when log in (while connected) should see notification.

i expect can write file checked on user login run script after connect, initial connection command has me stumped.

basically home computer , don't want family switching off while doing stuff!

here basic outline 1 way this, assuming , family members have bash login shell. let's user "joe" , family consists of "user1", "user2", , "user3".

in .bash_login:

for user in user1 user2 user3;     echo "joe logged in, not turn power off" > /tmp/message.$user done 

in .bash_logout:

for user in user1 user2 user3;     [ -f /tmp/message.$user ] && rm /tmp/message.$user done 

now, in each of other user's .bash_login:

export msgfile=/tmp/message.$user check_messages() {   while [ 1 ];     if [ -f $msgfile ];         zenity --text-info --filename=$msgfile         rm $msgfile     fi     sleep 60   done }  check_messages & 

so, if userx logged in, have background task checks new message once per minute.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -