title: Detect Graphical Login In Bash
body: <p>I am managing computers and accounts in my classroom, which is a CentOS 5.5 environment.  I am trying to figure out how to use the .bashrc file (or similar) to ensure that a task runs when a user logs in via Gnome/GDM, that is, logs into a GUI session, but that that task does not run when a user logs in via SSH or other terminal logins.  How can I accomplish this?</p>