Show a notification at login using pam_exec

view full story

http://askubuntu.com – This simple script will show a Zenity notification when the user logs in: case "$PAM_TYPE" in 'open_session' ) DISPLAY=:0 sudo -u $PAM_USER notify-send "Hello there!" "Hello" ;; esac However, this will only work if the DISPLAY variable is actually 0. And won't work for terminal or remote (ssh) logins (obviously, a simple echo there sould be enough). What can I do about this? (HowTos)