How to determine if session is a logged in user
by mfoley from LinuxQuestions.org on (#6P2G2)
This should be simple and I think I've figured it out before, but I can't find the answer anywhere.
I have a script that can be started by KDE .config/autostart, or manually by a logged in user. How do I determine which? One suggestion I found was to examine the PS1 environment variable, but that does not appear to be set when running the script from a login session.
I have a script that can be started by KDE .config/autostart, or manually by a logged in user. How do I determine which? One suggestion I found was to examine the PS1 environment variable, but that does not appear to be set when running the script from a login session.