switch-user

Detect enter/exit session under KDE/Gnome with FreePascal

I'm asking this question after I got a very good answer to: How do I detect the 2 states of “Switch User” in Windows My intention is to find out if the Switch User under KDE/Gnome has a similar API call I can monitor with FreePascal. If not with FreePascal, at least the respective lib entry used in C/C++ ...

Switch user and output variable contents

I am writing a bash script and want to switch to another user, cd into a directory specified by MYDIR in the users bash_profile and list the contents. Currently I have: read username su - app${username} -c ls $MYDIR The output is nothing, my first guess is that it is a problem reading $MYDIR from the users profile as doing it manuall...