Change Power Button Behavior in Ubuntu Linux
Ubuntu Linux power button behavior controls what happens when you press the physical power button on your computer, such as shutting down, going to sleep, hibernating, or doing nothing. Adjusting this setting stops accidental shutdowns on Ubuntu 22.04 LTS and newer versions where a stray press turns off your work.
You can update this option quickly through the main Settings app on your desktop.
You can change your Ubuntu Linux power button’s function by opening Settings, navigating to Power, and then selecting Power Button Behavior. Choose from options like Suspend, Power Off, Nothing, Interactive, or Hibernate to customize its action. Your selection applies immediately.
How to change power button behavior in Ubuntu Linux
Ubuntu power button settings can be changed directly from the main Settings app to control what happens when you press the physical button on your computer. You can pick options like shutting down, going to sleep, or showing a menu. Open the Activities overview, type Settings, and click the Power tab to find these options.
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
Ubuntu power button options include Suspend to put your computer into sleep mode, Power Off to shut it down completely, Nothing so the button does not react, and Interactive to show a prompt first. Choosing the right setting helps you avoid accidental shutdowns or quickly put your screen to sleep.
- 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.

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.
How do I change the power settings on Ubuntu?
Open the Activities overview and start typing Power. Click Power to open the panel. In the Power Mode section, choose one of the profiles.
Was this guide helpful?
0% of readers found this helpful (1 votes)
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!