LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-24-2007, 01:52 PM   #1
musther
Member
 
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
/etc/gdm/PostSession/Default
or
/etc/kde3/kdm/Xreset

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.

Cheers
 
Old 11-24-2007, 03:39 PM   #2
ta0kira
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.
ta0kira
 
Old 11-26-2007, 12:25 PM   #3
musther
Member
 
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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