You are not logged in.
Pages: 1
Is there a relatively easy way to print out the keyboard shortcuts in XFCE?
I found the shortcuts in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml, but I haven't found any way to easily print out the active shortcuts to a neat list suitable for printing.
I installed and messed about with various xml parsers (xmllint, xmlgrep, xml_grep, xmlstarlet), but being completely new to parsing xml and the parsers themselves it quickly turned into much more of a major project than I was expecting. So much so that I think it would be much easier to just manually transcode the information to a nice format by simple copying and pasting.
But before I did that, I thought I'd check here to see if anyone has already found a solution to this. I think it would be a better long-term solution to have a script to do this automatically.
If anyone can point me to a simpler method than having to plod through the frustratingly obscure man pages of the xml parsers I would be very appreciative.
Offline
Does this help:
xfconf-query -c xfce4-keyboard-shortcuts -lv
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
Does this help:
xfconf-query -c xfce4-keyboard-shortcuts -lv
Brilliant! That's perfect. I didn't even know there was such a thing as 'xfconf-query'.
Thanks a gazillion.
Offline
xfconf-query is pretty useful. For more information about it, see http://docs.xfce.org/xfce/xfconf/xfconf-query.
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
xfconf-query is pretty useful. For more information about it, see http://docs.xfce.org/xfce/xfconf/xfconf-query.
I read the man file immediately after reading your first post
There doesn't seem to be any way to limit xfconf-query's results to the user's config alone (ie. ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml only), so it would be necessary to remove the system-defined shortcuts from the list.
Seeing as how I hate not knowing how to do things, I persisted with the xml parsing thing and came up with this monstrosity that extracts the values from the user's config, replaces <Super> with <Win> and <Primary> with <Ctrl>, and then formats the list into two columns (my apologies to anyone who knows how to do this properly - I'm just making it up as I go):
'xmlstarlet sel -T -t -v "//property[@name and @value and contains(@type, 'string')]/@name|//property[@name and @value and contains(@type, 'string')]/@value" ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml | awk '{getline line2;print $0, "@", line2}' | sed 's/<Super>/<Win>/g' | sed 's/<Primary>/<Ctrl>/g' | column -t -s @'
To sort on the first column, append ' | sort', and to sort on the second column append ' | sort -k 2'.
Last edited by Pheeble (2016-09-02 06:42:42)
Offline
Pages: 1
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 548.09 KiB (Peak: 550.43 KiB) ]