GithubHelp home page GithubHelp logo

rodlie / powerkit Goto Github PK

View Code? Open in Web Editor NEW
88.0 7.0 9.0 1.53 MB

Desktop Independent Power Manager

License: BSD 3-Clause "New" or "Revised" License

C++ 97.34% CMake 2.66%
power-management upower fluxbox openbox windowmaker hibernate sleep suspend laptop battery

powerkit's Introduction

powerkit

Desktop independent power manager for use with alternative X11 desktop environments and window managers on Linux.

Screenshot of the powerkit configuration

  • Implements org.freedesktop.ScreenSaver service
  • Implements org.freedesktop.PowerManagement.Inhibit service
  • Automatic actions on lid, idle and low battery
    • Sleep
    • Hibernate
    • HybridSleep
    • Suspend then Hibernate
    • Shutdown
  • Screen saver support
  • Screen lid support
  • Screen locking support
  • Screen backlight support
  • Notification support (can use org.freedesktop.Notifications if available)

See documentation (man powerkit) for more information.

powerkit's People

Contributors

rodlie avatar snprajwal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerkit's Issues

Long Term Request: simpler dependencies 1+ Year(s) wait if needed

I know you think I have completely moved to Lumina, but I actually still use both, anyways I will get to my point.

Can you remove the dependencies of upower, consolekit and dbus in the future? Like say, a year or two?

That is when my distro plans to ditch its linux version and become a BSD based OS.

I think I showed you my reason for interest regarding this recently, if you don't care that's fine. But i just thought I would bring it up for people who love Lumina Desktop and Draco Desktop and want to use them on BSD with powerkit. I am still willing to test on the linux end. As for porting it to BSD, remove those dependencies and it should be easy enough to port with or without your help on that front.

Bundle icons

Should probably bundle some core icons. On Slackware this is not an issue, but I have noticed some issues with other distros where the system icon theme is broken(-ish).

support change backlight for amdgpu

thans for your work and the software works pretty well in my computer except I can not change my backlight.
After some work I got that some sys file of amd gpu is in /sys/class/backlight/amdgpu_bl0 and it same as radeon_bl0 in backlight, so i do following patch. I wonder some guys may also face my problem, could you please check and merge these patches?

--- app/common.cpp	2022-04-06 16:06:02.203670414 +0800
+++ app/common.cpp	2022-04-06 16:07:28.080217463 +0800
@@ -184,6 +184,8 @@ QString Common::backlightDevice()
             return foundDir;
         } else if (foundDir.startsWith(QString("%1/acpi").arg(path))) {
             return foundDir;
+        } else if (foundDir.startsWith(QString("%1/amdgpu").arg(path))) {
+            return foundDir;
         }
     }
     return QString();
--- app/share/udev/90-backlight.rules	2019-04-05 03:17:22.000000000 +0800
+++ app/share/udev/90-backlight.rules	2022-04-06 15:55:20.798740845 +0800
@@ -4,3 +4,7 @@ ACTION=="add", SUBSYSTEM=="backlight", K
 ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
 ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="radeon_bl0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
 ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="radeon_bl0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
+ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
+ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"

Disable DPMS on `org.freedesktop.ScreenSaver.Inhibit`

When the org.freedesktop.ScreenSaver.Inhibit message is received, xscreensaver is correctly disabled, but DPMS, which can be configured through xscreensaver, remains enabled. I wish DPMS were disabled as well, because keeping it enabled kind of defeats the purpose of the inhibit method.

Roadmap 2024

Hi,

As you may have noticed this project stalled by the end of 2019. There are a lot of reasons for this, so I will not get into that any further.

I do however have plans to finish v2 and at least maintain that for a while. Currently this repo has three branches, and they may confuse people, here is the current layout:

  • 1.0 is the stable branch, what may become 1.0.1
  • master is a semi-stable branch with new features, what may become 1.1
  • wip is the development branch, several new (possible broken) features, what will become 2.0

The master branch will probably not get any new commits, as I changed my mind during development (back in 2019) and forked it into the wip branch.

So, the plan is to rename the master branch into 1.1 and more or less ignore it. Then rename wip into main and continue the development there.

I will still maintain the 1.0 branch and do patch releases if needed (at least until v2 is stable).

Support kernel check bypass

