ANN: New tool xfce-config-helper
Felipe Contreras
felipe.contreras at gmail.com
Tue Feb 15 00:17:39 CET 2022
Hello,
On Mon, Feb 14, 2022 at 3:22 PM <andre at andreldm.com> wrote:
> This is a very interesting project, a couple of months ago while migrating to new laptop I wrote a simple script (cannot find it anymore) to dump all xfconf's channels/properties into commands, for example:
> xfconf-query -c <channel> -p '<property>' -n -t <type> -s '<value>'
>
> My goal was to later write a writer/reader to handle a format similar to i3's config file, but I guess your goal is very close to mine.
>
> Regarding the file format, YAML is acceptable, though from experience it's really easy to mess it up. I would use the rc format already used by Xfce, for example:
>
> [thunar]
> hidden-bookmarks=['computer:///', 'recent:///']
> last-view='ThunarDetailsView'
> last-window-width=170
>
> [xfce4-panel]
> panels=[0]
> panels/panel-0/autohide-behavior=0
> panels/panel-0/length=100
>
> IMO that's more friendly and doesn't require a YAML parser.
To me that's less user friendly. A minimal panel would be something like:
[panels]
panels=[1]
panels/panel-1/plugin-ids=[1,2,3]
plugins/plugin-1=whiskermenu
plugins/plugin-2=tasklist
plugins/plugin-3=pager
While in my YAML version it is:
panels:
- plugins:
- - whiskermenu
- - tasklist
- - pager
The second problem is how to deal with complex values, like an array
of integers (e.g. [1,2,3]). We would need to write a parser to convert
that to an array, and then distinguish an array of integers from an
array of strings (e.g. ["1","2","3"]).
We would be duplicating what YAML already does.
In YAML this is an array of strings: [ one, two, three, four ]
This is an array of integers: [ 1, 2, 3, 4 ]
And this is an array of strings: [ "1", "2", "3", "4" ]
We can pass those complex values *directly* through D-Bus:
workspace_names = YAML.load('[ one, two, three, four ]')
$xfconf.SetProperty('xfwm4', '/general/workspace_names', workspace_names)
We don't have to do absolutely anything.
Yes, using an ini file wouldn't require a YAML parser, but it would
require an INI parser.
> Regarding Ruby, I believe most users don't have it installed, using shell or even python would be more appropriate.
According to Arch Linux statistics 65% of users have it installed [1],
and according to Debian stats more than 50,000 people do [2].
I absolutely detest Python, so if somebody ports this tool to Python,
I wouldn't touch that code. Shell I like, but I think the code would
be overly complicated.
> All in all this a nice addition to Xfce, what do you think about pushing this upstream? If you're interested let's continue this discussion at https://gitlab.xfce.org/xfce/xfconf/-/issues/29 :)
Sure, I'm very interested in that. I'll reply to the GitLab issue.
Cheers.
[1] https://pkgstats.archlinux.de/packages?query=ruby
[2] https://popcon.debian.org/
--
Felipe Contreras
More information about the Xfce
mailing list