Change Power Button Behavior in Ubuntu Linux
You can change what your Ubuntu Linux PC’s power button does when you press it while the system is running.
This lets you decide if the button should shut down, sleep, hibernate, or do nothing at all when accidentally bumped or intentionally pressed.
For example, you can set your power button to do nothing, preventing accidental shutdowns by default on Ubuntu 22.04 LTS.
You manage these power button actions through Ubuntu’s Settings application.
How to change power button behavior in Ubuntu Linux
Ubuntu uses a central location for settings. Note that the path may vary slightly depending on your specific version of GNOME.
Open the Activities overview and type Settings to begin %📂%LNK0%%.

Alternatively, click the System menu at the top-right corner of your screen and select Settings %📂%LNK1%%.

Once the Settings app is open, follow this path: Power > Power Button Behavior.

Power Button Behavior options
Inside the Power panel, you can choose from several actions for your power button:
- Suspend: Puts your computer into sleep mode.
- Power Off: Shuts down the computer. This is the default setting.
- Nothing: The button will not trigger any action.
- Interactive: This option triggers a pop-up menu asking you what you would like to do.
- Hibernate: This may appear as an option if you have swap space correctly configured on your system.

Your choice is applied immediately. You do not need to restart your computer for these changes to take effect.
Conclusion
Customizing your power button is a simple way to make your PC work the way you want. Whether you want to prevent accidental shutdowns or add a shortcut to sleep mode, these settings give you total control.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!