LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 06-24-2019, 04:09 PM   #1
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Dbus-send, UPower, HybridSleep and Slackware-current


Hi all,

When I switched to i3wm I looked for a non root way to suspend / hibernate.
I found this :
Code:
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
Or
Code:
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
Everything works well and I am happy with it... But :

I can't find a way to have HybridSleep working the same way (did not find something in UPower or dbus docs, pm-suspend-hybrid works)

Does someone has some clue?

Last edited by Tonus; 06-25-2019 at 09:31 AM.
 
Old 06-25-2019, 04:39 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,349

Rep: Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331
AFAIK, all power operations require root. If you're able to do it as user, it's because some command has the appropriate permissions (4755).
 
Old 06-25-2019, 06:59 AM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,901

Rep: Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024Reputation: 5024
Try running this and see if UPower has an appropriate method for it:

qdbus --system org.freedesktop.UPower /org/freedesktop/UPower|grep method

On my machine there isn't a HybridSleep method to call, but I don't know whether that is just because of my hardware so you'd best check yours as well.

If all else fails, you can always ignore all this dbus crap and just create a sudo rule and optionally a wrapper script to call pm-suspend-hybrid directly.

Last edited by GazL; 06-25-2019 at 07:16 AM. Reason: typo
 
Old 06-25-2019, 07:21 AM   #4
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
I would recommend using ConsoleKit instead. The UPower we have in Slackware is quite old, and the new version is not going to have shutdown/restart/hybernate/suspend at all, so better to migrate now.

https://wiki.archlinux.org/index.php...wer_operations

Shut down:

Code:
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
Restart:

Code:
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
Suspend:

Code:
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Suspend  boolean:true
Hibernate (suspend to disk):

Code:
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Hibernate  boolean:true
Hybrid Sleep (suspend + hibernate):

Code:
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.HybridSleep  boolean:true
Edit: I just tried it and it works, but I needed to be root. I assume that is because of this (from the link above):
Quote:
This method assumes that you are given permission to shut the system down via PolicyKit. The default group for this is wheel. To change this, edit /etc/polkit-1/localauthority.conf.d/50-localauthority.conf as root.

Last edited by montagdude; 06-25-2019 at 07:27 AM.
 
2 members found this post helpful.
Old 06-25-2019, 09:28 AM   #5
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407

Original Poster
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Dbus-send, UPower, HybridSleep and Slackware-current

Thank you all three for your answers!

I'll definitely will update my key bindings and scripts according to the informations you provided.
 
Old 06-26-2019, 02:43 AM   #6
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407

Original Poster
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Quote:
Originally Posted by GazL View Post
Try running this and see if UPower has an appropriate method for it:

Code:
qdbus --system org.freedesktop.UPower /org/freedesktop/UPower|grep method
No hybrid-sleep there neither, now I know, thank you ! (I was looking for such information)

Quote:
I would recommend using ConsoleKit instead. The UPower we have in Slackware is quite old, and the new version is not going to have shutdown/restart/hybernate/suspend at all, so better to migrate now.

https://wiki.archlinux.org/index.php...wer_operations
Great thanks for listing all these commands. It works as previously (even might be faster). As it is for my laptop, mostly one user member of the wheel group, I had no need to edit /etc/polkit-1/localauthority.conf.d/50-localauthority.conf as root.
 
  


Reply



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
LXer: Linux Mint 18.3 Under Development with HybridSleep Support for Cinnamon, More LXer Syndicated Linux News 0 07-31-2017 07:57 PM
APC UPS not found by xfce4-power-manager or upower in slackware 14.1 Rod3775 Slackware 5 11-19-2013 11:09 AM
Shutdown and restart using UPower bonixavier Linux - Newbie 0 08-08-2012 10:53 PM
upower: cd unmount on eject ToK Linux - Software 1 07-17-2011 01:19 PM
Fedora Core 9 update dbus.exception & dbus.proxies & DBus.Error.AccessDenied errors trien27 Fedora 1 12-08-2008 11:23 PM

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

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