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:
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.