There is a great article in Arch Linux Wiki [3] on what works, what
doesn't, useful tips, etc. Other than that, here are bits of my experience
with the laptop.
Brightness adjustments
With CABC disabled, black terminal is still too dark, and browser window
/ PDFs are too bright, and I had to adjust brightness manually after each
switch.
In my usecase it's easy to adjust brightness automatically. I use Awesome
WM with 14 virtual desktops. 1..6, 12..14 are typically used for terminals,
while 7..11 are reserved for browsers, PDF datasheets, etc. So in this
config it makes sense to use common backlight brightness level that is
manually adjusted depending on environment, and then have a static but yet
configurable offset for each desktop. It's easy to do with some program
that is called on global and local brightness up / down events and desktop
switch events.
First I've considered doing it with a python script, but it has to run with
root privileges to modify backlight brightness, and setting suid on
scripts is problematic. So here is a rust solution [4] that compiles
to a binary. The binary should be tied to keyboard controls, so below are
excerpts from related configs. It's assumed that the binary is copied into
/usr/local/bin/ and has suid bit set.
/etc/acpi/events/backlight_up:
event=video/brightnessup
action=/usr/local/bin/backlight adjust_global 1
/etc/acpi/events/backlight_down:
event=video/brightnessdown
action=/usr/local/bin/backlight adjust_global -1
Patch ~/.config/awesome/rc.lua to use keys q, w, e to reset,
decrease and increase virtual desktop's local brightness adjustment, and
do correction on desktop switch.
-- {{{ Key bindings
globalkeys = awful.util.table.join(
awful.key({ modkey, }, "q", function () awful.spawn("/usr/local/bin/backlight set_local 0") end),
awful.key({ modkey, }, "w", function () awful.spawn("/usr/local/bin/backlight adjust_local -1") end),
awful.key({ modkey, }, "e", function () awful.spawn("/usr/local/bin/backlight adjust_local 1") end),
...
)
--- in the end of file:
tag.connect_signal("property::selected", function (tag)
local active = ""
for i, tag in pairs(awful.screen.focused().tags) do
if tag.selected then
active = active .. " " .. i
end
end
awful.spawn("/usr/local/bin/backlight switch_desktop "..active)
end)
[1] http://www.dell.com/support/home/us/en/04/drivers/driversdetails?driverId=312K3 (Firmware Update for enabling or disabling Dynamic Brightness Control)
[2] https://github.com/kvalo/ath10k-firmware
[3] https://wiki.archlinux.org/index.php/Dell_XPS_13_(9360)
[4] https://gitlab.com/amorozov/awesome-xps-backlight