Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer

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:

lid-action-on-ac

0=nothing
1=suspend
2=hibernate
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
add comment

Your Answer

 
discard

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.