Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Last active March 22, 2021 00:17
Show Gist options
  • Save kwilczynski/5e7da58801a5cebdfb8cd828fb85c5e0 to your computer and use it in GitHub Desktop.
Save kwilczynski/5e7da58801a5cebdfb8cd828fb85c5e0 to your computer and use it in GitHub Desktop.
Allow intel-undervolt to be executed on AC to Battery and Batter to AC change ensuring proper undervolting.
SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="0", RUN+="/bin/systemctl start battery.target"
SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="1", RUN+="/bin/systemctl start ac.target"
[Unit]
Description=On AC power
DefaultDependencies=no
StopWhenUnneeded=yes
[Unit]
Description=On battery power
DefaultDependencies=no
StopWhenUnneeded=yes
[Unit]
Description=Intel Undervolt Loop Service
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/intel-undervolt daemon
ExecReload=/bin/kill -USR1 $MAINPID
[Install]
WantedBy=multi-user.target
enable no
undervolt 0 'CPU' -20
undervolt 1 'GPU' 0
undervolt 2 'CPU Cache' -20
undervolt 3 'System Agent' 0
undervolt 4 'Analog I/O' 0
power package 65/5 55/60
tjoffset -10
interval 30000
daemon undervolt:once
daemon power
daemon tjoffset
[Unit]
Description=Intel Undervolt Service
After=multi-user.target suspend.target hibernate.target hybrid-sleep.target
[Service]
Type=oneshot
ExecStart=/usr/bin/intel-undervolt apply
[Install]
WantedBy=multi-user.target suspend.target hibernate.target hybrid-sleep.target ac.target battery.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment