You are not logged in.
I have my laptop setup to suspend when I close my lid (through systemd-logind).
How can I wake up when connecting external monitor?
Offline
I tried the following udev rule.
The only thing I get is a crash of my Wayland compositor:
ACTION=="change", SUBSYSTEM=="drm", HOTPLUG==1, RUN+="systemctl default"Offline
Offline
The only thing I get is a crash of my Wayland compositor:
No you don't.
default
Enter default mode. This is equivalent to systemctl isolate default.target. This
operation is blocking by default, use --no-block to request asynchronous behavior.
I don't think I've ever seen HDMI causing ACPI events, but
1. udev rules won't help here. Ever. The OS isn't processing anything while in S3
2. If the PCI of your GPU doesn't show up in the wakeup table, there isn't even a remote chance to wake the system by plugging the HDMI
3. A usb dock might work and you'll typically be able to configure the system on any kind of USB action (plugging a usb key)
Sanity check:
The plan isn't to close the display, have it undesiredly enter S3 and then immediately wake it again by plugging the HDMI cable. Is it?
Because then you could just inhibit the lid-sleep, https://man.archlinux.org/man/systemd-inhibit.1.en
Online
No you don't.
So what is "default mode"?
1. udev rules won't help here. Ever. The OS isn't processing anything while in S3
I will double check but I think it was triggered
2. If the PCI of your GPU doesn't show up in the wakeup table, there isn't even a remote chance to wake the system by plugging the HDMI
What is the "wakeup table" and how can I check that?
The plan isn't to close the display, have it undesiredly enter S3 and then immediately wake it again by plugging the HDMI cable. Is it?
Yes it's exactly that
1. Close the lid
2. Plug HDMI
3. Have the system wake up so that I can use the laptop
Because then you could just inhibit the lid-sleep, https://man.archlinux.org/man/systemd-inhibit.1.en
So I should run something like:
sudo systemd-inhibit --what=handle-lid-switch sleep 60before closing the lid?
Isn't there a simpler method?
Last edited by hully (2023-02-03 13:24:44)
Offline
So what is "default mode"?
https://wiki.archlinux.org/title/System … _boot_into
I will double check but I think it was triggered
Not while the system was suspended. That is without a doubt completely impossible.
So I should run something like:
No. Where did you take the "sleep 60" from?
You inhibit handlign the lid switch to not have it idle the system. That's all.
Isn't there a simpler method?
Don't use the lid to suspend the system?
Attach the HDMI output *before* you close the lid?
If you casewise don't want the lid to suspend the system, you'll have to communicate that somehow.
Online
All right.
No. Where did you take the "sleep 60" from?
You inhibit handlign the lid switch to not have it idle the system. That's all.
The doc says it needs a process to run and the action is inhibited as long as that process is running.
sudo systemd-inhibit --what=handle-lid-switchJust returns a table with the current inhibitors.
Then to disable suspend on lid close I have to override logind config with a conf file in `/etc/systemd/logind.conf.d/` right?
Offline
Sorry, I've never used it but … assumed … it could also act as client for org.freedesktop.login1.Manager.Inhibit
https://www.freedesktop.org/wiki/Softwa … d/inhibit/
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.ListInhibitorsBut
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Inhibit string:"handle-lid-switch" string:"me" string:"because" string:"block"returns a file dscriptor (prints an inode) that you'd need to (keep) open for the inhibit to stay, so indeed you'll have to run some stupid dummy process. Sorry.
Online
Actually waybar has a module for inhibiting suspend.
So I can simply click on the module and then connect the monitor.
Seth, I'm getting better at this.
Offline