Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-24-2007, 01:52 PM   #1
Registered: Sep 2007
Posts: 36

Rep: Reputation: 15
Distinguish between logout and shutdown in KDE / GNOME

I've got a script which runs after a graphical logout using either KDM or GDM.

It's called from

Depending on whether you're using KDM or GDM.

What I'm trying to do now is find some way to distinguish between a user who is logging out and a user who is shutting down the machine so that I can run the script in one case, but not the other.

I'm completely stumped as to how to do this, GDM and KDM don't seem to keep track of it internally, but I suppose it doesn't change their operation. Any suggestions will be great.

Old 11-24-2007, 03:39 PM   #2
Senior Member
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
What distro? Normally you would add a line to the script which is called for shutdown on your system. In the case of Slackware, that's /etc/rc.d/rc.0. I've added a line to mine to execute a local shutdown script on my computer, which is also an rc. script.
Old 11-26-2007, 12:25 PM   #3
Registered: Sep 2007
Posts: 36

Original Poster
Rep: Reputation: 15
Sorry, maybe I didn't quite make this clear, the script has to be run from GDM or KDM so that X is still running and it can prompt the user graphically if required. Problem is, at that point I can't seem to distinguish between shutting down and just logging off.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Gnome Shutdown and Logout kcirick Linux - Desktop 1 09-01-2007 08:28 PM
Logout/shutdown/reboot button misconfigured on GNOME Hungry ghost Linux - Software 1 08-09-2006 03:37 PM
gnome won't logout or shutdown properly RRolleston Debian 0 12-23-2004 06:33 PM
Logout/shutdown box won't appear in Gnome under RH9 IBBoard Red Hat 2 07-12-2004 10:50 PM
Logout/Shutdown problems in KDE Palarran Linux - General 3 08-05-2003 04:50 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration