Skip to content

Instantly share code, notes, and snippets.

View devgdr's full-sized avatar
🎯
Focusing

dev devgdr

🎯
Focusing
View GitHub Profile
@alexander-malafeev
alexander-malafeev / ideapad_battery_conservation
Created February 19, 2020 20:51
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