in powerkit we check the actual kernel cmdline for a valid resume disk before allowing hibernation, on some systems this is not needed and will disable hibernation (#18). I do however want to keep the kernel check on as default since most systems I have tested don't work without, and we can't allow a system to go into hibernation without any way to restore the session, that's bad.

So I will add a checkbox in the config to bypass this feature. Since this is not a major change I will add this to 1.0.1.

screen lock on lid close not working on slackware 15

Hey, thanks for this little daemon, it seems to have a lot of features, I especially like the tab where you can see which applications are requisting an inhibition of the power management.
One thing that i noticed is not working is automatic screen lock on lid close. It works fine using the testing button tough (the one on the bottom labeled "lock screen now").
I saw in another posted issue that you moved to macos so probably you are not supporting this anymore, any chance you can take a look at this issue?

Lock before suspend not working on Fedora

Hello,
I'm using Powerkit on Fedora 31, is working good, but lock on suspend doesn't work. I have:

  • all the options set in powerkit setting, except "notify on battery" and "notify on AC"
  • xscreensaver running

The suspend works, but the session isn't lock before the system goes to sleep.
Maybe something related to systemd?
Thankyou.
Gionata

Notifications through org.freedesktop.Notifications

Thank you for making this program. I like it, and I can't find any other programs which nicely fill the role it fills on my desktop.

Instead of using the QT System Tray icon showMessage notifications, should/could it use freedesktop notifications?

I have made a fork of this project and added the code to do this there. It's mainly taken from the notification code used in flameshot. I'm not sure if what I've made is too good, but it seems to work. If this is something worth adding to the real project, I could open a pull request.

Please let me know if that is a good idea.

Adapt to "new" tech

Things change (sometimes for the better, but mostly just for the hell of it).

Tested powerdwarf in Ubuntu 18.04:

  • UPower is now missing a lot of methods/signals
  • (can)Suspend/Hibernate is not in UPower anymore
  • Need to add support for login1, as most features is now there

So, I may add support for this, but currently powerdwarf was created to fix power issues in Slackware on (my) laptops (and I haven't finished that yet).

Doesn't change HandleLidSwitch event

I use arch + bspwm, I have this in my bspwmrc:

killall -q powerkit; powerkit&

I ran powerkit --configure and configured it so that when I close the lid on AC power nothing happens, yet if I close the lid on AC power it goes to sleep. This is on a fresh arch install(I only installed basic utilities, and a WM). I use optimus-manager if that changes anything.

Backlight control doesn't work on Arch

Built with qmake PREFIX=/usr CONFIG+=install_udev_rules CONFIG+=bundle_icons and installed through makepkg,
however Brightness bar is greyed out.

runtime deps are installed as instructed.

make dbus optional

I was wondering if you could do that for this and storage, so that I can use, shutdown, suspend, restart and hibernate on my laptop without dbus.
also be able to monitor my battery life on that laptop as well, it is simplicity aka...

Support for a custom locker command

I was thinking about using a different locker, like slock, it would be possible by adding a string widget in setting to le the user specify the command to be used for locking, and with some changes to the library and app?
Do you see any major problem in doing this? I might be able to make the changes and submit a pull request...

Support pm-utils

See discussion in #18

On some system it might be better to use pm-utils. Add as an optional feature.

logind lid actions

So, lid actions in powerkit is broken (aka does nothing) with logind.

HandlePowerKey=, HandlePowerKeyLongPress=, HandleRebootKey=, HandleRebootKeyLongPress=, HandleSuspendKey=, HandleSuspendKeyLongPress=, HandleHibernateKey=, HandleHibernateKeyLongPress=, HandleLidSwitch=, HandleLidSwitchExternalPower=, HandleLidSwitchDocked=

Controls how logind shall handle the system power, reboot and sleep keys and the lid switch to trigger actions such as system power-off, reboot or suspend. Can be one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", "lock", and "factory-reset". If "ignore", systemd-logind will never handle these keys. If "lock", all running sessions will be screen-locked; otherwise, the specified action will be taken in the respective event. Only input devices with the "power-switch" udev tag will be watched for key/lid switch events.

HandlePowerKey= defaults to "poweroff", HandleRebootKey= defaults to "reboot", HandleSuspendKey= defaults to "suspend", HandleHibernateKey= defaults to "hibernate", HandlePowerKeyLongPress= defaults to "ignore", HandleRebootKeyLongPress= defaults to "poweroff", HandleSuspendKeyLongPress= defaults to "hibernate", HandleHibernateKeyLongPress= defaults to "ignore". HandleLidSwitch= defaults to "suspend". HandleLidSwitchExternalPower= is completely ignored by default (for backwards compatibility) โ€” an explicit value must be set before it will be used to determine behaviour. HandleLidSwitchDocked= defaults to "ignore". If the system is inserted in a docking station, or if more than one display is connected, the action specified by HandleLidSwitchDocked= occurs; if the system is on external power the action (if any) specified by HandleLidSwitchExternalPower= occurs; otherwise the HandleLidSwitch= action occurs.

A different application may disable logind's handling of system power and sleep keys and the lid switch by taking a low-level inhibitor lock ("handle-power-key", "handle-suspend-key", "handle-hibernate-key", "handle-lid-switch", "handle-reboot-key"). This is most commonly used by graphical desktop environments to take over suspend and hibernation handling, and to use their own configuration mechanisms. If a low-level inhibitor lock is taken, logind will not take any action when that key or switch is triggered and the Handle*= settings are irrelevant.

Added in version 184.

Looks like a rewrite of the lid stuff (and possibly more) is needed (meh).

wayland support

Hi,

When compiling it seems that powerkit depends on X and Xscreensaver.
I am on wayland (sway) and looking for a nice power-manager. Is wayland support planned?

RTC wakeup

You can't trust upower/backend to hibernate on low battery while suspended (it did for a while on my thinkpad, but for some reason not anymore, system is unchanged), add a feature to wake up the machine after X amount of time and do a hibernate.

Advanced config

powerkit have several "hard-coded" options that may be of interest for advanced users, expose them under "advanced" settings.

Bundle failsafe icons

Getting a "standard" icon theme to work across distros is more or less impossible, some distros don't even have a proper Adwaita installation anymore.

Bundle a minimum set of icons needed for powerkit.

Powerkit causes comp to shut down when you log in.

critical battery being set to shutdown,for me seems to cause the whole thing to shutdown once logged in as I said in the title. At least in Lumina Desktop. I wonder why this happens though or, if its only an archlinux bug.
I will check to see if this is the case.

xscreensaver

How to disable xscreensaver or at least use another screenlock service ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.