this post was submitted on 19 Mar 2025
19 points (100.0% liked)
Programming
19122 readers
208 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
There is already a separate
systemd-inhibit
command that does exactly what you need. Trust your users, they are capable of googling it (most of the time).Only pacman and wget will benefit from suspend inhibition, because it will prevent breaking network connections. cp and mv will resume working just fine even when you hibernated your laptop while cp was executing. And in that case it's less bug-prone to scan your system for active TCP connections to external addresses instead of adding a hack wakelock inside your terminal or inside wget.
It is also a poor idea to mess up with system-wide settings from some command when the user does not expect it, you'll likely to get a thousand invalid bug reports that sleep mode is broken when some service randomly decides to use wget to continuously read from local Unix socket.
Thanks for this. I now have an idea that would work at least for my case.
So, in case the user runs some long-running command and doesn't remember to use
systemd-inhibit
, but then decides they should have done so (which seems like something that would happen to me a lot), there can be an option in the console to inhibit until the end of said process.Still, automates nothing though, so maybe that's just upto aliases and stuff.
I was thinking in similar lines. Just need to decide what cases are worth keeping on for.
e.g.