LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-06-2010, 01:30 AM   #1
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Rep: Reputation: 63
my dirty hack for suspend/hibernate at kdm login screen


The only way I've found to get hibernate, and suspend to work at KDM is to add two 'sessions' to the session selector menu.

That is, where you select KDE, XFCE, etc.

Having sudo set up properly for the respective user accounts you wish to invoke the suspend/hibernate will then allow the suspend, and hibernate to be selected as your session, then you just enter your username and pass as you would normally do to login, and the pc will suspend or hibernate accordingly.

Just add the two desktop entries in /usr/share/apps/kdm/sessions

I named mine suspend.desktop and hibernate.desktop accordingly.

If you don't want to reboot, I'd just telinit 3 ; telinit 4 from ctl-alt-f6 and KDM should see them (logout and save work first . I don't think update-desktop-database' is needed iirc.

Quote:
[Desktop Entry]
Type=XSession
Exec=/usr/bin/sudo /usr/sbin/pm-suspend
Name=suspend
Comment=Suspends the computer
Quote:
[Desktop Entry]
Type=XSession
Exec=/usr/bin/sudo /usr/sbin/pm-hibernate
Name=hibernate
Comment=hibernate the computer
If anyone knows a better way, I *truly* am all ears. Especially if someone knows a good keybind, such as the ctrl-alt-del listed in Slackware's init scripts.

Happy Slackin'.
 
Old 01-06-2010, 11:32 PM   #2
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,560

Rep: Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354
That's a pretty decent solution - back when I was trying to use kdm, I had just hacked the command used for halt instead

I still prefer gdm, and I made the version at SlackBuilds.org offer the Suspend option out of the box :-)
 
Old 01-07-2010, 01:27 AM   #3
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Original Poster
Rep: Reputation: 63
Ah, I'll take a look at that for my gnome/build setup boxen then. Thanks for the heads up.
 
Old 01-07-2010, 02:59 AM   #4
amiga32
Member
 
Registered: Mar 2009
Location: Illinois
Distribution: slackware bro
Posts: 161

Rep: Reputation: 38
Looks ok and simple. Doesn't being part of the "power" group alleviate the need of having to su sudio those commands though? I never use hibernate/suspend so I don't really know.
 
Old 01-07-2010, 04:47 AM   #5
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Original Poster
Rep: Reputation: 63
@amiga

If I understand it correctly (and I could be wrong) the hibernate/suspend actions you use when you use a tray icon in KDE, or xfce, which make a call via dbus to pm-suspend/hibernate etc., so yes the power group comes into play.

But if you call the commands on the command line, which is what the desktop files are in essence doing, then you'd need sudo.

You'll note the perm's on the below items:

ls -al /usr/sbin/pm*

lrwxrwxrwx 1 root root 31 2009-12-12 10:21 /usr/sbin/pm-hibernate -> /usr/lib/pm-utils/bin/pm-action
-rwxr-xr-x 1 root root 1568 2009-06-09 19:32 /usr/sbin/pm-powersave
lrwxrwxrwx 1 root root 31 2009-12-12 10:21 /usr/sbin/pm-suspend -> /usr/lib/pm-utils/bin/pm-action
lrwxrwxrwx 1 root root 31 2009-12-12 10:21 /usr/sbin/pm-suspend-hybrid -> /usr/lib/pm-utils/bin/pm-action
 
1 members found this post helpful.
Old 01-07-2010, 09:14 AM   #6
amiga32
Member
 
Registered: Mar 2009
Location: Illinois
Distribution: slackware bro
Posts: 161

Rep: Reputation: 38
yeah you're right. my apologies
 
  


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
cannot login after hibernate/suspend homyangcha Linux - Newbie 2 01-21-2009 12:17 AM
Resolution of the login screen of kdm JZL240I-U Linux - Software 3 11-05-2008 02:41 AM
KDM Login Screen bilkay Linux - Software 2 01-29-2008 02:55 PM
GDM/KDM Login Screen too big for screen on ATI 3D Rage Pro daemon_14 Linux - Software 0 01-14-2006 01:34 PM
KDM login screen Waldi Slackware 2 04-22-2003 09:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:59 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