Created
February 19, 2020 20:51
-
-
Save alexander-malafeev/146d5e0812beafa351a7049935efd294 to your computer and use it in GitHub Desktop.
Script to control battery conservation mode on Lenovo Yoga S940 in Linux. Should work on all ideapad laptops.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # script is based on answers at https://askubuntu.com/questions/1038471/problem-with-lenovo-battery-threshold | |
| # and relies on the module ideapad-laptop | |
| # arguments are status, on and off are self-explanatory | |
| if [ "$1" == "status" ] | |
| then | |
| cat /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode | |
| elif [ "$1" == "on" ] | |
| then | |
| sudo echo 1 | sudo tee /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode | |
| elif [ "$1" == "off" ] | |
| then | |
| sudo echo 0 | sudo tee /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This absolutely works!!