90% of the machine works out of the box with a recent Debian. Wifi, USB, the SD card reader, even suspend/resume.
The model I have is the 2020 17" model; 17Z90N (which is the US not the Australian model). I've installed a 1Tb NVME drive, and am running Debian Unstable on it.
Two things amaze me: it's only around 1.3kg; and the battery lasts
a
The few things that do not work out of the box are:
Apart from the fingerprint reader, all these can be fixed. Battery care needs a patch that is in kernel 5.15 --- Debian Testing And Unstable have this.
ACTION=="add",SUBSYSTEM=="platform", \
RUN+="/bin/chgrp video /sys/devices/platform/lg-laptop/reader_mode"
ACTION=="add",SUBSYSTEM=="platform",\
RUN+="/bin/chmod 0664 /sys/devices/platform/lg-laptop/reader_mode"
Put this into /etc/udev/rules.d/90-lg-platform.rules — it will make it possible for the person logged into the laptop to change the LED.
Install the sct tool (on Debian or Ubuntu, apt install sct) Create a script in ~/bin/readermode or another convenient place.
#!/bin/sh
led=/sys/devices/platform/lg-laptop/reader_mode
TOGGLE=$HOME/.toggle_readermode
if [ ! -e $TOGGLE ]
then
> $TOGGLE
sct 4800
echo 1 > $led
else
rm $TOGGLE
echo 0 > $led
sct
fi
Finally bind Fn-F9 to run ~/bin/readermode. I run XFCE4, and can do this from Settings->Keyboard->Application Shortcuts.
LG provide Fn-F5 for disabling the touchpad, so you can type easily without moving the mouse all over the place.
To make it work, create a new file ~/bin/touchpad_toggle containing this:
#!/bin/sh
# This shell script is PUBLIC DOMAIN. You may do whatever you want with it.
TOGGLE=$HOME/.toggle_touchpad
ELAN=`xinput list | sed -n 's/.*ELAN0E03:00 04F3:3121.*id=\([0-9]*\).*/\1/p'`
TP=`xinput list | sed -n 's/.*ELAN0E03:00 04F3:3121 Touchpad.*id=\([0-9]*\).*/\1/p'`
if [ ! -e $TOGGLE ]; then
touch $TOGGLE
for x in $ELAN
do
xinput disable $x
done
echo 0 > /sys/devices/platform/lg-laptop/leds/tpad_led/brightness
notify-send -u low -t 1000 -i mouse --icon=/usr/share/icons/HighContrast/256x256/status/touchpad-disabled.png "Trackpad disabled"
else
rm $TOGGLE
xinput enable $TP
echo 1 > /sys/devices/platform/lg-laptop/leds/tpad_led/brightness
notify-send -u low -t 1000 -i mouse --icon=/usr/share/icons/HighContrast/256x256/devices/input-touchpad.png "Trackpad enabled"
fi
Batteries last a lot longer if they're ony charged to 80%. LG provide a method for doing this; for recent LG Gram models, you'll have to wait for the patch. When you get a suitable kernel (5.15 or later), add
# Restrict charging to 80%
echo 80 > /sys/devices/platform/lg-laptop/battery_care_limit
to /etc/rc.local (make sure it's mode 0744)
and enable rc.local by adding a Systemd unit thus (or use
sysV init):
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Next time you reboot, the charge will max out at 80%.
Some docks seem to work correctly if plugged in at boot, but if they are unplugged and replugged stop working. This is because the BIOS doesn't reserve space for the PCIe hotplug registers.
To fix, add
GRUB_CMDLINE_LINUX_DEFAULT="pci=assign-busses,realloc,hpbussize=0x10,hpmmiosize=128M,hpmmioprefsize=1G"
to /etc/default/grub
and run sudo
update-grub
#!/bin/sh
# Power saving tunables
#
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
#echo '0' > /proc/sys/kernel/nmi_watchdog
# i915
echo 'auto' > '/sys/bus/i2c/devices/i2c-9/device/power/control'
# USB3 port
echo 'auto' > '/sys/bus/pci/devices/0000:00:14.0/power/control'
#Thunderbolt port
echo 'auto' > '/sys/bus/pci/devices/0000:00:07.0/power/control'
# WIFI
echo 'auto' > '/sys/bus/pci/devices/0000:00:14.3/power/control'
# SPI
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.5/power/control'
#??
echo 'auto' > '/sys/bus/pci/devices/0000:00:04.0/power/control'
#
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control'
#
# NVME Disks
echo 'auto' > '/sys/bus/pci/devices/0000:2c:00.0/power/control';
echo 'auto' > '/sys/bus/pci/devices/0000:2c:00.0/power/control'