Skip to content

Instantly share code, notes, and snippets.

@piotrpolak
Last active January 25, 2019 20:42
Show Gist options
  • Save piotrpolak/6d4dce479365f0922584eacad5209a74 to your computer and use it in GitHub Desktop.
Save piotrpolak/6d4dce479365f0922584eacad5209a74 to your computer and use it in GitHub Desktop.

https://forums.linuxmint.com/viewtopic.php?t=232902

https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html

sudo tlp-stat -b

Prolong batery life

sudo tlp setcharge 70 90 BAT0

When switching to battery

bluetooth off
ENERGY_PERF_POLICY_ON_BAT=powersave
sudo tlp bat
sudo tlp usb

Reset

sudo tlp false
run-on-bat 'if [[ `sudo prime-select query` == "nvidia" ]]; then zenity --info --text="Switching to INTEL" && sudo tlp bat && sudo tlp usb && bluetooth off && sudo prime-select intel && gnome-session-quit; fi'

run-on-ac 'if [[ `sudo prime-select query` == "intel" ]]; then zenity --info --text="Switching to NVIDIA" && sudo tlp false && sudo prime-select intel && gnome-session-quit; fi'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment