Xfce How to automate XFCE desktop customization

Hi, is there a way to automate the XFCE desktop GUI customization such as add/remove panels (1 or 2) add shortcuts to panels, add/remove desktop icons etc. in FreeBSD please.
Thanks & Best Regards
AMJS
 
xfconf-query can be used to display and modify Xfce settings from command line; its wiki has examples. xconf-query may be used in a shell script to make the needed customisation.
 
Everything is set up manually and in an elementary way. I don't use any tools. There is a topic about automatic installation of environments by scripts. I lack a script for full disk backup-recovery (like Clonezilla) today. For some reason Clonezilla doesn't want to mount a source in UFS format. I have to backup to a disk with ext4.
 
Hi, is there a way to automate the XFCE desktop GUI customization such as add/remove panels (1 or 2) add shortcuts to panels, add/remove desktop icons etc. in FreeBSD please.
Thanks & Best Regards
AMJS
I'm not sure what you mean by "automation" of xfce desktop.

To add or remove panels go to -> Applications Menu -> Sesttings -> Settings Manager -> Panel Icon. In the Panel setting, you have (+) option to add new panel or (-) remove a panel from the list. After you add panel to your desktop, you can drag the panel and also drop desktop icon(s) into the panel. By right clicking on the panel you can customize that panel with the Panel Preferences option.

To add desktop icon go to -> Applications Menu -> Select and hold left mouse button and drag the app icon onto your desktop. To remove it, (right mouse button) on the desktop icon and use the delete or move to trash menu options.
 
Xfce's xfconf uses xml files to store the configuration. So it may be possible to write a program/script
That's exactly the point when I stopped using xfce.

Don't get me wrong:
xfce is really a good DE. I liked, and used it for a couple of years.

But if you figure out you want to have things different as they are part of the DE's default "settings-change-menus", you cannot be satisfied by staying within the predefined box, and you face to have mess around with XML-files...no, Sir, no!
I don't mess with any config files written in XML.
XML may make some sense to be used for webpages, and as wordprocessor("office suite"-)files.
But in my eyes it's a systematical design error to chose any ML for config files. That's the opposite of user friendly. Especially when it's this crap XML.
I don't see no value to say something like
Code:
<now something comes>
<it's a variable to be defined>
<the variable is i>
<its value will be 1>
<i; =; 1;>
<end of variable>
<end of something>
instead of simply say:
Code:
i=1
That's unacceptable. That's garbage!
Many thousands lines of this shit, dozens files, often even cryptically named?
No way! I rather stop using computers.

Of course, one can be satisfied with a WM/DE whos config is done in XML.
But I see no use to start editing those files. Wasted effort.
In most cases it's way less effort, simpler, quicker, and even way more valuable in the long term to switch to some DE/WM using textfile(s) for config, and learn its config syntax - (except maybe you're already a XML crack who reads and writes XML like you mother's tongue) -
you may also find quickly tons of config files as templates, where you may pick the parts from you're interested in.
 
There is also the xfce4-panel-profiles pkg/port that is not installed by default with Xfce. But the pkg seems broken now in 14.2, I use it on my 14.1 installs just fine.
 
Blog from vermaden XFCE Cupertio Way gave me some insight about how to tweak aspects of XFCE from the command line.
xfconf-query can be used to modify some of the inner workings of the desktop. Exception is the explicit gtk/gnome/qt. Still have to go through dialogs to manipulate most of that.

I was able to script the xfconf-query to some extent to automate the setup. XFCE settings are in an XML format. the command and dialogs manipulate that xml file quickly. There is a learning curve to understanding this stuff, things apart of XFCE inner workings.

Settings are group as channels, i.e. xfce-panel, Thunar, Terminal, et al. Each channel could/can be an xml file in the user settings.

property would be the child tag under that channel and it would have a value. You need to know the value type to edit or add.

A quirk would be the clock on the panel.
-- channel: xfce--panel
-- property: plugin-## (some number) with a string value "clock"
IIRC, on a default profile, clock is _plugin-12_. Once you have this, you can manipulate the clock format like below:

sh:
% xfconf-query -c xfce4-panel -p /plugins/plugin-12/digital-layout -n -t int -s 0    # date then time
% xfconf-query -c xfce4-panel -p /plugins/plugin-12/digital-date-font -n -t string -s "DejaVu Sans Bold 8"
% xfconf-query -c xfce4-panel -p /plugins/plugin-12/digital-date-format -n -t string -s "%Y-%b-%0d"
% xfconf-query -c xfce4-panel -p /plugins/plugin-12/digital-time-font -n -t string -s "DejaVu Sans Bold 8"
% xfconf-query -c xfce4-panel -p /plugins/plugin-12/digital-time-format -n -t string -s "%a %R %Z"

Others have attempted to automate the setup. These are heavily opinionated, IMO. Best to learn from others and roll your own for what works for you. Catch is you have to stay up to speed on XFCE internals.

Good Luck.
 
recently I wanted the dark/light toggle keystroke to affect the terminal colors as well. So I configured i3 to call a script and

Code:
# available properties: $ cat .config/xfce4/xfconf/xfce-perchannel-xml/xfce4-terminal.xml
$ xfconf-query -c "xfce4-terminal" -p "/color-foreground" -s "#839496"
…
 
