Skip to content

Instantly share code, notes, and snippets.

@itsmaxymoo
Created July 19, 2025 23:28
Show Gist options
  • Save itsmaxymoo/a952e78cefe7a3bd714dd6c2b824916b to your computer and use it in GitHub Desktop.
Save itsmaxymoo/a952e78cefe7a3bd714dd6c2b824916b to your computer and use it in GitHub Desktop.
Enable and disable conservation mode on Lenovo Legion laptops. Install this to /usr/bin
#!/bin/bash
# Path to the conservation_mode file
CONSERVATION_MODE_PATH="/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode"
# Check if argument is passed
if [ $# -eq 0 ]; then
# If no argument, display the current status
cat "$CONSERVATION_MODE_PATH"
elif [ "$1" == "enable" ]; then
# If 'enable' argument, set conservation mode to 1
echo 1 > "$CONSERVATION_MODE_PATH"
echo "Battery conservation mode enabled."
elif [ "$1" == "disable" ]; then
# If 'disable' argument, set conservation mode to 0
echo 0 > "$CONSERVATION_MODE_PATH"
echo "Battery conservation mode disabled."
else
# If invalid argument, show usage
echo "Invalid argument. Use 'enable' or 'disable'."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment