Difference between revisions of "Laptop"

From ArchWiki
Jump to: navigation, search
(Granola: marked as out of date)
(hibernate on low battery level: add quick note on hibernate loops)
 
(111 intermediate revisions by 39 users not shown)
Line 3: Line 3:
 
[[es:Laptop]]
 
[[es:Laptop]]
 
[[it:Laptop]]
 
[[it:Laptop]]
 +
[[ja:ノートパソコン]]
 
[[ru:Laptop]]
 
[[ru:Laptop]]
 
[[zh-CN:Laptop]]
 
[[zh-CN:Laptop]]
== Setting Up For Laptops ==
+
This '''Laptop main page''' contains links to article (sections) needed for configuring a laptop for the best experience. Setting up a laptop is in many ways the same as setting up a desktop. However, there are a few key differences. Arch Linux provides all the tools and programs necessary to take complete control of your laptop. These programs and utilities are highlighted below, with appropriate tips tutorials.
This page should contain links to pages needed for configuring a laptop for the best experience. Setting up a laptop is in many ways the same as setting up a desktop. However, there are a few key differences. When setting up a laptop with Arch Linux, the following points should be taken into consideration:
+
  
* [[#Power Management]] Power Management for laptops refers to optimizing the system to last as long as possible on a single battery charge. This can be accomplished by a variety of tweaks.
+
To gain an overview of the reported/achieved Linux hardware compatibility of a particular laptop model, see the results per vendor of below subpages.  
** [[#Suspend and Hibernate]] : the operating system can be manually suspended either to memory or to disk, allowing for an (almost) complete shutdown of other hardware.
+
{{Laptops navigation}}
** Hard drive spindown : the system can be configured to automatically turn off the hard disk after a specified interval of inactivity.
+
If there are laptop model specific instructions, the respective article is crosslinked in the first column of the vendor subpages. In case the model is not listed in the vendor table, existing instructions of similar models via the [[:Category:Laptops]] vendor subcategory may help.  
** Screen shut off : the laptop screen can be configured to automatically turn off after a specified interval of inactivity (not just blanked with a screensaver but completely shut off).
+
** CPU frequency scaling : the processor(s) can be configured to automatically step down to a lower frequency at lower loads.
+
  
* [[#Screen brightness]]. How do I manage screen brightness?
+
== Power management ==
* Network and wireless setup is described in [[Wireless Setup]].
+
* Media buttons can be configured as described in [[Extra Keyboard Keys]].
+
* [[#Touchpad]] sensitivity, acceleration, button function and scroll borders can be configured for some (Synaptics or Alps) touchpads.
+
* [[#Hard disk shock protection]]
+
  
All of these points are important to take into consideration when getting a laptop set up the way you like. Fortunately, Arch Linux provides all the tools and programs necessary to take complete control of your laptop. These programs and utilities are highlighted below, with appropriate tips tutorials.
+
{{Note|You should read the main article [[Power management]]. Additional laptop-specific features are described below.}}
  
Note: the following links may be useful:
 
 
* [http://www.linux-on-laptops.com/ http://www.linux-on-laptops.com/]
 
* [http://www.linlap.com/ http://www.linlap.com/]
 
 
== Power Management ==
 
 
Power management is very important for anyone who wishes to make good use of their battery capacity. The following tools and programs help to increase battery life and keep your laptop cool and quiet.
 
Power management is very important for anyone who wishes to make good use of their battery capacity. The following tools and programs help to increase battery life and keep your laptop cool and quiet.
  
=== Battery State Monitoring Utilities ===
+
=== Battery state ===
  
Battery state can be read using ACPI utilities from the terminal. ACPI command line utilities are provided via the {{Pkg|acpi}} package. A simple battery monitor that sits in the system tray is {{AUR|batterymon}} which can be found in the [[Arch User Repository|AUR]].
+
Reading battery state can be done in multiple ways. Classical method is some daemon periodically polling battery level using ACPI interface. On some systems, the battery sends events to [[udev]] whenever it (dis)charges by 1%, this event can be connected to some action using a udev rule.
  
{{Tip|More information can be found in the [[ACPI modules]] article.}}
+
==== ACPI ====
  
* {{AUR|batterymon-clone}} is a simple battery monitor tray icon using acpi.
+
Battery state can be read using ACPI utilities from the terminal. ACPI command line utilities are provided via the {{Pkg|acpi}} package. See [[ACPI modules]] for more information.
* {{pkg|batti}} is a simple battery monitor for the system tray, similar to batterymon. Unlike the latter {{ic|batti}} uses UPower, and if that is missing DeviceKit.Power, for it's power information.
+
  
=== Suspend and Hibernate ===
+
* {{Pkg|cbatticon}} is a lightweight and fast battery icon that sits in the system tray.
 +
* {{AUR|batterymon-clone}} is a simple battery monitor that sits in the system tray, similar to batti.
  
Manually suspending the operating system, either to memory (standby) or to disk (hibernate) sometimes provides the most efficient way to optimize battery life, depending on the usage pattern of the laptop. While there is relatively straightforward support in the linux kernel to support these operations, typically some adjustments have to made before initiating these operations (typically due to problematic drivers, modules or hardware). The following tools provide wrappers around the kernel interfaces to suspend/resume :
+
==== hibernate on low battery level ====
  
* [[Acpid]]
+
If your battery sends events to [[udev]] whenever it (dis)charges by 1%, you can use this udev rule to automatically hibernate the system when battery level is critical, and thus prevent all unsaved work from being lost.
* [[Pm-utils]]
+
* [[Uswsusp]]
+
  
which are described in more detail in [[Suspend]].
+
{{Note|This rule will be repeated whenever the condition is set. As such, when resuming from hibernate when the battery is critical, the computer will hibernate directly. Some laptops do not boot beyond a certain battery level, so the rule below could be adjusted accordingly.}}
  
===Power saving===
+
{{hc|/etc/udev/rules.d/99-lowbat.rules|<nowiki>
 +
# Suspend the system when battery level drops to 5% or lower
 +
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/bin/systemctl hibernate"
 +
</nowiki>}}
 +
Batteries can jump to a lower value instead of discharging continuously, therefore a udev string matching pattern for all capacities 0 through 5 is used.
  
See the main article, [[power saving]].
+
Other rules can be added to perform different actions depending on power supply status and/or capacity.
  
==== Automatic tweaks for battery life ====
+
If your system has no or missing ACPI events, use [[cron]] with the following script:
  
As opposed to manually initiated actions like suspend/hibernate, a number of tweaks can be made to prolong the battery life of the laptop under low/idle usage.
+
{{bc|<nowiki>
 +
#!/bin/sh
 +
acpi -b | awk -F'[,:%]' '{print $2, $3}' | {
 +
read -r status capacity
  
* [[CPU Frequency Scaling]] is a technology used primarily by notebooks which enables the OS to scale the CPU frequency up or down, depending on the current system load and/or power scheme.
+
if [ "$status" = Discharging -a "$capacity" -lt 5 ]; then
* [[Laptop Mode Tools]] provides a comprehensive suite of tools to tweak a large number of power saving settings through well documented configuration files.
+
logger "Critical battery threshold"
* [[Powertop]] is a handy utility from Intel that displays which hardware/processes are using the most power on your system, and provides instructions on how to stop or remove power-wasting services. Works great for mobile Intel CPUs; provides the current CPU state and suggestions for power saving. Also works on AMD systems, but does not provide as much information about the CPU state.
+
systemctl hibernate
 
+
fi
The following options are specific to certain laptop types:
+
}</nowiki>
 
+
* [[Asus_G1#The_Lapsus_daemon_.26_KDE_applet|Lapsus]] is a set of programs providing easy access to many features of various laptops. It currently supports most features provided by asus-laptop kernel module from ACPI4Asus project, such as additional LEDs, hotkeys, backlight control etc. It also has support for some IBM laptops features provided by IBM ThinkPad ACPI Extras Driver and NVRAM device.
+
* Battery tweaks for Thinkpads can be found in the [[tp_smapi]] article.
+
* [[TLP]] for Thinkpads is a set of scripts, which set many powersaving options according to the current Powersource. [[TLP]] is intended to be used on Thinkpads, but most settings should work on other laptops too.
+
 
+
====PCI-e ASPM====
+
On some laptops, powertop suggests enabling the {{ic|CONFIG_PCIEASPM}} kernel option. It can be found under "Bus options (PCI etc.)"->"PCI Express ASPM support". This option is marked as experimental in the current kernel (2.6.35) and allows the PCI-e links to enter a power saving state.
+
 
+
According to [http://www.lesswatts.org/projects/devices-power-management/pcie.php], this option might degrade performance a bit, but on an Acer 3820TG laptop, it can reduce power consumption by about one third or even more.
+
 
+
More experience with this setting would be appreciated, so please share them [https://bbs.archlinux.org/viewtopic.php?id=107173 here]!
+
 
+
It seems like the option is going to be enabled by default in kernel 2.6.36; if so, the information here will be obsolete soon. However, if your system should be able to make use of this power management feature but you are receiving messages like like the following (check {{ic|/var/log/everything.log*}}):
+
 
+
disabling ASPM on pre-1.1 PCI-e device.  You can enable it with 'pcie_aspm=force'
+
 
+
then add {{ic|pcie_aspm<nowiki>=</nowiki>force}} to your kernel command line.
+
 
+
==== Granola ====
+
 
+
{{Out of date|Arch Linux has moved to systemd, so rc.conf is no longer used.}}
+
 
+
[https://aur.archlinux.org/packages.php?ID=36841 Granola] is a daemon that monitors the cpu usage and uses the cpufreq-userspace module to lessen power usage without any noticeable difference in performance.
+
To use it, first install from the AUR:[https://aur.archlinux.org/packages.php?ID=36841], the default settings will work for most setups.
+
You will need to load the cpufreq_userspace module, as well as the cpufreq scaling governor for your CPU at startup.
+
Edit {{ic|/etc/rc.conf}}:
+
For most generic cpus:
+
 
+
  MODULES=( ... cpufreq_userspace acpi-cpufreq ... )
+
 
+
For Intel Atom or Pentium 4 cpus:
+
 
+
  MODULES=( ... cpufreq_userspace p4_clockmod ... )
+
 
+
Then add Granola to the DAEMONS array:
+
 
+
  DAEMONS=( ... granola ... )
+
 
+
and reboot.
+
 
+
To test if it worked, run:
+
 
+
  cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
+
  #OR
+
  cpufreq-info #if you have cpufreq-utils installed
+
 
+
and check that the cpu frequency is below maximum.
+
 
+
====WLAN-device====
+
When often en route working with your Notebook without WLAN-Access around, it might be expedient to add a little script to your system startup that automatically turns off your WLAN-Hardware to keep it from searching for Access Points and wasting power on this, when not connected:
+
+
#!/bin/bash
+
+
essid="`iwconfig wlan0 | grep ESSID | awk {'print $4'}`"
+
if [ "$essid" == "ESSID:off/any" ] ; then
+
sudo iwconfig wlan0 txpower off
+
fi
+
[edit, if wlan0 is not your WLAN-device]
+
 
+
Start the script according to your DE/WM options by '(sleep xx && /path/to/script)' depending on how long it usually takes to connect to your Access Point, 60 seconds are a good default value. It will check if you're connected, turning off the device if not.
+
sudo iwconfig wlan0 txpower on
+
will bring it back up, as, of course, a reboot will.
+
 
+
==== Disk-related tweaks ====
+
Disable file access time: every time you access (read) a file the filesystem writes an access time to the file metadata. You can disable this on individual files by using the chattr command, or you can enable it on an entire disk by setting the ''noatime'' option in your fstab, as follows:
+
 
+
/dev/sda1          /          ext3          defaults,noatime          1  2
+
 
+
[http://www.faqs.org/docs/securing/chap6sec73.html Source]
+
 
+
{{Note|
+
* Disabling {{ic|atime}} causes troubles with [[Mutt|mutt]] and other applications that make use of file timestamps. Consider compromising between performance and compatibility by using mount option {{ic|relatime}} instead, or look into [http://wiki.mutt.org/?MaildirFormat mutt work-around for noatime].
+
* {{ic|relatime}} is used by default as of kernel 2.6.30, so unless you're using an older kernel, there should be no need to edit fstab.
+
 
}}
 
}}
  
To allow the CD/DVD rom to spin down after a while using [[udisks]]:
+
===== Testing events =====
  
# udisks --inhibit-polling /dev/sr0
+
One way to test udev rules is to have them create a file when they are run. For example:
  
==== More tweaks ====
+
{{hc|/etc/udev/rules.d/98-discharging.rules|<nowiki>
These are some generic suggestions that will work with most laptops.
+
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", RUN+="/usr/bin/touch /home/example/discharging"
 +
</nowiki>}}
  
Add the following to {{ic|/etc/modprobe.d/modprobe.conf}}:
+
This creates a file at {{ic|/home/example/discharging}} when the laptop charger is unplugged. You can test whether the rule worked by unplugging your laptop and looking for this file. For more advanced udev rule testing, see [[Udev#Testing rules before loading]].
  
options usbcore autosuspend=1
+
=== Suspend and Hibernate ===
  
Add the following to {{ic|/etc/sysctl.conf}}
+
Manually suspending the operating system, either to memory (standby) or to disk (hibernate) sometimes provides the most efficient way to optimize battery life, depending on the usage pattern of the laptop.
  
vm.dirty_writeback_centisecs=1500
+
See the main article [[Suspend and hibernate]].
vm.laptop_mode=5
+
  
{{Note|''laptop-mode-tools'' automatically rewrites these values based on the values {{Ic|LM_BATT_MAX_LOST_WORK_SECONDS}}, {{Ic|LM_AC_MAX_LOST_WORK_SECONDS}} (both multiplied by 100) resp. {{Ic|LM_SECONDS_BEFORE_SYNC}}, which are set in {{ic|/etc/laptop-mode/laptop-mode.conf}}. However, that only happens if the three "Enable laptop mode" variables in the same file are set accordingly — left to 0, it resets the values to kernel defaults (500 / 0) for the corresponding scenario regardless of {{ic|/etc/sysctl.conf}}.}}
+
=== Hard drive spin down problem ===
  
{{accuracy|reason=This belongs in a udev rule, not rc.local.}}
+
Documented [https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695 here].
  
Add the following to {{ic|/etc/rc.local}} (and make sure it gets executed at boot time)
+
To prevent your laptop hard drive from spinning down too often, set less aggressive power management as described in [[hdparm#Power management configuration]]. Even the default values may be too aggressive.
  
/usr/sbin/iwpriv your_wireless_interface set_power 5
+
== Hardware support ==
  
Source: [http://www.nervous.it/2007/11/linux-dell-xps-m1330/ here]
+
=== Screen brightness ===
  
==== Hard drive spin down problem ====
+
See [[Backlight]].
Documented [https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695 here]
+
  
To prevent your laptop hard drive from spinning down too often (result of too aggressive APM defaults) do the following:
+
=== Touchpad ===
  
Add the following to {{ic|/etc/rc.local}}
+
To get your touchpad working properly, see the [[Touchpad Synaptics]] page. Note that your laptop may have an ALPS touchpad (such as the DELL Inspiron 6000), and not a Synaptics touchpad. In either case, see the link above.
  
hdparm -B 254 /dev/sdX ''where X is your hard drive device''
+
=== Fingerprint Reader ===
  
You can also set it to 255 to completely disable spinning down.  You may wish to set a lower value if you move your laptop around as lower values park the heads more often and reduce the chance of damage to your hard disk while it is being moved.  If you do not move your laptop at all when you are using it, then 255 or 254 is probably best.  If you do, then you might want to try a lower value.  A value like 128 might be a good middle-ground.
+
See [[Fingerprint-gui]], [[fprint]] and [[ThinkFinger]] (for ThinkPads).
  
Add the following to {{ic|/etc/pm/sleep.d/50-hdparm_pm}}
+
=== Webcam ===
+
#!/bin/sh
+
 
+
if [ -n "$1" ] && ([ "$1" = "resume" ] || [ "$1" = "thaw" ]); then
+
hdparm -B 254 /dev/your-hard-drive > /dev/null
+
fi
+
  
and run ''chmod +x /etc/pm/sleep.d/50-hdparm_pm'' to make sure it resets after suspend.  Again, you can change the value 254 as you see fit.
+
See [[Webcam setup]].
  
Now the APM level should be set for your hard drive.
+
=== Hard disk shock protection ===
  
For some laptops, the option -S to hdparm can also be relevant (sets the spindown time for the drive). Note that all these options can also be configured using the [[Laptop_Mode_Tools | laptop-mode tools]].  This will allow you to set a high value when on AC and a lower value when you are running on battery power.
+
There are several laptops from different vendors featuring shock protection capabilities. As manufacturers have refused to support open source development of the required software components so far, Linux support for shock protection varies considerably between different hardware implementations.
  
=== Using a script and an udev rule ===
+
Currently, two projects, named [[HDAPS]] and [[Hpfall]] (available in the [[AUR]]), support this kind of protection. HDAPS is for IBM/Lenovo Thinkpads and hpfall for HP/Compaq laptops.
Since systemd users can suspend and hibernate through {{ic|systemctl suspend}} or {{ic|systemctl hibernate}} and handle acpi events with {{ic|/etc/systemd/logind.conf}}, it might be interesting to remove pm-utils and acpid. Now, there's just one thing systemd can't do (at this time of writing): powermanagement, depending on whether the system is running on AC or battery. To fill this gap, one can create a single udev rule that launches a script when the laptop is unplugged and plugged:
+
{{hc|/etc/udev/rules.d/powersave|2=<nowiki>
+
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="/path/to/your/script true"
+
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/path/to/your/script false"
+
</nowiki>}}
+
{{Note|One can use the same script that pm-powersave uses. You just have to make it executable and place it somewhere else (for example, /usr/bin).}}
+
An example of a powersave script can be found here: [https://bbs.archlinux.org/viewtopic.php?pid=1046075#p1046075] (or in aur: {{AUR|powerdown}}) and here: [https://github.com/Unia/powersave].
+
  
The above udev rule should work as expected, but if your power settings aren't updated after a suspend or hibernate cycle, you should add a script in {{ic|/usr/lib/systemd/system-sleep/}} with the following contents:
+
=== Hybrid graphics ===
{{hc|/usr/lib/systemd/system-sleep/00powersave|<nowiki>
+
#!/bin/sh
+
  
case $1 in
+
The laptop manufacturers developed new technologies involving two graphic cards in an single computer, enabling both high performance and power saving usages. These laptops usually use an Intel chip for display by default, so an [[Intel graphics]] driver is needed first. Then you can [[Hybrid graphics|choose methods]] to utilize the second graphics chip.
    pre) /path/to/your/script false ;;
+
    post)     
+
if cat /sys/class/power_supply/AC0/online | grep 0 > /dev/null 2>&1
+
then
+
    /path/to/your/script true
+
else
+
    /path/to/your/script false
+
fi
+
    ;;
+
esac'
+
exit 0
+
</nowiki>}}
+
  
Don't forget to make it executable!
+
== Network time syncing ==
{{Note|Be aware that AC0 may be different for your laptop, change it if that is the case.}}
+
  
Now you don't need pm-utils anymore. Depending on your configuration, it may be a dependency of some other package. If you wish to remove it anyway, run {{ic|pacman -Rdd pm-utils}}.
+
For a laptop, it may be a good idea to use [[Chrony]] as an alternative to [[NTPd]] or [[OpenNTPD]] to sync your clock over the network. Chrony is designed to work well even on systems with no permanent network connection (such as laptops), and is capable of much faster time synchronisation than standard ntp. Chrony has several advantages when used in systems running on virtual machines, such as a larger range for frequency correction to help correct quickly drifting clocks, and better response to rapid changes in the clock frequency. It also has a smaller memory footprint and no unnecessary process wakeups, improving power efficiency.
  
== Screen brightness ==
+
== See also ==
{{Merge|Backlight}}
+
To change your display brightness, first check {{ic|/sys/class/backlight}}:
+
  
    # ls /sys/class/backlight/
+
; General
    intel_backlight
+
* [[CPU frequency scaling]] is a technology used primarily by notebooks which enables the OS to scale the CPU frequency up or down, depending on the current system load and/or power scheme.
 +
* [[Display Power Management Signaling]] describes how to automatically turn off the laptop screen after a specified interval of inactivity (not just blanked with a screensaver but completely shut off).
 +
* [[Wireless network configuration]] provides information about setting up wireless connection.
 +
* [[Extra keyboard keys]] describes configuration of Media keys.
 +
* [[acpid]] which is a flexible and extensible daemon for delivering ACPI events.
  
So this particular backlight is managed by an Intel card. Keep in mind that different cards might manage this differently! It is called ''acpi_video0'' on an ATI card, for instance.
+
; Pages specific to certain laptop types
 +
* See [[:Category:Laptops]] and its subcategories for pages dedicated to specific models/vendors.
 +
* Battery tweaks for ThinkPads can be found in [[TLP]] and the [[tp_smapi]] article.
 +
* [[Acer Aspire One#acerhdf|acerhdf]] is a kernel module for controlling fan speed on Acer Aspire One and some Packard Bell Notebooks.
  
Check current value:
+
; External resources
 
+
* [http://www.linux-on-laptops.com/ http://www.linux-on-laptops.com/]
    $ cat /sys/class/backlight/intel_backlight/brightness
+
* [http://www.linlap.com/ http://www.linlap.com/]
 
+
In this case, the backlight managed by echoing values into {{ic|/sys/class/backlight/intel_backlight/brightness}}:
+
 
+
    # echo "400" > /sys/class/backlight/intel_backlight/brightness
+
 
+
If you get a response along the lines of "invalid argument" then you didn't honor the maximum brightness. Obviously you cannot go any higher than your screens maximum brightness. The values for maximum brightness and brightness in general vary wildly among cards. This Intel card, for instance, can go up to 976 while the ATI can go up 9. Obviously these values don't say anything about maximum effective brightness.
+
 
+
Check your maximum brightness:  
+
 
+
    $ cat /sys/class/backlight/intel_backlight/max_brightness
+
 
+
If your laptop's Fn keys don't work or Gnome/KDE fail to correctly set the brightness using their power daemons, you can try appending '''acpi_backlight=vendor''' to your kernel line in your bootloader.
+
 
+
=== setpci fallback method ===
+
{{Warning| The setpci command edits hardware parameters. Use with caution.}}
+
On some laptops, the above methods do not actually change screen brightness. If this is the case for your laptop, first find the domain and bus using lspci:
+
    $ lspci
+
    (...)
+
    00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 09)
+
    (...)
+
Now use setpci to change the value at slot F4 to, say, a0:
+
    # setpci -s 00:02.0 f4.b=a0
+
The {{ic|.b}} indicates a byte value; this runs in hexadecimal from {{ic|00}} to {{ic|ff}}. '''ff''' Is usually the brightest, although this may be reversed. See [https://bbs.archlinux.org/viewtopic.php?pid=1088825#p1088825 here] for a script which can be used with brightness keys.
+
 
+
== Touchpad ==
+
To get your touchpad working properly, see the [[Touchpad Synaptics]] page. Note that your laptop may have an ALPS touchpad (such as the DELL Inspiron 6000), and not a Synaptics touchpad. In either case, see the link above.
+
 
+
== Hard disk shock protection ==
+
There are several laptops from different vendors featuring shock protection capabilities. As manufacturers have refused to support open source development of the required software components so far, Linux support for shock protection varies considerably between different hardware implementations.
+
 
+
Currently, two projects, named HDAPS and hpfall, support this kind of protection.
+
HDAPS is for IBM/Lenovo Thinkpads and hpfall for HP/Compaq laptops
+
 
+
Just Check [[HDAPS|Hard Disk Active Protection System]].
+
{{AUR|hpfall}} can be installed from the [[AUR]].
+
 
+
== Network Time Syncing ==
+
For a laptop, it may be a good idea to use [[Chrony]] as an alternative to [[NTPd]] to sync your clock over the network. Chrony is designed to work well even on systems with no permanent network connection (such as laptops), and is capable of much faster time synchronisation than standard ntp. Chrony has several advantages when used in systems running on virtual machines, such as a larger range for frequency correction to help correct quickly drifting clocks, and better response to rapid changes in the clock frequency. It also has a smaller memory footprint and no unnecessary process wakeups, improving power efficiency.
+

Latest revision as of 02:55, 6 April 2016

This Laptop main page contains links to article (sections) needed for configuring a laptop for the best experience. Setting up a laptop is in many ways the same as setting up a desktop. However, there are a few key differences. Arch Linux provides all the tools and programs necessary to take complete control of your laptop. These programs and utilities are highlighted below, with appropriate tips tutorials.

To gain an overview of the reported/achieved Linux hardware compatibility of a particular laptop model, see the results per vendor of below subpages.

Laptop main page
Acer - Apple - Asus - Compaq - Dell - Fujitsu - HP - IBM/Lenovo - Samsung - Sony - Toshiba - Other

If there are laptop model specific instructions, the respective article is crosslinked in the first column of the vendor subpages. In case the model is not listed in the vendor table, existing instructions of similar models via the Category:Laptops vendor subcategory may help.

Power management

Note: You should read the main article Power management. Additional laptop-specific features are described below.

Power management is very important for anyone who wishes to make good use of their battery capacity. The following tools and programs help to increase battery life and keep your laptop cool and quiet.

Battery state

Reading battery state can be done in multiple ways. Classical method is some daemon periodically polling battery level using ACPI interface. On some systems, the battery sends events to udev whenever it (dis)charges by 1%, this event can be connected to some action using a udev rule.

ACPI

Battery state can be read using ACPI utilities from the terminal. ACPI command line utilities are provided via the acpi package. See ACPI modules for more information.

  • cbatticon is a lightweight and fast battery icon that sits in the system tray.
  • batterymon-cloneAUR is a simple battery monitor that sits in the system tray, similar to batti.

hibernate on low battery level

If your battery sends events to udev whenever it (dis)charges by 1%, you can use this udev rule to automatically hibernate the system when battery level is critical, and thus prevent all unsaved work from being lost.

Note: This rule will be repeated whenever the condition is set. As such, when resuming from hibernate when the battery is critical, the computer will hibernate directly. Some laptops do not boot beyond a certain battery level, so the rule below could be adjusted accordingly.
/etc/udev/rules.d/99-lowbat.rules
# Suspend the system when battery level drops to 5% or lower
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/bin/systemctl hibernate"

Batteries can jump to a lower value instead of discharging continuously, therefore a udev string matching pattern for all capacities 0 through 5 is used.

Other rules can be added to perform different actions depending on power supply status and/or capacity.

If your system has no or missing ACPI events, use cron with the following script:

#!/bin/sh
acpi -b | awk -F'[,:%]' '{print $2, $3}' | {
	read -r status capacity

	if [ "$status" = Discharging -a "$capacity" -lt 5 ]; then
		logger "Critical battery threshold"
		systemctl hibernate
	fi
}
Testing events

One way to test udev rules is to have them create a file when they are run. For example:

/etc/udev/rules.d/98-discharging.rules
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", RUN+="/usr/bin/touch /home/example/discharging"

This creates a file at /home/example/discharging when the laptop charger is unplugged. You can test whether the rule worked by unplugging your laptop and looking for this file. For more advanced udev rule testing, see Udev#Testing rules before loading.

Suspend and Hibernate

Manually suspending the operating system, either to memory (standby) or to disk (hibernate) sometimes provides the most efficient way to optimize battery life, depending on the usage pattern of the laptop.

See the main article Suspend and hibernate.

Hard drive spin down problem

Documented here.

To prevent your laptop hard drive from spinning down too often, set less aggressive power management as described in hdparm#Power management configuration. Even the default values may be too aggressive.

Hardware support

Screen brightness

See Backlight.

Touchpad

To get your touchpad working properly, see the Touchpad Synaptics page. Note that your laptop may have an ALPS touchpad (such as the DELL Inspiron 6000), and not a Synaptics touchpad. In either case, see the link above.

Fingerprint Reader

See Fingerprint-gui, fprint and ThinkFinger (for ThinkPads).

Webcam

See Webcam setup.

Hard disk shock protection

There are several laptops from different vendors featuring shock protection capabilities. As manufacturers have refused to support open source development of the required software components so far, Linux support for shock protection varies considerably between different hardware implementations.

Currently, two projects, named HDAPS and Hpfall (available in the AUR), support this kind of protection. HDAPS is for IBM/Lenovo Thinkpads and hpfall for HP/Compaq laptops.

Hybrid graphics

The laptop manufacturers developed new technologies involving two graphic cards in an single computer, enabling both high performance and power saving usages. These laptops usually use an Intel chip for display by default, so an Intel graphics driver is needed first. Then you can choose methods to utilize the second graphics chip.

Network time syncing

For a laptop, it may be a good idea to use Chrony as an alternative to NTPd or OpenNTPD to sync your clock over the network. Chrony is designed to work well even on systems with no permanent network connection (such as laptops), and is capable of much faster time synchronisation than standard ntp. Chrony has several advantages when used in systems running on virtual machines, such as a larger range for frequency correction to help correct quickly drifting clocks, and better response to rapid changes in the clock frequency. It also has a smaller memory footprint and no unnecessary process wakeups, improving power efficiency.

See also

General
  • CPU frequency scaling is a technology used primarily by notebooks which enables the OS to scale the CPU frequency up or down, depending on the current system load and/or power scheme.
  • Display Power Management Signaling describes how to automatically turn off the laptop screen after a specified interval of inactivity (not just blanked with a screensaver but completely shut off).
  • Wireless network configuration provides information about setting up wireless connection.
  • Extra keyboard keys describes configuration of Media keys.
  • acpid which is a flexible and extensible daemon for delivering ACPI events.
Pages specific to certain laptop types
  • See Category:Laptops and its subcategories for pages dedicated to specific models/vendors.
  • Battery tweaks for ThinkPads can be found in TLP and the tp_smapi article.
  • acerhdf is a kernel module for controlling fan speed on Acer Aspire One and some Packard Bell Notebooks.
External resources