word of warning: luckily I tested in a VM first. Not sure if it is the fact I first compiled python311 from ports on a system running pkgs only, using make config and then make reinstall clean.

While the py311-psutil pkg did get panel profiles to launch, switching profiles completely borked the xfce panel. It disappeared and then complained about whisker menu, etc

I will keep this thread on topic and just leave it as it is, the VM shall be deleted anyway
 
While the py311-psutil pkg did get panel profiles to launch, switching profiles completely borked the xfce panel. It disappeared and then complained about whisker menu, etc
Maybe you choose the predefined profiles which require some plugins you don't have installed. Try to save your default profile and reload it.
 
I prefer XML config files over binary files. At least, XML is human readable.
That's comparing apples with oranges. Sounds a bit to me like a desperate defence of some one used to work on projects having XML for config files while at the same time deep down feels this was not the best decision made.
For the same reason I could say, 'I prefer binary over encrypted files I don't have the key for. At least you can get anything useful out of it at all.' All have to admit: That's true. But it's pointless.

But back to OP's topic:
However some one may sees it about config made in XML, as I already said, I see it way too much effort messing with those.

Schroter,​

you may ask yourself if you can live with xfce (or any other DE) as it come, or not.
Several years ago I was at likewise crossroads. After switching from Windows, which GUIs I all always hated was one of the core reasons to turn my back on it, to FreeBSD, switching from LXDE to xfce (I never really used Gnome, or KDE - simply not my style) I finally realized I don't even want a Desktop Environment at all. DEs are turn-key GUIs. Turn-key means predefined, almost never configurable to the last detail. Of course, not. You either chose something predefined, and live with it, or start to config it all over by yourself anyway. One can be fully satisfied with that, of course. But if you want to configure more than change of wallpapers, or window's decor color - yeah, yeah, I'm not fair, I know; beancounters don't eat me alive for that simplification - you'd be better recommended with a (pure, simple) window manager.
Browse a bit and pick one you may configure everything - within textfiles, not XML. There are several. Learn how to config it, and "tailor your own, personal DE." That's what they are for.
As I already said, in the beginning it's a bit effort, but in the long term some one who tried several DEs but still hasn't found what she or he's looking for might be more satisfied that way.

For myself I am at crossroads again.
Since I'm asking myself why to use resize- and movable, decorated windows at all, by default leaving large parts of the monitor unused while I always prefer the usage of full- or at least splitted screens. So I'm checking if I switch to a tiling WM like i3, spectrwm, herbstluftwm, or dwm (which can do both modes)
But that's just as ideas if you consider to look for something else.
Again:
If you can be fully satisfied with xfce, and one can, there's no reason to change.
 
Sounds a bit to me like a desperate defence of some one used to work on projects having XML for config files while at the same time deep down feels this was not the best decision made.
Yeah, those angle brackets can be scary. But fear not! There are a lot of useful XML parsing libraries out there.
 
But fear not! There are a lot of useful XML parsing libraries out there.
I don't fear it. And I'm pretty aware of that fact.
I simply don't see no sense in why first transform simple text into a XML file, just for everybody, and the software then needs a parser to get the simple text out of it again, instead of let it simply stay simple text in the first place.
That's just two additional but completely pointless additional transformation steps, so more complexity, plus more dependencies, plus more fault liability...
Just more trouble without any benefit but downsides only. In my eyes that's senseless.
 
If your XML is valid, parsing can be done much more error-proof. "Simple text" simply has no syntax you can rely on.
The XML part, yes - as long as the config files, parsers, and libraries are still conform with the current XML version. But for the usage as a config file your software still needs to understand the text that's just embedded in XML code... - But I see, you refuse to see my point.
So I give in.
As long as I can chose software without doing its config in XML, what I do, I don't need to bother really.
Peace out.
 
As far as parsing an XML, binary, or whatever file, why don't you just use 'sysrc'? I mean there isn't a ton of settings you'd normally have to change to get "sane defaults" setup for things like this and XFCE has a tool to allow making automation possible. I'm creating my "jail/system setup scripts" in a similar fashion.

Keep things in a key/value config file and get/put as required for automation (-i.e. in this case, read the users key/value config write out the settings via the software's config).

For example: wrapper/config/setup for XFCE.

Code:
#!/bin/sh

# This script will (re)set my XFCE to sane defaults.

# Load the user's settings.
. /opt/info/environment
# which contains your awesome config settings.
# like:
#       -------------------------------------------->%
#       show-tooltips=false     # I don't like tips.
#       ...
#       -------------------------------------------->%

# Variables this script needs.
: ${SHOW_TOOLTIPS:="true"}

# (optional) Save the settings.
# ...just 'cause
sysrc -f /opt/info/environment SHOW_TOOLTIPS=${SHOW_TOOLTIPS}

# do the config.
xfconf-query --channel xfce4-desktop -p /desktop-icons/show-tooltips -s ${show_tooltips}
...

Having this wrapper script will allow for the user to have their settings they like but yet still support for people to share their "Super awesome xfce setup" via scripts (-e.g. if the user wants to try "someone' setup script, they just have to remove the /opt/info/environment file).

I absolutely agree with the point of dependencies (ick!) but as far as removing complexity (you will never get a software thing to change config methods), this balances that a bit; the setting either has a default or is set and allows the end-user to read/change. Simple wrappers like this eliminate the "if XML is valid" and a constant "key/value syntax" problems.
 
Back
Top