{"id":4255,"date":"2024-03-09T02:25:00","date_gmt":"2024-03-09T07:25:00","guid":{"rendered":"https:\/\/www.both.org\/?p=4255"},"modified":"2024-03-03T13:04:35","modified_gmt":"2024-03-03T18:04:35","slug":"configure-a-linux-workspace-remotely-from-the-command-line","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=4255","title":{"rendered":"Configure a Linux workspace remotely from the command line"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"4255\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p>Nearly everything can be done from the Linux command line, including remote configuration of desktops such as Xfce4.<\/p>\n\n\n\n<p>One of the things I appreciate about Linux versus proprietary operating systems is that almost everything can be managed and configured from the command line. That means that nearly everything can be configured locally or even remotely via an SSH login connection. Sometimes it takes a bit of time spent on Internet searches, but if you can think of a task, it can probably be done from the command line.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The problem<\/h2>\n\n\n\n<p>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 <a href=\"https:\/\/www.xfce.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Xfce<\/a> panel from four to three at the request of a remote user. This configuration only required about 20 minutes of searching on the Internet.<\/p>\n\n\n\n<p>The default workspace count and many other settings for <strong>xfwm4<\/strong> can be found and changed in the <strong>\/usr\/share\/xfwm4\/defaults<\/strong> file. So setting <em>workspace_count=4<\/em> to <em>workspace_count=2<\/em> changes the default for all users on the host. Also, the <strong>xfconf-query<\/strong> command can be run by non-root users to query and set various attributes for the <strong>xfwm4<\/strong> window manager. It should be used by the user account that requires the change and not by root.<\/p>\n\n\n\n<p>In the sample below, I have first verified the current setting of <em>four<\/em>  workspaces, then set the number to <em>two<\/em>, and finally confirmed the new setting.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;user@test1 ~]# <strong>xfconf-query -c xfwm4 -p \/general\/workspace_count<\/strong>\n4\n&#91;user@test1 ~]# <strong>xfconf-query -c xfwm4 -p \/general\/workspace_count -s 2<\/strong>\n&#91;user@test1 ~]# <strong>xfconf-query -c xfwm4 -p \/general\/workspace_count<\/strong>\n2\n&#91;user@test1 ~]#<\/code><\/pre>\n\n\n\n<p>This change takes place immediately and is visible to the user without a reboot or even logging out and back in. I had a bit of fun with this on my workstation by watching the workspace switcher change as I entered commands to set different numbers of workspaces. I get my amusements where I can these days. ;-)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">More exploration<\/h2>\n\n\n\n<p>Now that I fixed the problem, I decided to explore the <strong>xfconf-query<\/strong> command in a bit more detail. Unfortunately, there are no man or info pages for this tool, nor is there any documentation in <strong>\/usr\/share<\/strong>. The usual fallback of using the <strong>-h<\/strong> option resulted in little helpful information.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <strong>xfconf-query -h<\/strong>\n\u00a0Usage:\n\u00a0 \u00a0xfconf-query &#91;OPTION\u2026] - Xfconf commandline utility\n\u00a0Help Options:\n\u00a0 \u00a0-h, --help \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Show help options\n\u00a0Application Options:\n\u00a0 \u00a0-V, --version \u00a0 \u00a0 \u00a0 \u00a0 Version information\n\u00a0 \u00a0-c, --channel \u00a0 \u00a0 \u00a0 \u00a0 The channel to query\/modify\n\u00a0 \u00a0-p, --property \u00a0 \u00a0 \u00a0 \u00a0The property to query\/modify\n\u00a0 \u00a0-s, --set \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 The new value to set for the property\n\u00a0 \u00a0-l, --list \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0List properties (or channels if -c is not specified)\n\u00a0 \u00a0-v, --verbose \u00a0 \u00a0 \u00a0 \u00a0 Verbose output\n\u00a0 \u00a0-n, --create \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Create a new property if it does not already exist\n\u00a0 \u00a0-t, --type \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Specify the property value type\n\u00a0 \u00a0-r, --reset \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Reset property\n\u00a0 \u00a0-R, --recursive \u00a0 \u00a0 \u00a0 Recursive (use with -r)\n\u00a0 \u00a0-a, --force-array \u00a0 \u00a0 Force array even if only one element\n\u00a0 \u00a0-T, --toggle \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Invert an existing boolean property\n\u00a0 \u00a0-m, --monitor \u00a0 \u00a0 \u00a0 \u00a0 Monitor a channel for property changes<\/code><\/pre>\n\n\n\n<p>This is not a lot of help, but we can figure out a good bit from it anyway. First, <em>channels<\/em> are groupings of properties that can be modified. I made the change above to the <strong>general<\/strong> channel, and the property is <strong>workspace_count<\/strong>. Let\u2019s look at the complete list of channels.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <strong>xfconf-query -l<\/strong>\nChannels:\n\u00a0 xfwm4\n\u00a0 xfce4-keyboard-shortcuts\n\u00a0 xfce4-notifyd\n\u00a0 xsettings\n\u00a0 xfdashboard\n\u00a0 thunar\n\u00a0 parole\n\u00a0 xfce4-panel\n\u00a0 xfce4-appfinder\n\u00a0 xfce4-settings-editor\n\u00a0 xfce4-power-manager\n\u00a0 xfce4-session\n\u00a0 keyboards\n\u00a0 displays\n\u00a0 keyboard-layout\n\u00a0 ristretto\n\u00a0 xfcethemer\n\u00a0 xfce4-desktop\n\u00a0 pointers\n\u00a0 xfce4-settings-manager\n\u00a0 xfce4-mixer<\/code><\/pre>\n\n\n\n<p>The properties for a given channel can also be viewed using the following syntax. I have used the <strong>less<\/strong> pager because the result is a long stream of data. I have pruned the listing below but left enough to see the type of entries you can expect to find.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$<strong> xfconf-query -c xfwm4 -l | less<\/strong>\n\/general\/activate_action\n\/general\/borderless_maximize\n\/general\/box_move\n\/general\/box_resize\n\/general\/button_layout\n\/general\/button_offset\n&lt;SNIP>\n\/general\/workspace_count\n\/general\/workspace_names\n\/general\/wrap_cycle\n\/general\/wrap_layout\n\/general\/wrap_resistance\n\/general\/wrap_windows\n\/general\/wrap_workspaces\n\/general\/zoom_desktop\n(END)<\/code><\/pre>\n\n\n\n<p>You can explore all the channels in this manner. I discovered that the channels generally correspond to the various settings in the <strong>Settings Manager<\/strong>. The properties are the ones that you would set in those dialogs. Note that not all the icons you will find in the <strong>Settings Manager<\/strong> dialog window are part of the <strong>Xfce<\/strong> desktop, so there are no corresponding channels for them. The <strong>Screensaver<\/strong> is one example because it is a generic GNU screensaver and not unique to <strong>Xfce<\/strong>. The <strong>Settings Manager<\/strong> is just a good central place for <strong>Xfce<\/strong> to locate many of these configuration tools.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Documentation<\/h2>\n\n\n\n<p>As mentioned previously, there do not appear to be any man or info pages for the <strong>xconf-query<\/strong> command, and I found a lot of incorrect and poorly documented information on the Internet. The best documentation I found for <strong>Xfce4<\/strong> is on the <a href=\"https:\/\/www.xfce.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Xfce website<\/a>, and some specific information on <strong>xconf-query<\/strong> can be found here.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nearly everything can be done from the Linux command line, including remote configuration of desktops such as Xfce4.<\/p>\n","protected":false},"author":2,"featured_media":4259,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[77,5,89,293],"tags":[294],"class_list":["post-4255","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-desktop","category-linux","category-system-administration","category-xfce","tag-configuration"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/4255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4255"}],"version-history":[{"count":3,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/4255\/revisions"}],"predecessor-version":[{"id":4258,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/4255\/revisions\/4258"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/4259"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}