acpi_backlight=vendor
, which signals that the hardware controls the brightness and does not need to programmatically climb there./etc/default/grub
and enter the parameter in GRUB_CMDLINE_LINUX
, you get: GRUB_CMDLINE_LINUX="acpi_backlight=vendor"
sudo update-grub
), reboot and enjoy the highlight behavior.pm-utils
hook:/etc/pm/sleep.d/20_custom-asus-u31sd:
#!/bin/sh BUSES="0000:00:1a.0 0000:00:1d.0" case "${1}" in hibernate|suspend) # Switch USB buses off for bus in $BUSES; do echo -n $bus | tee /sys/bus/pci/drivers/ehci_hcd/unbind done ;; resume|thaw) # Switch USB buses back on for bus in $BUSES; do echo -n $bus | tee /sys/bus/pci/drivers/ehci_hcd/bind done ;; esac
sudo chmod +x /etc/pm/sleep.d/20_custom-asus-u31sd
), check. $ find /sys -name backlight /sys/devices/platform/asus-nb-wmi/backlight
/sys/devices/platform/asus-nb-wmi/backlight/asus-nb-wmi/brightness
. Let's add to the previous hook its saving and restoring: #!/bin/sh BUSES="0000:00:1a.0 0000:00:1d.0" case "${1}" in hibernate|suspend) # Switch USB buses off for bus in $BUSES; do echo -n $bus | tee /sys/bus/pci/drivers/ehci_hcd/unbind done # Saving brightness to /tmp/br cat /sys/devices/platform/asus-nb-wmi/backlight/asus-nb-wmi/brightness > /tmp/br ;; resume|thaw) # Switch USB buses back on for bus in $BUSES; do echo -n $bus | tee /sys/bus/pci/drivers/ehci_hcd/bind done # Restoring brightness from /tmp/br cat /tmp/br > /sys/devices/platform/asus-nb-wmi/backlight/asus-nb-wmi/brightness ;; esac
$ sudo add-apt-repository ppa:bumblebee/stable $ sudo apt-get update $ sudo apt-get install bumblebee
/etc/bumblebee/cardoff
and /etc/bumblebee/cardon
respectively:/etc/bumblebee/cardoff:
\_SB.PCI0.PEG0.GFX0.DOFF
/etc/bumblebee/cardon:
\_SB.PCI0.PEG0.GFX0.DON
/etc/bumblebee/bumblebee.conf
power management: ENABLE_POWER_MANAGEMENT=Y
STOP_SERVICE_ON_EXIT=Y
#!/bin/sh BUSES="0000:00:1a.0 0000:00:1d.0" case "${1}" in hibernate|suspend) # Switch USB buses off for bus in $BUSES; do echo -n $bus | tee /sys/bus/pci/drivers/ehci_hcd/unbind done cat /sys/devices/platform/asus-nb-wmi/backlight/asus-nb-wmi/brightness > /tmp/br # Switch optimus back on before going to sleep, avoids the "constant on" # bug that occurs after 2 suspend/resume cycles (thanks kos888) echo `cat /etc/bumblebee/cardon` | tee /proc/acpi/call ;; resume|thaw) # Switch USB buses back on for bus in $BUSES; do echo -n $bus | tee /sys/bus/pci/drivers/ehci_hcd/bind done cat /tmp/br > /sys/devices/platform/asus-nb-wmi/backlight/asus-nb-wmi/brightness # Switch optimus off before resuming, avoids unneccessary power draw echo `cat /etc/bumblebee/cardoff` | tee /proc/acpi/call ;; esac
/etc/default/grub
add the parameter i915.i915_enable_rc6=1
. The line will expand to: GRUB_CMDLINE_LINUX="acpi_backlight=vendor i915.i915_enable_rc6=1"
/etc/pm/power.d/cpu-governor
#!/bin/bash cpu_powersave() { for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo $1 > $i && echo Done. || echo Failed. done } case $1 in true) cpu_powersave "ondemand" ;; false) cpu_powersave "performance" ;; *) exit $NA esac exit 0
/etc/pm/power.d/usb-autosuspend
#!/usr/bin/env python from os import listdir, path from sys import argv status = argv[1] USB_PATH = '/sys/bus/usb/devices/' def powersave(status): devices = listdir(USB_PATH) devices = filter(lambda x: ':' not in x, devices) for device in devices: b = listdir(path.join(USB_PATH, device)) b = filter(lambda x: ':' in x, b) is_mouse = False for i in b: if open(path.join(USB_PATH, device, i, 'bInterfaceProtocol')).read().strip() == '02': is_mouse = True break if not is_mouse: open(path.join(USB_PATH, device, 'power/control'), 'w').write(status) if status == 'true': powersave('auto') elif status == 'false': powersave('on')
/etc/pm/power.d/scsi_host-link_power_management
#!/bin/bash powersave() { for i in /sys/class/scsi_host/host?/link_power_management_policy; do echo $1 > $i && echo Done. || echo Failed. done } case $1 in true) powersave "min_power" ;; false) powersave "max_performance" ;; *) exit $NA esac exit 0
/etc/pm/power.d/pci-power-control
#!/bin/bash powersave() { for i in /sys/bus/pci/devices/*/power/control; do echo $1 > $i && echo Done. || echo Failed. done } case $1 in true) powersave "auto" ;; false) powersave "on" ;; *) exit $NA esac exit 0
sudo pm-powersave true
.Source: https://habr.com/ru/post/134968/
All Articles