Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###############################
- ~ cat /etc/udev/rules.d/85-powertargets.rules
- SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="0", RUN+="/usr/sbin/systemctl start battery.target"
- SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="1", RUN+="/usr/sbin/systemctl start ac.target"
- ###############################
- ~ cat /etc/systemd/system/ac.target
- [Unit]
- Description=On AC power
- DefaultDependencies=no
- StopWhenUnneeded=yes
- ###############################
- ~ cat /etc/systemd/system/battery.target
- [Unit]
- Description=On battery power
- DefaultDependencies=no
- StopWhenUnneeded=yes
- ###############################
- ~ cat /etc/systemd/system/powerdown.service
- # /etc/systemd/system/powerdown.service
- [Unit]
- Description=Laptop battery savings
- [Service]
- Type=oneshot
- ExecStart=/usr/local/bin/powerdown
- [Install]
- WantedBy=battery.target
- ###############################
- ~ cat /etc/systemd/system/powerup.service
- [Unit]
- Description=Laptop battery savings
- [Service]
- Type=oneshot
- ExecStart=/usr/local/bin/powerup
- [Install]
- WantedBy=ac.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement