Created
July 19, 2025 23:28
-
-
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
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 | |
| # 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