{{tag>Brouillon}} # Power saver - power management - ACPI Voir : * [[Mise en veille]] * https://wiki.archlinux.org/index.php/Power_management * https://wiki.debian.org/Suspend * https://doc.ubuntu-fr.org/veille_et_hibernation ## Diag ~~~bash ps -ef lsmof ~~~ ## SystemD `/etc/systemd/logind.conf` ~~~ini HandleLidSwitch=ignore ~~~ ~~~bash systemctl restart systemd-logind busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager HandleLidSwitch busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager HandleLidSwitchDocked ~~~ You can use this to temporarily disable lid-switch events: ~~~bash systemd-inhibit --what=handle-lid-switch sleep 1d ~~~ ~~~bash systemctl suspend systemctl hibernate systemctl hybrid-sleep ~~~ ### Disable ~~~bash sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target ~~~ Pour les portables `/etc/systemd/logind.conf` ~~~ini [Login] HandleLidSwitch=ignore HandleLidSwitchDocked=ignore ~~~ ## Notes ~~~bash apt-get install pm-utils laptop-mode-tools ~~~ ### Console `/etc/console-tools/config` ~~~bash BLANK_TIME=0 POWERDOWN_TIME=0 ~~~ source : https://wiki.deimos.fr/D%C3%A9sactiver_la_mise_en_veille_de_l%27%C3%A9cran_sur_Debian.html ## Battery ~~~bash cat /sys/class/power_supply/BAT0/charge_full cat /sys/class/power_supply/BAT0/charge_full_design lspower ~~~ ~~~bash sudo apt install powertop sudo powertop --calibrate apt-get install tlp sudo vim /etc/default/tlp sudo tlp start ~~~ Voir https://linrunner.de/en/tlp/docs/tlp-configuration.html Source : https://www.howtogeek.com/55185/how-to-maximize-the-battery-life-on-your-linux-laptop/ ## ACPI ~~~bash apt-get install acpid acpi_listen ~~~ ~~~ cat /proc/acpi/wakeup Device S-state Status Sysfs node ~~~ ### acpi/interrupts AE_NOT_FOUND infinitely on startup Source : https://unix.stackexchange.com/questions/348806/acpi-exception-ae-not-found-infinitely-on-startup If using sysdemd with rc.local disabled: ~~~bash systemctl enable rc-local.service ~~~ Edit ~~~bash sudo systemctl edit --full rc-local ~~~ Add to rc.local ~~~bash echo "disable" > /sys/firmware/acpi/interrupts/gpe6F ~~~ ### C-STATE https://www.golinuxhub.com/2018/06/what-cpu-c-states-check-cpu-core-linux.html ~~~bash cat /proc/acpi/processor/CPU0/power ~~~ ## Port USB Le port USB se met en économie d’énergie. Par exemple la souris ne fonctionne plus après la sortie de la veille. Voir https://logfile.ch/linux/2017/06/15/disable-usb-autosuspend-linux/ ~~~bash cat /sys/bus/usb/devices//power/control echo on > /sys/bus/usb/devices//power/control ~~~ == Autres Voir https://www.geeks3d.com/hacklab/20160108/how-to-disable-the-blank-screen-on-raspberry-pi-raspbian/ ~~~bash sudo apt-get install x11-xserver-utils ~~~ `~/.config/lxsession/LXDE/autostart` ~~~ini @xset s off @xset -dpms @xset s noblank ~~~ `/etc/xdg/lxsession/LXDE/autostart` !? Ou `/etc/lightdm/lightdm.conf` ~~~ini [SeatDefaults] xserver-command=X -s 0 -dpms ~~~ ### Exécution à l'entrée en veille / Exécution à la sortie de la mise en veille Exemple `/lib/systemd/system-sleep/atop-pm` ~~~bash #!/bin/bash PATH=/sbin:/usr/sbin:/bin:/usr/bin case "$1" in pre) systemctl stop atop exit 0 ;; post) systemctl start atop exit 0 ;; *) exit 1 ;; esac ~~~