Xfce Forum

Sub domains
 

You are not logged in.

#1 2015-02-26 10:28:40

steps
Member
Registered: 2015-02-26
Posts: 4

Change xsettings.xml via command line

Hey guys,

I ran into an issue today and could not find a solution myself. Maybe you can help me with this?

My task
I am tasked to set up a virtual machine running Debian with an Xfce desktop. So far so good, but setting up this VM over and over again I decided it was time to write a bash script that would do the config work for me.
One requirement for the VM is a special look and feel, namely using Xfce-redmondxp as the theme and gnome-human as the icon theme.

What I already did
I already located the following two lines in ~/.config/xfce4/xfconf/xfce-perchannel-xml:

...
<property name="ThemeName" type="string" value="empty"/>
<property name="IconThemeName" type="string" value="empty"/>
...

I tried changing those using xmlstarlet:

xmlstarlet ed -u "//property[@name='ThemeName']/@type" -v "Xfce-redmondxp" xsettings.xml
xmlstarlet ed -u "//property[@name='IconThemeName']/@type" -v "gnome-human" xsettings.xml

(Please note that I omitted the code required to actually write to the real xsettings.xml file)

That worked just fine, resulting in:

...
<property name="ThemeName" type="string" value="Xfce-redmondxp"/>
<property name="IconThemeName" type="string" value="gnome-human"/>
...

The problem
My problem is that the above changes are reset when I reboot the machine.

I thought that they would be applied once I rebooted the virtual machine, but instead they get reset to "empty". Obviously, that's not what I want, so here I am smile

The question
Can you please tell my how to make changes to xsettings.xml that survive a reboot? What causes the reset to happen? I'd really love to be able to setup that VM with a single click, so any help is highly appreciated.


If you have any questions, feel free to ask.


Looking forward to solving this with you guys - steps

Offline

#2 2015-02-26 11:30:43

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,985

Re: Change xsettings.xml via command line

Use xfconf-query. You can view all settings via the "Settings Editor" application. In the example you cited above, you could:

xfconf-query -c xsettings -p /Net/ThemeName -s "My Appearance (GTK) Theme"
xfconf-query -c xsettings -p /Net/IconThemeName -s "My Icon Theme"

Can you please tell my how to make changes to xsettings.xml that survive a reboot? What causes the reset to happen?

When Xfce starts, the settings are read into memory. If you change the files manually, they will be overwritten with the data from memory on logout. Using xfconf-query ensures that the changes are made to the memory store.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2015-02-26 12:02:20

steps
Member
Registered: 2015-02-26
Posts: 4

Re: Change xsettings.xml via command line

ToZ: I'm Sorry. I clicked on "edit" post instead of "quote" and deleted your reply. My apologies. (Note to self: finish coffee first)

assuming that configuring the panels works like configuring the theme/icon theme.

Unfortunately, no. Panel configurations are complicated and involve array entries in the xfconf-query system which are difficult to script. Search the forums for the keyword "kiosk" and "panel" to get some ideas on how to get panel pre-configurations done properly. For example: https://forum.xfce.org/viewtopic.php?id=9266

Last edited by ToZ (2015-02-26 13:42:09)

Offline

#4 2015-02-27 04:21:36

steps
Member
Registered: 2015-02-26
Posts: 4

Re: Change xsettings.xml via command line

@ToZ: I was starting to wonder where my post was wink

Thanks for the advice,  I'll see what I can find following your links

Thanks a lot

Offline

Board footer

Powered by FluxBB