[Suggestion] Change default keyboard shortcuts in Thunar

Bug #1793395 reported by ondondil on 2018-09-19
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xubuntu-default-settings (Ubuntu)
Undecided
Unassigned

Bug Description

I would like to propose two changes to Thunar's default keyboard shortcuts.
The first change that I suggest is to add "F4" key as a shortcut to two existing custom actions that are responsible for opening the terminal in the current working directory. A similar solution is already present in different file managers like Kubuntu's Dolphin and Lubuntu's PCManFM, so it's something that some users may already be familiar with.

The second change I suggest is for the search option. Currently, the search for the first matching name in the current working directory can be performed by pressing the "Ctrl + F" shortcut and starting to type in the search term. One could also start to type in the search term without using any shortcut whatsoever. The result is the same. Given that you can perform the same action in two different ways, I think "Ctrl + F" shortcut could be reassigned to "Find in this folder" custom action which opens catfish with a command "catfish --path=%f", so user could perform recursive search.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xubuntu-default-settings (Ubuntu):
status: New → Confirmed

Can this be achieved via xubuntu-default-settings?

ondondil (ondondil) wrote :

Quoting Thunar's FAQ:
"If you are a packager or a system administrator and want to provide a system wide default for the keyboard shortcuts, that is different from the default shortcuts in Thunar, you can create a file Thunar/accels.scm in one of the $XDG_CONFIG_DIRS. For example, if /etc/xdg is part of $XDG_CONFIG_DIRS (the default for most Linux distributions), you can install system wide defaults to /etc/xdg/Thunar/accels.scm. Thunar will then load shortcuts from this file on first startup."
https://docs.xfce.org/xfce/thunar/faq#where_does_thunar_store_the_keyboard_shortcuts

I already do achieve this by modifying ~/.config/Thunar/accels.scm on my machines. That's why I assumed that this is the right place to ask.

I cannot find Ctrl+F in the accels.scm and those custom actions have a unique ID which is not known beforehand.

https://git.launchpad.net/xubuntu-default-settings/tree/etc/xdg/xdg-xubuntu/Thunar/uca.xml.in

Therefore, I assume that changes in the Thunar source code are needed.

I have read your suggestion text again, and I realized that assigning a keyboard shortcut to the "Find in this folder" custom action would override the default action for Ctrl+F. So, no problem there.

ondondil (ondondil) wrote :

Yes, it would override the default action for that shortcut. I'm sorry that I didn't make it clear.
I suggested using Ctrl + F, which would override the default action, because people commonly associate this shortcut with a search function, and non-recursive search in current working directory still can be performed in a another way so we don't lose functionality. However, we don't necessarily have to use Ctrl + F for that custom action. If you're personally against this change or there is a concern that using an existing shortcut for something different will cause too much controversy among Thunar users, who are used to the current state of things, we could use different unused shortcut, such as Ctrl + Shift + F. My main idea here is to make recursive search more accessible and the actual shortcut that would be used for this is a secondary matter for me as long as it stays intuitive and easy to press with one hand.

As for the unique identifier requirement - if I am not mistaken, it should be possible to create unique identifiers for custom actions provided by Xubuntu, by modifying
https://git.launchpad.net/xubuntu-default-settings/tree/etc/xdg/xdg-xubuntu/Thunar/uca.xml.in
I have attached the diff file that demonstrates how uca.xml.in could be altered. After hardcoding these unique identifiers it would become possible to create /etc/xdg/xdg-xubuntu/Thunar/accels.scm file with shortcuts assigned to the custom actions. It should still be possible for the user to overwrite the default shortcuts using GUI or modifying ~/.config/Thunar/accels.scm by hand.

In case of doubt if assigning the same shortcut (F4) to two different custom actions rather than one could and should be done - IMO this is needed because one custom action is responsible for opening the terminal when folder is selected or nothing is selected at all. The second custom action is responsible for opening the terminal when a file is selected. Assigning F4 shortcut to only one of these actions will result in the inability to open the terminal with a shortcut in one of the above situations.
Although the graphical editor does not allow you to assign one shortcut to two different actions, it's still possible to do this by editing accels.scm and doing so doesn't seem to cause any conflicts in this particular case.

ondondil (ondondil) wrote :

I forgot to attach new accels.scm with corresponding shortcuts so I'm adding it now.

Also I think I should mention that those shortcuts are only as powerful as custom actions they match. So the F4 shortcut will not work when many files or folders are selected because the custom actions that this shortcut is tied to also do not work in this situation.

Similarly, the Ctrl + Shift + F shortcut won't work when a file or multiple folders are selected.
This is why reconsidered my initial proposal and I no longer think that overriding the existing Ctrl + F shortcut is such a good idea. It would introduce inconsistent behaviour - when custom action can be applied it would launch catfish and when custom action is not be available, because some files or multiple folders are selected, it would launch in-window non-recursive search. Which is why I think it would be better to use currently unused shortcut Ctrl + Shift + F.
Just to be clear: I still think that introducing default shortcuts for custom actions is going to benefit the users. We just need not to override existing shortcuts.

Sean Davis (bluesabre) wrote :

Thanks for the detailed report! Applied the new F4 and Ctrl + Shift + F keyboard shortcuts with the below commit.

https://git.launchpad.net/xubuntu-default-settings/commit/?id=e74c3ef24752b4bb1096bd3cd4b15c0f23d72280

Changed in xubuntu-default-settings (Ubuntu):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xubuntu-default-settings - 19.04

---------------
xubuntu-default-settings (19.04) disco; urgency=medium

  * Add Terminal (F4) and Find (Primary+Shift+F) shortcuts to Thunar (LP: #1793395)
    - etc/xdg/xdg-xubuntu/Thunar/accels.scm
    - etc/xdg/xdg-xubuntu/Thunar/uca.xml.in
  * debian/xubuntu-default-settings.gsettings-override:
    - Set GNOME/GTK 3 dconf keys for fonts (LP: #1769774)
  * etc/xdg/xdg-xubuntu/autostart/xfce4-tips-autostart.desktop
    - Removed, obsolete (LP: #1805005)
  * etc/xdg/xdg-xubuntu/Thunar/uca.xml.in:
    - Enable startup-notify in Thunar's uca.xml (LP: #1794118)
  * etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml:
    - Add shortcut for xfce4-screenshooter region capture (Shift+Print) (LP: #1812234)
  * etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml:
    - Set default inactivity mode to Suspend on AC and battery (LP: #1768038)
  * etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfprint.xml
    - Removed, obsolete (LP: #1805007)
  * usr/share/xubuntu/applications/defaults.list:
    - Replace invalid macroEnabled mimetypes (LP: #1802582)
    - Remove invalid x-scheme-handler/file handler (LP: #1778069)

 -- Sean Davis <email address hidden> Mon, 28 Jan 2019 22:44:14 -0500

Changed in xubuntu-default-settings (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers