I have a frame.work ubuntu 21.10 laptop that I connect often to a usb-c hub that has a monitor, keyboard and mouse.
I currently pull my laptop out and plug in the usb-c hub but then open the laptop lid to un suspend, then close the lid to make my main monitor the only display.
I'd like to put the laptop in a holder that would make it difficult to connect to power and open the lid.
When the laptop lid is closed and on battery power, I'd like the laptop to suspend. When the laptop lid is closed and connected to ac power, I'd like the laptop to wake so that I can use it as soon as possible. When the laptop lid is closed and I disconnect ac power, I'd like the laptop to suspend after a few minutes.
If the laptop is connected to AC power, I'd like the power profile set to maximum. If the laptop is on battery, I'd like the power profile set to energy saver.
Is there any app or setting that does this? If not, how do I catch these events and set a service to manage these states?
udev
(user space/dev
) rules. – WinEunuuchs2Unix Mar 03 '22 at 01:11