For Thunar:
This problem has haunted me since the gtk_accel_path
method stopped working around Ubuntu version 21.10. I'm running thunar
version 4.16.10. I think I have a solution using autokey-gtk
:
Install autokey
sudo apt install autokey-gtk
Open the AutoKey application, click New, then Script, and then I named it backspace_for_parent (your choice). Replace # Enter script code
with the following:
win_class = window.get_active_class()
win_title = window.get_active_title()
if win_class == 'Thunar.Thunar' and win_title.startswith("/"):
keyboard.send_keys("<alt>+<up>")
else:
keyboard.send_keys("<backspace>")
(The second startswith
condition above was needed to allow normal backspace when renaming files or setting the name of a new folder.)
Then, below, for Hotkey, click Set. Click Press to Set and hit backspace and then click OK.
Finally, at the top, click Save.
Now, in Thunar, hitting the backspace key opens the parent folder!
This is slightly suboptimal in that it uses an external application, but AutoKey is fantastic and it's already part of my daily workflow, so nbd from my perspective.
Hope this helps someone.
Inspiration taken from:
https://unix.stackexchange.com/a/491868/126708