I first started using Linux and FreeBSD on laptops in the late 1990s. Back then, there were all sorts of hassles and problems, from hangs on suspend to pure failure to boot. I still worry a bit about suspend on unknown hardware, but by and large, the picture of Linux on laptops has dramatically improved over the last years. So much so that now I can complain about what would once have been a minor nit: dealing with external monitors. I have a USB-C dock that provides both power and a Thunderbolt display output over the single cable to the laptop. I think I am similar to most people in wanting the following behavior from the laptop:
- When the lid is closed, suspend if no external monitor is connected. If an external monitor is connected, shut off the built-in display and use the external one exclusively, but do not suspend.
- Lock the screen automatically after a period of inactivity.
- While locked, all connected displays should be powered down.
- When an external display is connected, begin using it automatically.
- When an external display is disconnected, stop using it. If the lid is closed when the external display is disconnected, go into suspend mode.
- In /etc/systemd/logind.conf, there are settings about what to do when the lid is opened or closed.
- Various desktop environments have overlapping settings covering the same things.
- Then there are the display managers (gdm3, lightdm, etc) that also get in on the act, and frequently have DIFFERENT settings, set in different places, from the desktop environments. And, what s more, they tend to be involved with locking these days.
- Then there are screensavers (gnome-screensaver, xscreensaver, etc.) that also enter the picture, and also have settings in these areas.
- Be logged in and using the desktop
- Without locking the desktop screen, switch the display input to another device
- Keep the display input on another device long enough for the desktop screen to auto-lock
- At this point, it is impossible to re-awaken the desktop screen.
sleep-inactive-ac-timeout=60 sleep-inactive-ac-type='blank' sleep-inactive-battery-timeout=120 sleep-inactive-battery-type='suspend'Of course, these overlap with but are distinct from the same kinds of things in Gnome settings. Sway? Running without Gnome seems like a challenge; Gnome is switching audio output appropriately, for instance. I am looking at some of the Gnome Shell tiling window manager extensions and hope that some of them may work for me.