Last active
March 22, 2021 16:01
-
-
Save nottux/4b7eb461d95dc6889a5b154b9acbdc74 to your computer and use it in GitHub Desktop.
That's how you save power
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 | |
if ls /tmp/fr_powsav.sh &>/dev/null | |
#credits to "Ric Klaren" @askubuntu.com https://askubuntu.com/a/1026527/928621 | |
then HIDDEVICES=$(ls /sys/bus/usb/drivers/usbhid | grep -oE '^[0-9]+-[0-9\.]+' | sort -u) | |
for i in $HIDDEVICES; do | |
echo -n "Enabling " | cat - /sys/bus/usb/devices/$i/product | |
echo 'on' | sudo tee /sys/bus/usb/devices/$i/power/control >/dev/null | |
done | |
### | |
exit | |
fi | |
if echo "$1"|grep -qi 'b\|l\|t' | |
then echo killing bluetooth | |
sudo systemctl start bluetooth | |
rfkill block bluetooth | |
fi | |
sudo powertop --auto-tune | |
echo powersave|sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | |
touch /tmp/fr_powsav.sh | |
bash "$0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1:13 > 2:48 hrs powersave (you may need to turn off bluetooth from blueman menu or it might update and say its turned off, I don't remember