Laptop Tweaks 🔼
Do not shut down display when lid is closed 🔼
How to keep external display devices going while your notebook's lid is closed.
elogind 🔼
In file /etc/elogind/logind.conf set
#HandleLidSwitch=suspend
HandleLidSwitch=ignore
Have a look at man logind.conf for more possible actions.
ACPI 🔼
On systems without elogind ACPI applies. The following is from memory and I can't recall exactly why I did it that way and I do not have a system right now for testing. Please report if your experience differs! Create a file /etc/acpi/fakelid.sh with content:
#!/bin/sh
exit 0
(Making that file executable might be required as well: chmod ugo+x /etc/acpi/fakelid.sh)
Edit /etc/acpi/events/lidbtn adding a new action=:
# /etc/acpi/events/lidbtn
# Called when the user closes or opens the lid
event=button[ /]lid
## Uncomment following line to shut down displays on lid close:
#action=/etc/acpi/lid.sh
## Uncomment following line for no action on lid close:
action=/etc/acpi/fakelid.sh
HDMI and audio output 🔼
In case a laptop running plain ALSA and is configured for analogue audio (AKA internal speakers / headphone jack) but occasionally needs to output via HDMI. Most GUI video players probably have an option to set the output device.
To find the card and device of the HDMI output run aplay -l | grep HDMI.
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
This translates to 3rd device on card 0: plughw=0.3
Depending on ones graphics hardware the output might differ:
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
In that case one has give all three a trial to find the proper one. Unfortunately sometimes the device numbers change. (In case someone has a solution to prevent that, please report!)
Non-GUI movie players require a command line option, for mplayer and mpv that'd be:
-ao alsa:device=plughw=0.3
Creating an alias in ~/.bashrc (or ~/.bash_aliases) does help:
alias hdmi-mplayer='mplayer -ao alsa:device=plughw=0.3'
Touchpad tapping 🔼
xorg.conf 🔼
Having package xserver-xorg-input-libinput being installed is required. To enable tapping permanently we tell the X-server to do so:
cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
Edit /etc/X11/xorg.conf.d/40-libinput.conf and add the line Option "Tapping" "on" to the "libinput touchpad catchall" section:
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "Tapping" "on"
After restarting the X-server tapping should™ be enabled. If this does not work for your notebook having a look at package xserver-xorg-input-synaptics might help. Please report!
Bash script 🔼
Most of the time having tapping enabled is quite a convenience. But with a traditional typewriter education, accidently tapping with ones thumbs is a common occurrence. For that and other cases temporarily disabling it is an option. NOTE: This mainly is helpful when there is a mouse attached to the notebook or one is familiar navigating the menu using the keyboard! A simple bash script $HOME/bin/toggle_tapping.sh will do:
#!/bin/bash
# toggle_tapping.sh
# Return Codes: 0=success; 1=no touchpad found
# Are we able to find a touchpad? Based on command:
# xinput --list
TouchpadID=$(xinput --list | grep Touchpad)
TouchpadNotFound=$?
if [ $TouchpadNotFound -eq 1 ]; then
echo "No touchpad has been reported!"
exit 1
fi
# Reduce recovered string to the touchpad's pure ID:
TouchpadID=${TouchpadID##*=}
TouchpadID=${TouchpadID[*}
# Assess TappingID of found touchpad based on command:
# xinput --list-props $TouchpadID
TappingID=$(xinput --list-props $TouchpadID | grep "Tapping Enabled (")
TappingID=${TappingID##*(}
TappingID=${TappingID)*}
# Assess state
TappingState=$(xinput --list-props $TouchpadID | grep $TappingID)
TappingState=${TappingState##*:}
# Toggle state
if [ $TappingState -eq 0 ]; then
xinput --set-prop $TouchpadID $TappingID 1
else
xinput --set-prop $TouchpadID $TappingID 0
fi
exit 0
Make that script executable: chmod u+x $HOME/bin/toggle_tapping.sh
To execute this script from within a desktop environment creating a $HOME/Desktop/tapping.desktop file is an option:
[Desktop Entry]
Name=Toggle Tapping
Exec=/home/XXXXX/bin/toggle_tapping.sh
Terminal=false
Type=Application
Icon=/usr/share/icons/gnome/48x48/devices/input-touchpad.png
Categories=System
Please, replace the XXXXX part with your user's name! An altenative location for the .dektop file could be $HOME/.local/share/applications. In this case the Categories= option decides in which category of the menu the script shows up. For fluxbox a convenient way to run that script could be adding an option to its ($HOME/.fluxbox/menu) file:
[exec] (Toggle Tapping) {xterm -e toggle_tapping.sh} </usr/share/icons/gnome/48x48/devices/input-touchpad.png>