You are not logged in.
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
Thanks for this. I'm going to try it out this weekend (I'm swamped at work this week).
Offline
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 Skywatch・Subliminal Manipulation
Offline