description: Makes the power button put your device to sleep (instead of shutting it down) when pressed, and poweroff when long-pressed. This is especially useful for mobile devices like 2in1 tablets, Linux phones, the Steam Deck, or the GPD Win 4 because a) they are suspended often and b) Android/iOS devices gotten us used to this click-to-sleep behavior and with this module, you don't have to worry about accidentally shutting down your device when you act on this instinct (hence the name). Note that your OS must be able to understand /etc/systemd/logind.conf.d/ (which may not be that case if you're running a SystemD-free distro - please consult its manual of your init/LoginD system if you're in this situation) for this module to actually do anything, otherwise it's just writing a useless config file. package-files: - dependencies.yaml post_install_hook: "hook.sh" post_disable_hook: "unhook.sh" #No matter what I tried, I couldn't get this hook to actually trigger, so it seems to be an in-development stub that doesn't work yet (especially given how there was literally 0 documentation on this - I simply spotted it being listed in auto-generated modules). For now, the unhook script has to be run manually if you want to undo the power button setup. Nevertheless, it's listed here, so it should Just Work [TM] when DCli adds support. hook_behavior: always #...instead of "once" because this lets your config be self-healing (even if you mess something up, next dcli sync will restore it); ...instead of "ask" because I don't like pestering people with RUN THIS HOOK? RUN THIS HOOK? (if anything, that makes it more likely that they will "[S]kip always", thus rendering the „self-healing” non-functional) author: "Guzio" version: "1.0.1" category: "system" tags: [] license: "MIT" upstream_url: "https://gitdab.com/Guzio/system/src/branch/main/modules/forgiving-power-button"