# Laptop specific
resume=/dev/sdxYto the kernel, where
xis your device and
Yis your SWAP partition.
- Add the
resumehook to your
etc/mkinitcpio.conffile and regenerate the initramfs afterwards. In case of making encryption,
keyboardshould be placed before
encrypt, because you will not able to decrypt without keyboard.
# find HOOKS in mkinitcpio.conf and it should look similar: HOOKS=(base udev autodetect mdconf block filesystem resume keyboard fsck) #You should put 'resume' after udev
To regenerate the initramfs, run this in the terminal:
mkinitcpio -p linux
/etc/systemd/logind.conf and change
It could be useful to check suspend and hibernate wiki article.
# Nvidia hybrid graphics
This part may cause hangs or another graphical problems, check twice!
For laptops with hybrid Intel/NVIDIA graphics, you should read bumblebee article first.
If you have lockup issues read this.
- Install dependencies
sudo pacman -S mesa mesa-demos bumblebee bbswitch primus xf86-video-intel
Use pacman to install appropriate driver, DO NOT download it from the official website!
There are different versions of appropriate drivers, you can check it with NVIDIA driver download website.
- Add active user to bumblebee group
gpasswd -a your_user_name bumblebee
- Enable bumblebee service
sudo systemctl enable bumblebeed.service
... Bridge=primus #Switch from 'auto' ... [driver-nvidia] PMMethod=bbswitch #Enable NVIDIA card after waking from suspend
- And define your card in
/etc/bumblebee/xorg.conf.nvidia, using correct BusID according to
... BusID "PCI:1:0:0" ...
Observe that the format of
lspci is HEX, whilee in xorg it's decimals.
So if the output for example
BusID shoud be
00:02.0 will be
- Test your card
optirun glxspheres64 # You can run this only in graphical environment.
If you have a hang just before X loaded, try to force xorg.conf to use only intel device, you can see the example in my dotfiles.
# Nvidia settings
If you want more control over the graphical interface or cli, you can install
nvidia-settings, and run it with optirun e.g.:
optirun nvidia-settings -c :8
# Laptop Specific Keybindings
You have several options how to manage keyboard backlight, for Asus I picked the asus-kbd-backlight.
yay -S asus-kbd-backlight sudo systemctl enable asus-kbd-backlight.service #enable a service to allow user permissions
asus-kbd-backlight up asus-kbd-backlight down asus-kbd-backlight max asus-kbd-backlight off asus-kbd-backlight night asus-kbd-backlight 2 asus-kbd-backlight show
You can bind any commands to your xF86XK media keys now:
0 here is your
fn button (
((0, xF86XK_KbdBrightnessUp ), spawn "asus-kbd-backlight up" ) -- F3 Keyboard backlight up ((0, xF86XK_KbdBrightnessDown), spawn "asus-kbd-backlight down") -- F4 Keyboard backlight down
Keyboard backlight should work automatically with any recent kernel.
Desktop environments that use UPower, like GNOME or KDE,
work out the box and don't need any tool or script to register the keys and change the keyboard brightness.