powerplan icon indicating copy to clipboard operation
powerplan copied to clipboard

GUI

Open Haptein opened this issue 3 years ago • 13 comments

Continuing off from the discussion started in #1 by @KarkanAlzwayed.

I actually planned for powerplan to get a profile edition (and perhaps some status plotting/monitoring) GUI at some point, but truth be told, at this point in time I'm not really experienced in writing pretty desktop GUI's and there's still other powerplan features I'd like to implement first. I actually had a look at QtDesigner a while ago and it seemed like a good starting point. If anyone has some framework/library recommendations or would like to give it a go that'd be great!

@KarkanAlzwayed By all means feel free to try! I think Open-Source projects like this are a great way to learn new things, and I'd be happy to do some code review and offer help if needed. If you end up deciding to give it a go, I think good places to start are the classes PowerProfile and CPUSpec. The main project structure is outlined simply here.

Haptein avatar Oct 13 '21 04:10 Haptein

Flutter & Tauri are new shiny option these days, along with good old Qt/GTK.

Some projects in Flutter to check out:

  • https://github.com/canonical/ubuntu-desktop-installer
  • https://github.com/Feichtmeier/settings

Some tauri apps to check out: https://tauri.studio/en/showcase

Surendrajat avatar Oct 13 '21 08:10 Surendrajat

It actually sounds like the perfect excuse to learn Flutter haha. I guess I'll have to look into those later. Still, I think the priorities would be the following:

  • Common enough that most people already have the needed dependencies
  • Support for streaming graphs
  • Low resource usage
  • Respects system theme or pretty looks

Haptein avatar Oct 14 '21 19:10 Haptein

This would literally take me at least a year or two. lol I have never ever created an app in my life. I do know programming fundamentals, but that's about it. I don't even know how to start.

KarkanAlzwayed avatar Oct 15 '21 03:10 KarkanAlzwayed

@KarkanAlzwayed Hey, no pressure ^^ I just created the issue because I think it's something that'll probably be requested sooner or later. I thought pointers as to where to start would be good to have here, for anyone wanting to give it a go.

Haptein avatar Oct 15 '21 20:10 Haptein

I don't know what you did in your latest commit, but after my last git pull, the battery life has been ridiculously good. I have been promoting this project whenever I can. Thank you so much.

KarkanAlzwayed avatar Oct 18 '21 00:10 KarkanAlzwayed

I have a question, does this conflict with TLP and cpu-autofreq? I am running Manjaro, and it has both installed out of the box. Should I remove them, or with powerplan play well with them?

KarkanAlzwayed avatar Oct 26 '21 01:10 KarkanAlzwayed

Nice, I use Manjaro as well! I actually started developing this because neither did it completely for my needs (among other tools there), but currently I use TLP (without it's Processor options) alongside powerplan without issues.

As for auto-cpufreq, I think having it installed would be a bit redundant, and I would advice uninstalling it (since it supports less of a similar set of features). Before writing this program I actually submitted some code there, but for design reasons I grew disenchanted with the project. Auto-cpufreq's objective is a noble one, but as it is, it's not easy to develop on top and it's very prone to stuff breaking in my experience, and frankly speaking, it's delivery of "optimization" is very questionable.

All that said, If you ever get in a situation where X tool overrides powerplan's config at times (and you can't or rather not change X's configuration), you can just use powerplan with it's --persistent flag.

Haptein avatar Oct 26 '21 04:10 Haptein

I don't know what persistent flags are. lol I just removed them both completely and kept powerplan. TLP was causing the fans to go crazy on my laptop when it is plugged in. I will experiment with the mix later on when I have time, for now, powerplan is doing more than enough for me. BTW, I've been sending you people over here :)

KarkanAlzwayed avatar Oct 26 '21 11:10 KarkanAlzwayed

I don't know what persistent flags are. lol

You can run it like this: powerplan --persistent This way it periodically ensures it's configuration is maintained, this can be useful when other pieces of software mess with it.

I've been sending you people over here :)

Hey thanks! That's very nice of you 😁

Haptein avatar Oct 26 '21 18:10 Haptein

You can run it like this: powerplan --persistent This way it periodically ensures it's configuration is maintained, this can be useful when other pieces of software mess with it.

This is kind of badass/"Like a boss" behavior. Haha.

Hey thanks! That's very nice of you 😁

You're welcome!

EDIT: I have a couple of questions. I just noticed that even though I have bat_policy set to power in /etc/powerplan.conf, it shows as balance_power when running powerplan -s. Am I missing something?

Screenshot_20211025_222719

KarkanAlzwayed avatar Oct 26 '21 22:10 KarkanAlzwayed

EDIT: I have a couple of questions. I just noticed that even though I have bat_policy set to power in /etc/powerplan.conf, it shows as balance_power when running powerplan -s. Am I missing something?

Can you please a separate issue for this? Let's not flood this issue (GUI) with unrelated stuff. I also think it's ok if you open separate issues for questions/discussion. There's another participant here and they might be getting emails for each message 😅.

In the meantime, can you please test if this happens if you run powerplan (the instance not in monitor mode) with the mentioned --persistent argument?

Haptein avatar Oct 27 '21 01:10 Haptein

I've been real busy lately but I started work on a Qt GUI (among other things). I'll probably release it early 2022.

Haptein avatar Dec 08 '21 21:12 Haptein

Oh hell yeah. Let me know whenever you need me to test it.

KarkanAlzwayed avatar Dec 08 '21 21:12 KarkanAlzwayed