Skip to content

Instantly share code, notes, and snippets.

@alexander-malafeev
Created February 19, 2020 20:51
Show Gist options
  • Select an option

  • Save alexander-malafeev/146d5e0812beafa351a7049935efd294 to your computer and use it in GitHub Desktop.

Select an option

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.
#!/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
Copy link

ghost commented Nov 18, 2023

This absolutely works!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment