GithubHelp home page GithubHelp logo

naios / powersaver Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 1.0 73 KB

Manages Windows Power Plans automatically based on running process names

License: GNU General Public License v3.0

Rust 100.00%
climate climate-change electricity-bill energy-consumption powerplan windows

powersaver's Introduction

Power Saver

Manages Windows Power Plans automatically based on running process names.

The Power Saver will set the power plan to Balanced if the running processes match a provided list, the plan is set to Power Saver otherwise. This can save and regulate the consumed energy of a Windows system to reduce your electricity bill and cooling requirements because the performance is force-throttled if you do not need it.

The benefits of an automatic power plan selection can be increased by customizing your Power Saver plan to limit the resource consumption even further (e.g. max CPU usage: 60%).

The spawned process is hidden and will react to its changed configuration file automatically. A tray icon is displayed to indicate the current power level (green = saving and orange = balanced). Additionally, the tray icon provides the ability to force a specific power level among other useful options.

Configuration

The configuration file path is detected as following

  1. The first program argument if provided
  2. The POWER_SAVER_CONFIG_PATH environment variable, if set.
  3. A powersaver.yaml that is located next to the executable.

The configuration file is simple:

# Process pooling time in seconds
interval: 30

# Case insensitive program names that promote the current
# power scheme to "Balanced", otherwise "Power Saver" is set.
balanced:
  - Unreal
  - Blender
  - devenv

File changes are detected automatically and adjust the power plan instantly!

Building

cargo build --release

powersaver's People

Contributors

naios avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

aehare70

powersaver's Issues

Feature Request: Add more power plans

Hi,

nice tool, very useful for my Laptop!

It would be great if we can also add more power plans like High Performance Mode or custom ones...

powercfg /list

For the DAW Bitwig Studio i prefer tmy High performance plan over any other plan, less clicks and pops in the audio material if CPU is nearly maxed out!

example:

# Process pooling time in seconds
interval: 30

# Case insensitive program names that promote the current
# power scheme to "Balanced", otherwise "Power Saver" is set.
balanced:
  - Unreal
  - Blender
  - devenv

high:
  - Bitwig Studio

8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c:
  - Bitwig Studio

Unable to compile

Hi.
I am new to Rust. I am trying to compile but I am getting these errors, with the original source code, without any changes.

error[E0793]: reference to packed field is unaligned
    --> C:\Users\Leonardo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ntapi-0.3.7\src\ntexapi.rs:2783:52
     |
2783 |         *tick_count.QuadPart_mut() = read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad);
     |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
     = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
     = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

error[E0793]: reference to packed field is unaligned
    --> C:\Users\Leonardo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ntapi-0.3.7\src\ntexapi.rs:2807:25
     |
2807 |         ((read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad)
     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
     = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
     = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

For more information about this error, try `rustc --explain E0793`.
error: could not compile `ntapi` (lib) due to 2 previous errors ```


Can you check the source code  ?

My objective is to change the program to use the Power save plan for default and High Performance to selected apps. 
Thanks.

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.