Remote configuration of Xfce4





One of the things I appreciate about Linux versus winblowze is that almost everything can be managed and configured from the command line. That means that almost everything can be configured remotely via an SSH login connection. Sometimes it takes a bit of time spent on Internet searches but if you can think of it, it can probably be done from the command line.

Fixing my problem

Sometimes it is necessary to make remote modifications to a desktop using the command line. In this particular case I needed to reduce the number of workspaces on the Xfce panel from 4 to 3 at the request of the user. This is actually easy and only required about 20 minutes of searching on the Internet.

The default workspace count and many other defaults for xfwm4 can be found and changed in the /usr/share/xfwm4/defaults file. So setting “workspace_count=4” to “workspace_count=2” changes the default for all users on the host. The xfconf-query command can be used to query and set various attributes for the xfwm4 window manager. It should be used by the user account that requires the change and not by root.

In the sample below I have first verified the current setting of 4 workspaces, then set the number to 2, and finally verified the new setting.

[user@test1 ~]# xfconf-query -c xfwm4 -p /general/workspace_count
4
[user@test1 ~]# xfconf-query -c xfwm4 -p /general/workspace_count -s 2
[user@test1 ~]# xfconf-query -c xfwm4 -p /general/workspace_count
2
[user@test1 ~]#

This change takes place immediately and is visible to the user without a reboot or even logging out and back in.

More exploration

So now that I had my problem fixed, I decided to explore the xfconf-query command in a bit more detail. Unfortunately there are no man or info pages for this tool nor is there any documentation in /usr/share. The usual fallback resulted in a little help information.

 $ xfconf-query -h
 Usage:
   xfconf-query [OPTION…] - Xfconf commandline utility
 Help Options:
   -h, --help            Show help options
 Application Options:
   -V, --version         Version information
   -c, --channel         The channel to query/modify
   -p, --property        The property to query/modify
   -s, --set             The new value to set for the property
   -l, --list            List properties (or channels if -c is not specified)
   -v, --verbose         Verbose output
   -n, --create          Create a new property if it does not already exist
   -t, --type            Specify the property value type
   -r, --reset           Reset property
   -R, --recursive       Recursive (use with -r)
   -a, --force-array     Force array even if only one element
   -T, --toggle          Invert an existing boolean property
   -m, --monitor         Monitor a channel for property changes

This is not a lot of help but we can figure out a good bit from it anyway.

First, the channels are groupings of properties that can be modified. I made the change above to the “general” channel and the property is “workspace_count”. Let’s look at the complete list of channels.

$ xfconf-query -l
Channels:
  xfwm4
  xfce4-keyboard-shortcuts
  xfce4-notifyd
  xsettings
  xfdashboard
  thunar
  parole
  xfce4-panel
  xfce4-appfinder
  xfce4-settings-editor
  xfce4-power-manager
  xfce4-session
  keyboards
  displays
  keyboard-layout
  ristretto
  xfcethemer
  xfce4-desktop
  pointers
  xfce4-settings-manager
  xfce4-mixer

The properties for a given channel can also be viewed using the following syntax. I have used the less pager because the result is a long stream of data. I have pruned the listing below but left enough that you can see the type of entries you can expect to find.

$ xfconf-query -c xfwm4 -l | less
/general/activate_action
/general/borderless_maximize
/general/box_move
/general/box_resize
/general/button_layout
/general/button_offset
<SNIP>
/general/workspace_count
/general/workspace_names
/general/wrap_cycle
/general/wrap_layout
/general/wrap_resistance
/general/wrap_windows
/general/wrap_workspaces
/general/zoom_desktop
(END)

You can explore all the channels in this manner. I discovered that the channels generally correspond to the various settings in the Settings Manager. The properties are the ones that you would set in those dialogs. Note that not all the icons you will find in the Settings Manager dialog window are part of the Xfce desktop so there would be no corresponding channel for them. The Screensaver is one example because it is a generic screensaver and not unique to Xfce. The Settings Manager is just a good central place for Xfce to locate these configuration tools.

Documentation

I did find a lot of incorrect and poorly documented information on the Internet. The best documentation for Xfce4 is on the Xfce website.