Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to create a toggle for suspending/doing nothing upon closing the lid for XFCE. For that, I need to find out where is the following setting stored:

enter image description here

Creating the toggle script and panel indicator won't be a problem afterwards.

share|improve this question
up vote 1 down vote accepted

The values you need are stored in xfce4-settings-editor. The function you require is lid-action-on-ac. So, to use xfconf-query to set it to do nothing, you would run

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/lid-action-on-ac -t int -s 0

Then to set it to suspend, substitute the 0 for a 1:

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/lid-action-on-ac -t int -s 1

The values usable with xfconf-query that correspond to the settings in the graphical application are:


3=lock screen

This information was found by setting the values in the graphical settings dialog and then noting the value that appeared in xfce4-settings-editor under the appropriate function. You could do this for the other functions such as power-button-action, if you are interested in those as well.

However, you cannot use the toggle option (-T) here explicitly, as that only works with boolean values (true, false) and not integers. You could however just use the two xfconf-query commands above in a script and fashion a toggle within that script, as you said you wish to do.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.