GithubHelp home page GithubHelp logo

hjdskes / powersave Goto Github PK

View Code? Open in Web Editor NEW
133.0 11.0 21.0 54 KB

Linux power save settings, compatible with systemd

License: Do What The F*ck You Want To Public License

Makefile 100.00%
linux laptop systemd battery powersave ssd

powersave's Introduction

Powersave

These files enable power saving on Linux. Note that these settings are applied regardless of whether the system is on battery or AC. Power saving is applied to:

  • Audio card (modprobe.d/99-powersave.conf)
  • Backlight brightness (rules.d/50-powersave-brightness.rules)
  • Bluetooth (disabled completely: modprobe.d/blacklist.conf)
  • NMI watchdog (sysctl.d/99-powersave.conf)
  • Writeback times (sysctl.d/99-powersave.conf)
  • Laptop mode (sysctl.d/99-powersave.conf)
  • Network interfaces, both wired and wireless (modprobe.d/50-powersave-net.rules)
  • Buses (ASPM, PCI, USB, SATA ALPM, tmpfiles.d/powersave.conf and modprobe.d/50-powersave-[pci|usb|sata].rules)

Power saving is not applied to:

  • HDD, since it is replaced with an SSD. SSD power usage is simply ignored, since I have yet to look into this (and I believe it isn't that high). Tips are welcome!
  • CPU frequencies, since the default is fine (using the intel_pstate driver).
  • Swappiness, since I don't use a swap partition.

You might also want to edit /etc/fstab to add commits=<seconds> to the options column of your partitions. See the mount man page.

It is fit for my own laptop (Lenovo Thinkpad Edge E130), which means that this script will not work on every setup. Please check this before running it on your computer! Things might break otherwise and I am not responsible for any damage that has been done.

TODO

  • git grep TODO
  • Test the suspend-on-low-battery udev rule (rules.d/50-powersave-suspend.rules)
  • SSD powersaving?
    • Apply noop schedular in powersave instead of boot config?

Installation

The script will need the following dependencies to run:

  • iw
  • ip
  • ethtool
  • udev
  • systemd

Just run make install as root to install the whole set.

To enable the ASPM setting to work, append pcie_aspm=force to your kernel parameter list. However, before doing so, verify that all PCIe hardware on your system support ASPM!

powersave's People

Contributors

hjdskes 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powersave's Issues

Check udev rule at startup

Hi Unia,

I was inspired by your udev rule to check whether my laptop is on AC or not. However, in case I was on battery, turned off the system and plugged in the charging cable, after restart the udev rules is not run and my laptop remains with the settings for battery mode.

How can I get the udev rule checked on boot?

Regards,

Robert

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.