Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-01-31 02:19:52

jlarsson
Member
Registered: 2019-01-31
Posts: 2

[solved] xfconf-query to delete items

Hi,

I'm writing myself a bash script to automate my Fedora configurations post-install to install all the software I want and set up my desktop and config files etc, so far it's successfully configuring power manager, theme, moving panel 1 to its desired location(in the vm at least), hotkeys and autostart applications. I have yet to figure out how to delete panel 2 completely though, at least through the xfconf-query command, which is how I would prefer to do it in case there is a change in how config files are stored or whatever reason may cause breakage in the future.
So far, I have these relevant commands working:

xfconf-query -c xfce4-session -p /general/conky -s "conky" --create -t string
xfconf-query -c xfce4-session -p /general/pnmixer -s "pnmixer" --create -t string
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-enabled -n -t bool -s false
xfconf-query -c xsettings -p /Net/ThemeName -s "Greybird"
xfconf-query -n -c xfce4-keyboard-shortcuts -p "/commands/custom/<Super>F1" -t string -s /usr/bin/xfce4-terminal
xfconf-query -c xfce4-panel -p /panels/panel-1/size -s 20
xfconf-query -c xfce4-panel -p /panels/panel-1/position -s "p=8;x=0;y=0"

I did try

xfconf-query -l xfce4-panel -p /panels/panel-3 --reset --recursive

but it simply removed the items on it and moved it to a different location when I reloaded. Is it not possible to actually delete(as in the complete opposite of --create) via xfconf-query and do I need to modify the config files instead?

Apologies if this has been asked and/or answered before, I haven't found the answer so far by googling.

Last edited by jlarsson (2019-02-03 13:00:00)

Offline

#2 2019-01-31 02:56:21

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,703

Re: [solved] xfconf-query to delete items

Hello and welcome.

Make sure to also address the /panels key. It is an array that holds the panel IDs. For the default setup, you will have 2 panels identified:

$ xfconf-query -c xfce4-panel -p /panels
Value is an array with 2 items:

0
1

If you are removing panel-1, re-write the array like this:

xfconf-query -c xfce4-panel -p /panels -t int -s 0 -a

If you need to write back more than one panel identifier, use something like:

xfconf-query -c xfce4-panel -p /panels -t int -s 0 -t int -s 1 -a

Just make sure you get and specify the correct panel IDs.

This would be in addition to your recursive reset command and before restarting the panel.


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2019-01-31 17:48:53

ctac
Member
Registered: 2017-05-08
Posts: 57

Re: [solved] xfconf-query to delete items

Hello

If you want to hide panel-1, this command is enough

xfconf-query -c xfce4-panel -p /panels -t int -s 0 -a

This way, you don't lose panel-1 for future use.

You certainly get a function accessible only via root like this one in future release of xfce  smile

    <method name="LockProperty">
      <arg name="channel" type="s" direction="in"/>
      <arg name="property" type="s" direction="in"/>
      <arg name="locked" type="b" direction="in"/>
    </method>

Hope this help.

Offline

#4 2019-02-02 20:10:30

jlarsson
Member
Registered: 2019-01-31
Posts: 2

Re: [solved] xfconf-query to delete items

Thanks for the response, it works exactly as intended now.

xfconf-query -c xfce4-panel -p /panels -t int -s 1 -a
xfce4-panel -r

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 534.5 KiB (Peak: 535.34 KiB) ]