This repository has been archived on 2026-09-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Lenovo-Vantage-Features-for…/usb-charging.sh
T
2026-09-12 06:15:38 +00:00

23 lines
1.1 KiB
Bash

#!/bin/bash
#written by Daniel Wenzlik 2022 - https://danielwenzlik.com
#Script under the GNU AGPLv3 license.
#see the status of USB charging settings
echo "0 means USB charging mode is OFF."
echo "1 means USB charging mode is ON."
echo "--------------------------------------------------------------------------------"
echo "Current status:"
cat /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/usb_charging;
echo "--------------------------------------------------------------------------------"
#control the status of USB charging settings
echo "Do you wish to end the script, enable or disable the USB always on mode?"
select yn in "Exit" "Enable" "Disable"; do
case $yn in
Exit ) echo "Bye. Love ya!" && exit 0;;
Enable ) echo 1 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/usb_charging && echo "Enabled - USB is always on, even if the Laptop is shutdown. How dare you?!" && exit 0;;
Disable ) echo 0 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/usb_charging && echo "Disabled - USB is not always on, even if the Laptop is off. Thank you!" && exit 0;;
esac
done
exit 0