Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-02-04 17:35:46

KBar
Member
Registered: 2021-11-05
Posts: 689

[SOLVED] Keyboard shortcuts: Reset to Defaults

I wanted to reset all my keyboard shortcuts—both for /commands and /xfwm4.
I clicked on Reset to Defaults in both Keyboard and Window Manager settings dialogs. It didn't clear or reset much of them.
I, then, launched Settings Editor and reset the whole xfce4-keyboard-shortcuts channel. It did nothing.
Finally, I logged out, switched to a virtual terminal, killed the Xfconf daemon, removed the xfce4-keyboard-shortcuts.xml and logged back in. This cleared most of the defaults and now I barely have any shortcuts. I do have my backup file, though.

I remember reading (probably somewhere in the documentation or source code) that it's unfeasible to reset keyboard shortcuts to defaults. Am I remembering wrong or is it more or less true? What would be a clean way to achieve this? Is yanking the file from a fresh Xubuntu installation the only course of action as it stands?

Last edited by KBar (2022-02-04 23:44:51)


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#2 2022-02-04 23:15:47

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

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

A bit of a rabbit hole here....

https://git.xfce.org/xfce/xfce4-setting … gs.c#n1243 - if the reset button is clicked, call xfce_shortcuts_provider_reset_to_defaults (this is part of libxfce4ui - https://git.xfce.org/xfce/libxfce4ui/tr … der.c#n386).

This function calls xfce_shortcuts_provider_clone_defaults which:

/* Copy from /commands/default to /commands/custom property by property */

Is this what you see happening?

If you delete the file, it will be recreated from /etc/xdg....


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2022-02-04 23:43:38

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

ToZ wrote:

A bit of a rabbit hole here....

https://git.xfce.org/xfce/xfce4-setting … gs.c#n1243 - if the reset button is clicked, call xfce_shortcuts_provider_reset_to_defaults (this is part of libxfce4ui - https://git.xfce.org/xfce/libxfce4ui/tr … der.c#n386).

Yep! That's the call I encountered but couldn't find which library provides it.

This function calls xfce_shortcuts_provider_clone_defaults which:

/* Copy from /commands/default to /commands/custom property by property */

Is this what you see happening?

Beautiful explanation and this is exactly what's happening, yes! I went over this process again and told Xfconf to monitor the channel.

xfconf-query --channel xfce4-keyboard-shortcuts --monitor --verbose
Start monitoring channel "xfce4-keyboard-shortcuts":

reset: /commands/custom/<Alt>F3/startup-notify
reset: /commands/custom/<Alt>F3
reset: /commands/custom/<Super>f
reset: /commands/custom/<Alt>F1
reset: /commands/custom/<Super>w
reset: /commands/custom/<Super>l
reset: /commands/custom/<Super>r
reset: /commands/custom/Print
reset: /commands/custom/<Alt>F2/startup-notify
reset: /commands/custom/<Alt>F2
reset: /commands/custom/<Super>m
reset: /commands/custom/<Primary>Escape
reset: /commands/custom/<Super>1
reset: /commands/custom/XF86Calculator
reset: /commands/custom/<Super>t
reset: /commands/custom/XF86HomePage
reset: /commands/custom/<Alt>Print
reset: /commands/custom/<Super>2
reset: /commands/custom/<Super>F1
reset: /commands/custom/<Primary><Alt>l
reset: /commands/custom/XF86Display
reset: /commands/custom/<Shift>Print
reset: /commands/custom/<Super>p
reset: /commands/custom/<Super>e
reset: /commands/custom/override
reset: /commands/custom/<Super>grave
set: /commands/custom/XF86Messenger (pidgin)
set: /commands/custom/<Alt>F3/startup-notify (true)
set: /commands/custom/<Primary><Alt>Delete (xflock4)
set: /commands/custom/<Super>f (exo-open --launch FileManager)
set: /commands/custom/<Super>4 (libreoffice --calc)
set: /commands/custom/<Alt>F1 (xfce4-popup-applicationsmenu)
set: /commands/custom/<Super>w (exo-open --launch WebBrowser)
set: /commands/custom/<Super>l (xflock4)
set: /commands/custom/<Primary><Alt>t (exo-open --launch TerminalEmulator)
set: /commands/custom/<Super>r (xfce4-appfinder)
set: /commands/custom/XF86Music (parole)
set: /commands/custom/Print (xfce4-screenshooter -f)
set: /commands/custom/<Primary><Alt>Escape (xkill)
set: /commands/custom/<Alt>F2 (xfrun4)
set: /commands/custom/XF86Explorer (exo-open --launch FileManager)
set: /commands/custom/<Super>m (exo-open --launch MailReader)
set: /commands/custom/<Primary>Escape (xfce4-popup-whiskermenu)
set: /commands/custom/<Alt>F3 (xfce4-appfinder)
set: /commands/custom/<Super>1 (parole)
set: /commands/custom/XF86Calculator (mate-calc)
set: /commands/custom/<Super>t (exo-open --launch TerminalEmulator)
set: /commands/custom/XF86HomePage (exo-open --launch WebBrowser)
set: /commands/custom/<Alt>Print (xfce4-screenshooter -w)
set: /commands/custom/<Super>2 (pidgin)
set: /commands/custom/<Super>F1 (xfce4-find-cursor)
set: /commands/custom/<Primary><Alt>l (xflock4)
set: /commands/custom/<Alt>F2/startup-notify (true)
set: /commands/custom/XF86Display (xfce4-display-settings --minimal)
set: /commands/custom/XF86Mail (exo-open --launch MailReader)
set: /commands/custom/<Shift>Print (xfce4-screenshooter -r)
set: /commands/custom/<Super>p (xfce4-display-settings --minimal)
set: /commands/custom/<Super>e (mousepad)
set: /commands/custom/XF86WWW (exo-open --launch WebBrowser)
set: /commands/custom/<Super>3 (libreoffice --writer)
set: /commands/custom/override (true)
^C

If you delete the file, it will be recreated from /etc/xdg....

Ah, I can see that skeleton file now. Why didn't that occur to me? yikes

Thanks a lot for this valuable information! You're a much better rabbit than I am, that's for sure. tongue


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#4 2022-02-05 00:07:06

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

As a side quest, I figured out where and how to find such function calls in cases where source has not been cloned to local machine:

strings -f $(find /usr/lib/`uname -m`-linux-gnu/ -name 'libxfce4*') | grep 'xfce_shortcuts_provider_reset_to_defaults'
/usr/lib/x86_64-linux-gnu/libxfce4kbd-private-3.so.0.0.0: xfce_shortcuts_provider_reset_to_defaults
/usr/lib/x86_64-linux-gnu/libxfce4kbd-private-3.so.0.0.0: xfce_shortcuts_provider_reset_to_defaults
/usr/lib/x86_64-linux-gnu/libxfce4kbd-private-3.so.0: xfce_shortcuts_provider_reset_to_defaults
/usr/lib/x86_64-linux-gnu/libxfce4kbd-private-3.so.0: xfce_shortcuts_provider_reset_to_defaults
/usr/lib/x86_64-linux-gnu/libxfce4kbd-private-2.so.0: xfce_shortcuts_provider_reset_to_defaults
/usr/lib/x86_64-linux-gnu/libxfce4kbd-private-2.so.0: xfce_shortcuts_provider_reset_to_defaults
/usr/lib/x86_64-linux-gnu/libxfce4kbd-private-2.so.0.0.0: xfce_shortcuts_provider_reset_to_defaults
/usr/lib/x86_64-linux-gnu/libxfce4kbd-private-2.so.0.0.0: xfce_shortcuts_provider_reset_to_defaults

Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#5 2022-02-05 17:15:48

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

