Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-12-03 20:31:15

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 482

keyboard shortcuts - where do they initially come from?

does anyone know where the initial (for a new user, first time) configuration for keyboard shortcuts comes from?  i can't find an xml file like that in /usr.  maybe it combines things.  in the saved file, i've see some duplication.  for some keys 2 of the same.  for some other keys 2 different. for many other keys, no duplication.  many keys a defined with type="empty" and i wonder if those lines are needed.  it looks like the data structure it keeps might be a bit bonkers, though not enough to be broken.  that structure is probably supported by some library code that allows duplicates (an AVL tree implementation i did many years ago in C supported duplicates, but you had to set a flag to get them).

Offline

#2 2019-12-03 23:11:43

MrEen
Member
Registered: 2019-04-19
Posts: 91

Re: keyboard shortcuts - where do they initially come from?

Is this the file you're looking for:

/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml

Offline

#3 2019-12-04 01:48:33

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 482

Re: keyboard shortcuts - where do they initially come from?

yes... i didn't think to look in /etc.

a lot of the keys defined in there don't seem to end up in the users saved file.  i wonder if it always preloads that file every time and then loads the user saved file over it.  but that would not explain its saving of a subset of entries to the user file.  i might have to take a look at source code and/or various libraries.

i am going to experiment with this some.  for one test, i will remove all the entries with type="empty".

Last edited by Skaperen (2019-12-04 01:48:58)

Offline

#4 2019-12-04 01:54:51

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,046

Re: keyboard shortcuts - where do they initially come from?

It uses that file only once, when a user logs in for the first time. That file is used as the default template to create the file in the users ~/.config directory. Also, note the xubuntu-based distros use the /etc/xdg/xdg-xubuntu tree as the default templates if logging in the first time using the xubuntu session (as opposed to the xfce session).

Offline

#5 2019-12-05 00:45:19

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 482

Re: keyboard shortcuts - where do they initially come from?

an early test i did was create a fresh new user w/o a shortcuts file and add just one shortcut to save the file.  there were a lot of differences.  also, i don't understand why some property items are indented differently.  my limited understanding of XML tells me it doesn't affect the data, so it must be some human convenience or hint.  but why certain indents is unclear.

...
  <property name="xfwm4" type="empty">
    <property name="default" type="empty">
      <property name="&lt;Alt&gt;Insert" type="empty"/>
      <property name="Escape" type="empty"/>
      <property name="Left" type="empty"/>
...

it could be indenting by the name, but it would have to be Xfce code to understand where/what to indent, not XML library code.  and, what's the point of having "empty" entries?  it would, at least, need to know what names to have "empty".  again, Xfce code, not XML code.  i will try leaving out the "empty" entries in the ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml file and see what happens.

i have been using shortcuts to switch user.  but i made a "stu" script as a command front end.

lt2a/forums /home/forums 23> which stu
/usr/host/bin/stu
lt2a/forums /home/forums 24> cat /usr/host/bin/stu
#!/usr/bin/env python3
import os,sys
os.execv('/usr/bin/dm-tool',['dm-tool','switch-to-user',sys.argv[1]])
lt2a/forums /home/forums 25> 

Last edited by Skaperen (2019-12-05 00:46:08)

Offline

Board footer

Powered by FluxBB