• Disable power button


    Hi, everyone! I’m trying to disable power button on my laptop. Currently if I press it, my system suspends. I’ve tried to google and find out that systemd should be able to do just that. All I had to do - is just edit /etc/systemd/logind.conf. From logind.conf man page I find out, that in order to disable power button I should set “HandlePowerKey” to “ignore”. I rebooted but it didn’t work, so I thought maybe system sees button not like “PowerKey” but like “SuspendKey” or “HibernateKey” so just to be sure I set both of them to “ignore”. But nothing changed - after I press “power button” system suspends. I started to think maybe this file is ignored by “systemd-logind” for some reason, but then I tried to change “HandleLidSwitch” to “lock” and it worked! (well, kind of - default action when I close the lid is suspend now it locks but the screen turns off). So it means that logind.conf is not ignored but for some reason it doesn’t work for power button.

    Edit: Couldn’t figure out how to add proper “solved” badge, so I just edited question’s title.
    Sorry for my poor English.

  • It should be posssible to change through your desktop environment settings, which one do you use?

    I7 [email protected]/32GB Ram/3440 x 1440 + 1440p/EVGA 1080 FTW/512GB SSD/2TB HD/Antergos Base w/ Plasma

  • Thank you! While I was typing you the reply that there is no such option in Gnome’s settings I remembered about gnome-tweak-tool and turns out that it has what I’m looking for! I still don’t understand why this option is not included in settings. Thank you again)

systemd23 systemd-logind1 logind.conf2 Posts 3Views 847
Log in to reply