Prevent Remote Desktop Sleep: A Simple systemd-inhibit Trick
2025-09-18

Frustrated by remote desktop sessions being interrupted by your computer going to sleep? This article presents a clever solution using the `systemd-inhibit` command and bash aliases. Two simple commands, `block` and `unblock`, are created. `block` starts a background process preventing sleep, while `unblock` kills that process, allowing the system to sleep. No complex configuration needed; just add two lines to your `.bashrc` or `.zshrc` to solve this common problem and improve your workflow.
Development
remote desktop