Another tiny discovery: on Xubuntu systems, the defaults are placed in a separate subdirectory /etc/xdg/xdg-ubuntu/ by the xubuntu-default-settings package. The file is /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml.

Last edited by KBar (2022-02-05 17:16:04)


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#6 2022-02-05 17:34:47

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

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

KBar wrote:

Another tiny discovery: on Xubuntu systems, the defaults are placed in a separate subdirectory /etc/xdg/xdg-ubuntu/ by the xubuntu-default-settings package. The file is /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml.

That actually depends on the "session" you are selecting. On Xubuntu, since they create their own xdg instance, there are two: the default one in /etc/xdg and the customized one in /etc/xdg/xubuntu. If you choose the Xubuntu session, it will use the files in xdg-xubuntu as default. If you choose the xfce session, it will use the other ones.

I don't have a xubuntu machine readily available to check myself, but check your environment variables, there should be a session setting that identifies Xubuntu as the session and the proper xdg being used (maybe XDG_CURRENT_DESKTOP and XDG_CONFIG_DIRS?)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2022-02-06 04:12:33

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

Ah, I see. It's XDG_SESSION_DESKTOP on my system. It's set to either xubuntu or xfce depending on which session I choose, as you explained.

One more interesting fact, though: it looks like removing the config file performs a harder reset and Xfconf then pulls the Xfce defaults (which don't have a lot of shortcuts), not Xubuntu ones, even in a Xubuntu session.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#8 2022-02-06 04:15:42

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

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

KBar wrote:

One more interesting fact, though: it looks like removing the config file performs a harder reset and Xfconf then pulls the Xfce defaults (which don't have a lot of shortcuts), not Xubuntu ones, even in a Xubuntu session.

That is odd. What is XDG_CONFIG_DIRS set to when you do that?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2022-02-06 04:23:33

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

ToZ wrote:

That is odd. What is XDG_CONFIG_DIRS set to when you do that?

It's always set to /etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg but let me test it once more.

On a side note, the drop-down feature for Xfce terminal is absolutely amazing. I'm loving it. Do you use it as well? It's one of the best features, I'd say.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#10 2022-02-06 04:47:14

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

Yep, the variable doesn't vary at all. The new created file is a bit different than the one in /etc/xdg/ (everything under /default is empty) but the shortcuts themselves seem to be identical (everything under /custom is set to /default of the skel file).

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


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#11 2022-02-06 12:17:05

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

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

KBar wrote:
ToZ wrote:

That is odd. What is XDG_CONFIG_DIRS set to when you do that?

It's always set to /etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg but let me test it once more.

Then it should use the one in /etc/xdg/xdg-xubuntu since it would be found first.

On a side note, the drop-down feature for Xfce terminal is absolutely amazing. I'm loving it. Do you use it as well? It's one of the best features, I'd say.

I did use it at one time, but now I just open a terminal window when I need it. It is definitely an interesting feature though.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2022-02-06 12:23:35

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: [SOLVED] Keyboard shortcuts: Reset to Defaults

ToZ wrote:

Then it should use the one in /etc/xdg/xdg-xubuntu since it would be found first.

Yes! It should but it refuses. There's definitely some weird stuff going on. This morning, I also lost my Xubuntu default custom actions for Thunar. Notice the mtime:

17:20:55 ~/xfwm4-4.14.1 ls -lA ~/.config/Thunar/*
-rw-r--r-- 1 kbar kbar 5722 Feb  6 17:01 /home/kbar/.config/Thunar/accels.scm
-rw-rw-r-- 1 kbar kbar  213 Oct  9 16:01 /home/kbar/.config/Thunar/renamerrc
-rw------- 1 kbar kbar  381 Feb  6 09:01 /home/kbar/.config/Thunar/uca.xml

I guess I'll just copy the skel uca.xml file.

Last edited by KBar (2022-02-06 12:24:04)


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 627.98 KiB (Peak: 644.82 KiB) ]