One time suspension of suspension upon lid closing
Assume that I am compiling some big project and want to put my laptop on my bag without stopping the compilation process. Closing the lid put my computer in hibernation. What are the options to stop one time (or some amount of time) the suspension ?
I would like something that does not involve restarting
Prefix the command you want to run with systemd-inhibit to inhibit various possible actions whilst the command runs. See inhibit. The default actions are idle, sleep, and shutdown. You may want to add
systemd-inhibit --what handle-lid-switch:idle:sleep:shutdown cmd args
You may need to be privileged.
- sleep inhibits system suspend and hibernation requested by (unprivileged) users
- shutdown inhibits high-level system power-off and reboot requested by (unprivileged) users
- idle inhibits that the system goes into idle mode, possibly resulting in automatic system suspend or shutdown depending on configuration
- handle-power-key inhibits the low-level (i.e. logind-internal) handling of the system power hardware key, allowing (possibly unprivileged) external code to handle the event instead
- handle-suspend-key inhibits the low-level handling of the system hardware suspend key
- handle-hibernate-key inhibits the low-level handling of the system hardware hibernate key
- handle-lid-switch inhibits the low-level handling of the systemd hardware lid switch