Article 6P2G2 How to determine if session is a logged in user

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.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments