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 10-25-2018, 05:34 PM   #1
olear
Member
 
Registered: Jan 2006
Location: Norway
Distribution: Slackware
Posts: 42

Rep: Reputation: 32
Lightbulb Alternative power manager for Slackware


Hello fellow slackers!

I'm not a particularly big fan of KDE or Xfce (no disrespect, just my taste), so I usually end up with Openbox (or similar). This serves me well on a workstation (for the most part), but on a laptop for work and daily use this is lacking. I need a power manager that takes care of my computer, but I don't want to include/install KDE or Xfce, so I started making my own power manager.

I have been working on the first stable release for a while now, and have come to a point where I'm satisfied with the features and stability. So, without further adieu I introduce powerkit 1.0.0 RC1.

powerkit is a lightweight full featured power manager for Slackware, for use with alternative desktop environments and window managers, like Fluxbox, Blackbox, FVWM, WindowMaker, Openbox, Lumina and others.

* Enables applications to inhibit the screen saver (org.freedesktop.ScreenSaver)
* Enables applications to inhibit suspend actions (org.freedesktop.PowerManagement)
* (Hybrid)Sleep/Hibernate/Shutdown/Lock screen on lid action
* Inhibit lid action if external monitor(s) is connected
* Automatically suspend ((hybrid)sleep/hibernate)
* Hibernate/Shutdown on critical battery
* Simple configuration GUI
* XScreenSaver support
* Backlight support

Basically it implements the "fancy" (power) features that exists in KDE/Xfce, but for any WM/DE, with minimal requirements (within reason).

I hope this application/project will be useful for Slackware and it's users. Remember to read the documentation before usage (https://github.com/rodlie/powerkit/b...ster/README.md). Report any issues in this thread or on Github/Gitlab, all feedback is appreciated.

* https://github.com/rodlie/powerkit
* https://gitlab.com/rodlie/powerkit

* [source] https://github.com/rodlie/powerkit/r....0.0rc1.tar.xz
* [package 64bit] https://github.com/rodlie/powerkit/r..._slack14.2.tgz
* [package 32bit] https://github.com/rodlie/powerkit/r..._slack14.2.tgz


Enjoy

Ole-André Rodlie
 
Old 10-25-2018, 05:49 PM   #2
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Sounds interesting. I will give it a try. I also use Openbox and have created some scripts for power management, which serve me well, but I am always willing to test new stuff. Thanks for sharing! (And this is clearly more complete than my scripts, anyway.)

Last edited by montagdude; 10-25-2018 at 05:51 PM.
 
Old 10-25-2018, 06:49 PM   #3
olear
Member
 
Registered: Jan 2006
Location: Norway
Distribution: Slackware
Posts: 42

Original Poster
Rep: Reputation: 32
I started out with scripts too, but after a while I wanted/needed features that wasn't feasible to do with scripts, so here we are. I hope you like the application (if not tell me why, and maybe I can improve something).
 
1 members found this post helpful.
Old 10-25-2018, 10:48 PM   #4
zakame
Member
 
Registered: Apr 2012
Location: Philippines
Distribution: Debian, Ubuntu, Slackware
Posts: 295

Rep: Reputation: 181Reputation: 181
Nice, I'll give this a spin on my -current with Fluxbox (its running with xfce-power-manager currently but I found it rather clunky in some parts.) Thanks!
 
Old 10-26-2018, 07:53 AM   #5
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Well, not a great first result:

Code:
dan@Thinkpad-T430:~$ powerkit
Segmentation fault (core dumped)
I will try building from source now and see if that makes any difference or reveals an issue.
 
Old 10-26-2018, 08:15 AM   #6
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 rebuilt it from source with debug flags. Here is the backtrace for the segfault:

Code:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5f5b580 in QVariant::QVariant(QVariant const&) () from /usr/lib64/qt/lib/libQtCore.so.4
(gdb) bt
#0  0x00007ffff5f5b580 in QVariant::QVariant(QVariant const&) ()
    at /usr/lib64/qt/lib/libQtCore.so.4
#1  0x00007ffff7248da8 in QDBusPendingReplyData::argumentAt(int) const ()
    at /usr/lib64/qt/lib/libQtDBus.so.4
#2  0x00007ffff7bcabdd in QDBusPendingReply<QString, void, void, void, void, void, void, void>::argumentAt<0>() const (this=0x7fffffffd7d8) at /usr/lib64/qt/include/QtDBus/qdbuspendingreply.h:176   
#3  0x00007ffff7bc9a99 in QDBusPendingReply<QString, void, void, void, void, void, void, void>::value() const (this=0x7fffffffd7d8) at /usr/lib64/qt/include/QtDBus/qdbuspendingreply.h:181           
#4  0x00007ffff7bc5ef0 in PowerKit::find() (this=0x6e5660) at powerkit.cpp:177
#5  0x00007ffff7bc745c in PowerKit::scan() (this=0x6e5660) at powerkit.cpp:283
#6  0x00007ffff7bc6fbc in PowerKit::setup() (this=0x6e5660) at powerkit.cpp:268
#7  0x00007ffff7bc4a8d in PowerKit::PowerKit(QObject*) (this=0x6e5660, parent=0x7fffffffdd20)
    at powerkit.cpp:26
#8  0x000000000040d5fe in  ()
#9  0x000000000040c89e in  ()
#10 0x00007ffff4f487d0 in __libc_start_main () at /lib64/libc.so.6
#11 0x000000000040c429 in  ()
Also, this is kind of strange, but when I built it from source (using your SlackBuild) with CONFIG+=debug and CFLAGS="-g -fPIC", I initially got an error loading the libPowerkit.so shared library. It seems it did not get installed properly. After manually installing it in /usr/lib64, I get this segfault. The strange thing is that it did not complain about the shared library when using the package you provided or when building it with CONFIG+=release and CFLAGS="-O2 -fPIC", even though as far as I can tell, libPowerkit.so was not installed then either.

I should note that I have a bit of a frankensystem right now, because awhile ago I was using Dlackware with systemd, then I removed Gnome, but I still have systemd because I haven't taken the time to do a proper reinstall yet. These issues don't seem related to that, but there's always a chance.

Last edited by montagdude; 10-26-2018 at 08:18 AM.
 
Old 10-26-2018, 12:27 PM   #7
olear
Member
 
Registered: Jan 2006
Location: Norway
Distribution: Slackware
Posts: 42

Original Poster
Rep: Reputation: 32
Hmm, will look into this. Note that the library is built static on release (you an override with CONFIG+=install_lib), in debug the library is shared (for ease of development).

systemd could be a problem (I only test/support consolekit+upower on Slackware). The application checks for logind first, then consolekit, then upower. Does the logind D-Bus service work on your installation?

I have tested powerkit on slackware(64) 14.2 (consolekit+upower0.9), FreeBSD 11.2 (consolekit+upower0.9) and Ubuntu 18.04 (logind+upower0.99).
 
Old 10-26-2018, 12:47 PM   #8
olear
Member
 
Registered: Jan 2006
Location: Norway
Distribution: Slackware
Posts: 42

Original Poster
Rep: Reputation: 32
@montagdude: The segfault has been fixed (in git 1.0/master), but there is something strange with your setup since powerkit can't get a proper response from upower. Could you list the installed version of systemd/logind/consolekit/upower so I can try to replicate this issue?
 
Old 10-26-2018, 12:55 PM   #9
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Quote:
Originally Posted by olear View Post
@montagdude: The segfault has been fixed (in git 1.0/master), but there is something strange with your setup since powerkit can't get a proper response from upower. Could you list the installed version of systemd/logind/consolekit/upower so I can try to replicate this issue?
I have systemd 231 and upower 0.9.23. However, I'm not sure if upower is working correctly with Dlackware systemd (or if it is even supposed to).
 
Old 10-26-2018, 01:00 PM   #10
olear
Member
 
Registered: Jan 2006
Location: Norway
Distribution: Slackware
Posts: 42

Original Poster
Rep: Reputation: 32
Ok, systemd/logind requires upower 0.99.x to my knowledge. But upower should still work (but some features may not work). I will try to setup a installation with systemd (any SlackBuilds available?) and upower 0.9.x and see if I can do some workarounds.
 
Old 10-26-2018, 01:02 PM   #11
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Quote:
Originally Posted by olear View Post
Ok, systemd/logind requires upower 0.99.x to my knowledge. But upower should still work (but some features may not work). I will try to setup a installation with systemd (any SlackBuilds available?) and upower 0.9.x and see if I can do some workarounds.
Okay, but don't spend too much time on that just on my account, seeing I have an unsupported frankensystem and I'm planning to reinstall Slackware proper eventually anyway.
 
Old 10-26-2018, 02:00 PM   #12
olear
Member
 
Registered: Jan 2006
Location: Norway
Distribution: Slackware
Posts: 42

Original Poster
Rep: Reputation: 32
You can check if upower is working with:
Code:
qdbus --system org.freedesktop.UPower /org/freedesktop/UPower/devices org.freedesktop.DBus.Introspectable.Introspect
You should get an XML with available devices, like:
Code:
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <node name="battery_BAT1"/>
  <node name="line_power_ACAD"/>
</node>
 
Old 10-26-2018, 02:26 PM   #13
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Nope, definitely not working.

Code:
dan@Thinkpad-T430:~$ qdbus --system org.freedesktop.UPower /org/freedesktop/UPower/devices org.freedesktop.DBus.Introspectable.Introspect                                                             
Error: org.freedesktop.systemd1.NoSuchUnit
Unit upower.service not found.
So yeah, blame my weirdo system for that.
 
Old 10-26-2018, 11:15 PM   #14
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
This looks interesting, but I normally use desktop environments like Cinnamon and XFCE so I don't have a direct need for it and have not tested it since I don't have any alternative WM's installed.

HOWEVER, if it can suspend to RAM after a predetermined time of system inactivity while running within any DE/WM on a desktop PC, say like how a screensaver runs after a given amount of time, I could totally have a use for it. (and totally would be using it)

I find that this feature is lacking in any (of the few) Linux distros that I have tried, and is the only thing that is keeping me from completely ditching Windows for good is because I like my HTPC to suspend after not using it for say, 15 minutes.

SO, does your program have this feature, or could it be easily implemented?
 
Old 10-26-2018, 11:27 PM   #15
olear
Member
 
Registered: Jan 2006
Location: Norway
Distribution: Slackware
Posts: 42

Original Poster
Rep: Reputation: 32
Auto suspend is of course supported
 
1 members found this post helpful.
  


Reply

Tags
hibernate, power, screensaver, slackware, suspend



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
APC UPS not found by xfce4-power-manager or upower in slackware 14.1 Rod3775 Slackware 5 11-19-2013 11:09 AM
Alternatives to KDE Power Manager (Power Devil)? qwertz333 Linux - Software 2 03-24-2012 07:44 AM
Gnome power manager not installed Correctly? Slackware 13 DranoMax Slackware 11 01-23-2011 01:59 PM
upgrade to slackware 12.2 + xfce4.6 (xfce4-power-manager doesn't work) zux Slackware 4 04-22-2009 11:28 AM
good alternative to power archiver for windows linuxmandrake Linux - Software 1 10-14-2005 12:07 PM

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

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