Xfce Forum

Sub domains
 

You are not logged in.

#1 2012-03-12 01:10:53

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

why are keyboard shortcut files .xml?

Hi,

I had a whole pile of keyboard shortcuts to add, and it's so slow to do it in the GUI, I like to be able to find the actual file where they are stored and edit that directly. I found the file ok "xfce4-keyboard-shortcuts.xml" and my edits worked fine, but I'm curious as to why the file is in .xml format (but even then no browser can open it) -- why not a plain vanilla text file?

Offline

#2 2012-03-12 08:36:21

jeromeg
Member
From: France
Registered: 2010-11-11
Posts: 131
Website

Re: why are keyboard shortcut files .xml?

Hello,

That's because keyboard shortcuts are stored using xfconf which uses an XML backend. You should not modify those files by hand, better use "xfconf-query" to script the process of adding a shortcut if you want to add them quickly.

Cheers,

Jérôme

Offline

#3 2012-03-12 17:15:26

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: why are keyboard shortcut files .xml?

jeromeg wrote:

Hello,

That's because keyboard shortcuts are stored using xfconf which uses an XML backend. You should not modify those files by hand, better use "xfconf-query" to script the process of adding a shortcut if you want to add them quickly.

Cheers,

Jérôme

Thanks Jerome, I'll look at this 'xfconf-query'.
But the question still remains: Why does xfconf use XML? One of the nicest things about the linux world is that most config files are plain text and I'm wondering why xfce4 has made an exception here. Of course I know that other apps and other desktops have some non-text config files to, but since plain text is so 'obviously' better, there must be some very good reason why xfconf doesn't use it. I'm just trying to understand some of the deep reasons why things are done a certain way.

Offline

#4 2012-03-12 19:30:38

jeromeg
Member
From: France
Registered: 2010-11-11
Posts: 131
Website

Re: why are keyboard shortcut files .xml?

I can't say exactly why, but XML is IMO far easier to parse / manipulate / more structured than a text file. I guess one good reason is that Brian wrote it like that big_smile

Offline

#5 2012-03-12 20:40:19

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: why are keyboard shortcut files .xml?

Maybe it gives a sort of head start in parsing things -- XML engines already 'know' how to retrieve information. Still:

<alt>F1    opera
<alt>F2   thunderbird
....

seems like it would be easy to parse and easy to write.

Offline

Board footer

Powered by FluxBB