8

I'd like to change a xfce4-power-manager setting (what to do when laptop lid is closed on AC) via the terminal so that I can assign a keyboard shortcut to do it.

enter image description here

Is there a way how to do it? Similar to dconf-editor set for gnome..

EDIT

ok, I found the file at ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml. But changing it doesn't do anything. How do I reload xfce4-power-manager? I tried xfce4-power-manager --restart but that doesn't help.

mreq
  • 4,752
  • 8
  • 42
  • 62

1 Answers1

11

Found it, have to use xfconf-query to get/set values.

To get the value:

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/lid-action-on-ac

To set the value:

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

-c specify channel, -p is for property within that channel, -s is for setting value, 1 for suspend, 0 for do nothing.

lwei
  • 5
  • 2
mreq
  • 4,752
  • 8
  • 42
  • 62
  • I see "0" when I have "Switch off display" selected - but there is no open to "Do nothing". – Michael May 03 '19 at 21:12
  • at least for alterating `lock-screen-suspend-hibernate` neither sending HUP to xfce4-power-manager nor running it well --restart seems to reliably make the change take effect. – Michael Sep 22 '19 at 00:22