You are not logged in.
Pages: 1
In the process of getting Blob - and Carbon - ready for release, a bug with blob's handling of xfconf settings came up:
https://forums.bunsenlabs.org/viewtopic … 79#p148079
It turned out that while xfconf-query doesn't output the type of settings entries, it requires to know the type if adding a new entry. So running 'xfconf-query -c "<channel>" -lv' is not enough for backing up an xfce app which stores its settings in the xfconf database - which most of them do these days. We need to store the type too. That data is luckily stored in the app's xml file in ~/.config/xfce4/xfconf/xfce-perchannel-xml/ so to back it up, all we need to do is save that file.
In principle it might be possible to restore the settings by copying the xml file back into place, overwriting whatever's there, but the apps don't always respond right away, often needing a logout/in. There's a better way - if you know the missing type then you can run xfconf-query commands to restore the settings.
So, this script called xml2xfconf. Passed an xfconf xml file - eg a backed-up copy of one of those in xfce-perchannel-xml/ - it will print out a list of xfconf-query commands to apply those settings to the xfconf database, and they'll take effect immediately. ![]()
Example usage:
restore=$(mktemp)
xml2xfconf -x /path/to/xfce4-terminal.xml -c xfce4-terminal > "$restore"
bash "$restore"Here's what got written into $restore:
xfconf-query -c xfce4-terminal -p /font-name -n -t string -s Monospace\ 10
xfconf-query -c xfce4-terminal -p /color-use-theme -n -t bool -s false
xfconf-query -c xfce4-terminal -p /font-allow-bold -n -t bool -s true
xfconf-query -c xfce4-terminal -p /title-mode -n -t string -s TERMINAL_TITLE_REPLACE
xfconf-query -c xfce4-terminal -p /scrolling-lines -n -t uint -s 50000
xfconf-query -c xfce4-terminal -p /font-use-system -n -t bool -s false
xfconf-query -c xfce4-terminal -p /background-mode -n -t string -s TERMINAL_BACKGROUND_TRANSPARENT
xfconf-query -c xfce4-terminal -p /background-darkness -n -t double -s 0.94999999999999996
xfconf-query -c xfce4-terminal -p /color-bold-use-default -n -t bool -s true
xfconf-query -c xfce4-terminal -p /color-bold-is-bright -n -t bool -s true
xfconf-query -c xfce4-terminal -p /color-background-vary -n -t bool -s false
xfconf-query -c xfce4-terminal -p /color-foreground -n -t string -s \#dcdcdc
xfconf-query -c xfce4-terminal -p /color-background -n -t string -s \#2c2c2c
xfconf-query -c xfce4-terminal -p /color-cursor-foreground -n -t string -s ''
xfconf-query -c xfce4-terminal -p /color-cursor -n -t string -s \#dcdcdc
xfconf-query -c xfce4-terminal -p /color-cursor-use-default -n -t bool -s true
xfconf-query -c xfce4-terminal -p /color-selection -n -t string -s ''
xfconf-query -c xfce4-terminal -p /color-selection-background -n -t string -s ''
xfconf-query -c xfce4-terminal -p /color-selection-use-default -n -t bool -s true
xfconf-query -c xfce4-terminal -p /color-bold -n -t string -s ''
xfconf-query -c xfce4-terminal -p /color-palette -n -t string -s \#3f3f3f\;#705050\;#60b48a\;#dfaf8f\;#9ab8d7\;#dc8cc3\;#8cd0d3\;#dcdcdc\;#709080\;#dca3a3\;#72d5a3\;#f0dfaf\;#94bff3\;#ec93d3\;#93e0e3\;#ffffff
xfconf-query -c xfce4-terminal -p /tab-activity-color -n -t string -s \#aa0000xml2xfconf has been uploaded in the latest version of bunsen-utilities, so now I'm going to rewrite the bits of BLOB which use xfconf (only a couple of apps actually) to use xml2xfconf and with luck the bug which @Dave75 found will go away.
And then the Carbon release can get rolling again.
It wasn't a welcome interruption, but this new utility might be useful outside Blob for people who want to backup and restore xfce app settings. ![]()
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Thank you @johnraff!
I've just updated the system and I'm going to try it.
I've also just had a quick learn on xfconf and xfconf-query that were new to me. Am I correct if I say that the "-n" option in xfconf-query is there just in case the property is not already present ? if the property is already present and "-n" option is used, it just overwrite the property without any error, correct ?
My current setup https://linux-hardware.org/?probe=40f41d8ef6
My last little project https://github.com/Dave1975-spring/RPNV_Calculator
Offline
^yes that's right. If the property is already there -n does no harm. The same applies to setting -t <type>: if the property's type is already set in the xfconf database, it's unnecessary. But I haven't tested what happens if you pass a different type from what's set. My guess is that the new type would overwrite the old one.
But you won't be able to test the new Blob till I finish rewriting the xfconf part - maybe tomorrow.
Last edited by johnraff (Today 08:02:56)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
There's a lot of controversy round AI, especially in the artistic/creative world, but I have to say that I found it quite useful while making this script. Of course you can't just let AI take over, but if you regard it as an assistant and check over everything it does then it can save a lot of time with coding.
The end result of xml2xfconf is perhaps not perfect - it does a lot of calls to xmlstarlet that might be wasting time, but a long xml file like xfce4-panel takes ~ 1s to parse, which in the context of a utility like BLOB is not too long. (The other xfce4 xml files like xfce4-terminal are faster.) When I have some time, I'll see if the script can be refactored to extract the data in fewer runs of xmlstarlet and put it into arrays for processing by bash.
Anyway, as far as I can tell it seems to be doing a solid job.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
This tool would be great if you are setting up a new system and if you backed up your xfce app settings you could restore them with this as well?
Real Men Use Linux
Offline
Pages: 1