You are not logged in.
Pages: 1
I have looked everywhere, and there does not seem to be a way to do this by default in Thunar? I just want to "back out" into the "real" parent...
(here is a "problem-solution" for the terminal https://unix.stackexchange.com/question … -by-a-link )
If a workaround is possible as a custom action, that would be swell! I have written a few CA-scripts, but I don't see a way to force thunar to "change dir" this way? (I am also not really a programmer.)
Any ideas? Maybe I am missing something?
Last edited by undercover_agent (2023-09-05 11:25:45)
^ - ^
Offline
Hello and welcome.
See this existing functionality enhancement request.
As for a custom action, try this (it will open a new thunar window in the link's directory and allow you to traverse that directory using the back buttons):
- Name = Move Into...
- Command = thunar "$(readlink %f)"
- Icon = YOUR_CHOICE
- Appearance = Directories
Alternatively, it you want to re-use the same thunar window, you could try using xdotool and the following command:
sh -c "xdotool key Ctrl+L type $(readlink %f); xdotool key Enter"
Last edited by ToZ (2023-09-05 10:08:39)
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
I did indeed want to re-use the same window:
Confirmed working!
Thank you! :)
P.s. My previous workaround was: RMB inside link -> Properties -> Copy "Link Target" line -> Paste in location bar
Which was not that fun...
^ - ^
Offline
This is a nice solution but doesn't work when there are spaces in the directory path. How do you escape it? I tried quotes and so on, nothing works.
Offline
Can confirm. Haven't noticed before -I guess I did not have any such links...
I am no bash programmer, but it seems thunar returns spaces as "%" and readlink (or realpath) doesn't like it. I tried reformatting, but i dont know how to do it one line for thunar for this solution...? Might be wrong tho.
^ - ^
Offline
I'm not sure how to do it correctly but you could search and insert it into the string above.
However, this is Linux, there shouldn't be any spaces used in directory paths. If it's a two or more word name I use "-" to make it one. It saves a lot of frustration later. Like now.
Siduction
Debian Sid
Xfce 4.18
Offline
Weird, but I had to move it into a script and not run it via "sh -c" to get it to work.
Create a script with the following content:
#!/bin/sh
LINK=$(readlink "$1")
xdotool key Ctrl+l
xdotool type "$LINK"
xdotool key Enter
...and make it executable.
Then change to custom action to point to this script.
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
Can confirm it works. Thanks!
I created a test link with spaces as I did not have any. (Though, I will not go into what "should" and "should not" be possible on linux.)
^ - ^
Offline
Thanks for the fix. I had to make the last line "xdotool key Return" because the script wasn't working and then when I debugged I was getting the message "(symbol) No such key name 'Enter'. Ignoring it." so I changed it to Return and now it works as expected.
Is there a way to adapt this to open the containing directory for a symlinked file? I'm going to play around with it and see.
Last edited by mocha (2023-11-04 18:13:18)
Offline
Here's what I came up with for a script that opens the containing folder of a symlinked file.
#!/bin/sh
LINK="$(dirname "$(readlink "$1")")"
xdotool key Ctrl+l
xdotool type "$LINK"
xdotool key Return
I called the custom action "Open Containing Folder..." and set it to appear only for files not directories. The action points to the script with a %f passed to it.
Offline
Pages: 1
[ Generated in 0.023 seconds, 7 queries executed - Memory usage: 559.93 KiB (Peak: 576.77 KiB) ]