Giter VIP home page Giter VIP logo

pwr's Introduction

Pwr

This is a program designed for laptops. It can easily switch between power-saving and performance modes using simple, shorthand commands. It will also restart the current display manager unless the -n flag is selected, allowing for all changes to take effect.

What it switches (if available):

  • CPU Performance Governor (powersave vs. performance)
  • NVIDIA PRIME GPU (intel vs. nvidia)
  • Wireless card power-saving state (on vs. off)

Usage

To switch into Performance mode:

pwr perform

To switch to power-saving mode:

pwr powersave

To toggle:

pwr toggle

And to check the current state (gives perform or powersave):

pwr query

You can also use the shorthand pe for performance, ps for power-saving, to for toggle, and qu for query.

If you don't want your display manager to restart, add the -n flag on the end of the command.

Building and Installing

From Binary Releases

Check out the Releases. You can either run the .sh-based installer (a self-extracting archive) as root, or unpack the .tar.gz file and install its contents manually. Be aware that the installer and tarball don't automatically set the script as setuid - you may have to add the +s flag manually.

From Source

Ensure you have git and cmake installed, as well as an appropriate C compiler such as gcc.

git clone https://github.com/emctague/pwr
cd pwr
mkdir build
cd build
cmake ..
make
make install

You can also download a tarball of the latest release and use that instead of the git repo.

Copyright and License

Copyright 2018 Ethan McTague.

This program is licensed under the MIT license. See LICENSE for full license text.

pwr's People

Contributors

emctague avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pwr's Issues

Add `toggle` and `query` commands.

query (qu) should print out the current power-management state by reading it from a specific file, perhaps /var/lib/pwr_state.

toggle (to) should switch between the two power-management states using the same state-management data.

Existing commands should be updated to automatically change the contents of this state file.

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.