The officially official Devuan Forum!

You are not logged in.

#1 2026-02-02 04:38:49

Eeqmcsq
Member
Registered: 2017-09-19
Posts: 93  

[HowTo] Excalibur + MATE/Xfce: Remove the suspend/hibernate buttons

I tested these steps on a fresh install of Excalibur + MATE/Xfce.

* MATE Desktop: Remove the Suspend/Hibernate buttons from the Shut Down dialog

We'll create a PolicyKit rule that disallows suspend and hiberate. The MATE Shut Down dialog will remove those buttons when they're not allowed.

- Change to the root user. Only root can access the polkit-1 rules.d directory. The "-w DISPLAY,XAUTHORITY" whitelists these environment variables, so they'll be copied into the root environment. This lets root run a GUI text editor, such as pluma. If you're not using a GUI text editor, you can skip the -w args.

sudo su -l -w DISPLAY,XAUTHORITY
cd /etc/polkit-1/rules.d/

- Open a new file in a text editor.

<your_text_editor> 50-disable-suspend-hibernate.rules

- Add these lines:

//Disallowing suspend/hibernate removes the Suspend/Hibernate buttons from the MATE Desktop's Shut Down dialog.
polkit.addRule(function(action, subject) {
    if (   action.id == "org.freedesktop.login1.suspend"
        || action.id == "org.freedesktop.login1.suspend-multiple-sessions"
        || action.id == "org.freedesktop.login1.suspend-ignore-inhibit"
        || action.id == "org.freedesktop.login1.hibernate"
        || action.id == "org.freedesktop.login1.hibernate-multiple-sessions"
        || action.id == "org.freedesktop.login1.hibernate-ignore-inhibit"
       )
        return polkit.Result.NO;
});

- Test: Open the MATE Desktop Shut Down dialog. The Suspend/Hibernate buttons should no longer be shown.

* More info
  - The action.id strings come from /usr/share/polkit-1/actions/org.freedesktop.login1.policy.
  - The policy kit rules's programming language is JavaScript.
  - For details on how the rules file works, go to this web page, section "AUTHORIZATION RULES".
      https://www.freedesktop.org/software/po … kit.8.html

* Xfce: Remove the Suspend/Hibernate/Hybrid Sleep buttons from the Log Out dialog

Xfce has a setting that shows or hides each button. No need to create a policykit rule. You can do this through the cmd line or the GUI.

- Set these Xfce settings

  - Cmd line

xfconf-query --channel 'xfce4-session' --create --property '/shutdown/ShowSuspend'     --type 'bool' --set 'false'
xfconf-query --channel 'xfce4-session' --create --property '/shutdown/ShowHibernate'   --type 'bool' --set 'false'
xfconf-query --channel 'xfce4-session' --create --property '/shutdown/ShowHybridSleep' --type 'bool' --set 'false'

  - GUI

- Applications -> Settings -> Settings Editor
- Click on the Channel "xfce4-session".
- Add a property with these settings:
  - Property : /shutdown/ShowSuspend
  - Type     : Boolean
  - Value    : False
- Repeat for the property "/shutdown/ShowHibernate" and "/shutdown/ShowHybridSleep".

- Test: Open the Log Out dialog. It should not have the suspend, hibernate, or hybrid sleep buttons.

- To restore the default setting
  - Cmd line

xfconf-query --channel 'xfce4-session' --reset --property '/shutdown/ShowSuspend'
xfconf-query --channel 'xfce4-session' --reset --property '/shutdown/ShowHibernate'
xfconf-query --channel 'xfce4-session' --reset --property '/shutdown/ShowHybridSleep'

  - GUI

- Applications -> Settings -> Settings Editor
- Click on the Channel "xfce4-session".
- Click on the desired property.
- Click the Reset button.
  - "Reset" will delete the custom defined setting. Xfce will use the internal default.

Offline

#2 2026-02-02 09:40:40

Ron
Member
Registered: 2018-04-22
Posts: 592  

Re: [HowTo] Excalibur + MATE/Xfce: Remove the suspend/hibernate buttons

Thanks for this. I'm going to try it out this weekend (I'm swamped at work this week).

Offline

#3 2026-02-02 13:36:48

Calamity
Member
Registered: 2021-10-23
Posts: 56  
Website

Re: [HowTo] Excalibur + MATE/Xfce: Remove the suspend/hibernate buttons

Thank you, I tested it in Xfce - works as intended.


Re-examine all that you have been told. Dismiss that which insults your soul.  - Walt Whitman
Ditch sham-poo and hair-die.
Global SkywatchSubliminal Manipulation

Offline

Board footer