lumina-desktop / lumina

Lumina Desktop Environment
http://lumina-desktop.org
BSD 3-Clause "New" or "Revised" License
531 stars 116 forks source link

Feature Request: power management #714

Closed FrostKnight closed 4 years ago

FrostKnight commented 4 years ago

Powerkit may exist, but I wanted something that runs on as few dependencies as possible so that it can be interchangeable between Linux and BSD.
Would this be possible in the future? Maybe for 2.0 or later? Aka, a power manager.

q5sys commented 4 years ago

what backend would you recommend that runs on both FreeBSD and Linux that has very few dependencies?

FrostKnight commented 4 years ago

sorry for asking, but what do you mean by backend? Programming languages? If so, some form of C+ or C could be good. If you mean a battery backend, would acpi work? Or cbatticon?

q5sys commented 4 years ago

You said "Powerkit may exist" So I thought maybe you were talking about a power daemon that works on both FreeBSD and Linux. That's what I meant by backend, did you have a power daemon that works on both and has minimal dependencies?

FrostKnight commented 4 years ago

You said "Powerkit may exist" So I thought maybe you were talking about a power daemon that works on both FreeBSD and Linux. That's what I meant by backend, did you have a power daemon that works on both and has minimal dependencies?

Actually, I was wondering if you could make one for lumina desktop. I mean if possible.

There is none currently, I guess that's my point, my bad for not making myself clear, powerkit doesn't currently work on bsd i think. Due to dbus and consolekit requirements.

It would need to have functions similiar to powerkit only with as few dependencies as possible.

My request is that you develop one. I will gladly test it if you do. If not, idk, there must be some way.

on an unrelated note... i press logout on lumina and it goes into the login screen rather then poweroff the computer.

But yeah, I am asking for an alternative to powerkit for bsd and linux. I have my reasons for wanting this. I plan to use both in future if possible. By both I mean as in operating systems. :)

q5sys commented 4 years ago

Actually, I was wondering if you could make one for lumina desktop. I mean if possible.

Well anything is possible, just a matter of if its worth it.

There is none currently, I guess that's my point, my bad for not making myself clear, powerkit doesn't currently work on bsd i think. Due to dbus and consolekit requirements.

No worries, We'd need to look around and see if there is something we could hook into. Because I'm pretty sure Ken doesnt want to have to try to figure out how to hook directly into ACPI with the desktop. That's something that I would argue needs to be its own thing and we interface with that.

It would need to have functions similiar to powerkit only with as few dependencies as possible.

Right, there's probably something out there, but I dont know what it is. There are differences in the kernel-y bits for ACPI between Linux and FreeBSD (I believe), so whatever daemon would have to be written for both. If that's out there I dont know of it yet.

My request is that you develop one. I will gladly test it if you do. If not, idk, there must be some way. But yeah, I am asking for an alternative to powerkit for bsd and linux. I have my reasons for wanting this. I plan to use both in future if possible. By both I mean as in operating systems. :)

I'll let Ken weigh in on that. My feeling is that its very much out of scope for a Desktop Environment to manage that. But I'll let him speak for himself. He may also know of a power daemon I dont.

on an unrelated note... i press logout on lumina and it goes into the login screen rather then poweroff the computer.

So you want logout to power off the comuter?

rodlie commented 4 years ago

Just wanted to say that powerkit originally was designed for Lumina, the project however ended up be a generic solution for any "desktop". It's mostly aimed at Linux, but works (some features missing) on NetBSD/FreeBSD as long as you have upower (compatible interface) running on D-Bus. Anyway, just wanted to clarify and let you know that a third-party solution already exists.

FrostKnight basically wants powerkit without upower and dbus (something I have considered and worked on).

FrostKnight commented 4 years ago

Yeah, what rodlie said is absolutely correct. And yes, he worked on it for a while, but I began to think I was asking for too much from one developer. Anyways, if nothing else, I wondered if nothing else, if a bsd version only could be made. One that exclusively works only with BSD with few dependencies.
Because to be honest, rodlie is right about one thing, powerkit does work for linux pretty well.
Although if it could be made to support lumina-desktop and draco without requring, pulseaudio, consolekit/logind stuff or dbus or upower. Anyways I will leave the thought up to you. But if its made for linux, I will gladly test it. I don't have a bsd system yet, but I plan to in the future, its a long story and I don't want to bore you with the details.

beanpole135 commented 4 years ago

The only thing Lumina uses for power is some kind of hook to check/get the current battery state. You can see or setup your own custom power hooks here in the LuminaOS-[something] definition files: https://github.com/lumina-desktop/lumina/tree/master/src-qt5/core/libLumina

On FreeBSD, this periodically runs an "apm" command to get the current battery state: As seen in the ~30 lines here: https://github.com/lumina-desktop/lumina/blob/master/src-qt5/core/libLumina/LuminaOS-FreeBSD.cpp#L302

I would rather not introduce a hard requirement on a power library that is not available on many OS's, and instead just let each OS setup their own custom definition in those template files so that Lumina can hook into whatever system that OS uses by default.

FrostKnight commented 4 years ago

Ah okay, well I tried. ;)

Still a shame, I would have liked a power manager alternative.