how do i open file links with the ranger file manager?
when trying to open the containing folder of a file i just downloaded in firefox i get asked what program i would like to open this file link with. i selected /bin/ranger and nothing happens. how do i get the equivialent of typing "ranger (well most of the time it's ~/Downloads)" in a terminal?
About this post
- Posted
- Archived
- Score
- 13 · 100% up
- Kind
- Text
- ID
- 93fm8a
11 comments
If I understand your question, it's because you don't call ranger in a terminal, try something like
yourterm -e rangerLike you would do in a launcher.
my arch installation does not know "yourterm" nor can pacman or yaourt find it.
No I meant
yourtermneed to be replaced by your actual terminal emulator, sry. So if you're using urxvt, you need to writeurxvt -e rangerSame with xterm, termite etc
Edit : Typo
You should probably use something other than yaourt.
Put that in a script.
Probably. Certainly some string substitution to check as I am currently not on my computer to verify.
what's the "${1#/*:-~/Downloads}" do?
I can try breaking it down:
same as $1 but enables you to put special bash syntax
the # after a variable name is "Parameter expansion: remove shortest matching prefix pattern" so
just means "remove first letter in the variable if it is a forward slash". This to me doesn't make much sense because it would just remove the initial (root) slash, perhaps the author meant ${1%pattern} which is "remove shortest suffix pattern" (which is after), the "/*" expands to a forward slash and ANY string following it, so in the case of suffix it would remove everything after, in the case of shortest prefix it would only remove the slash
means "Parameter expansion: Use default value", which just means that if the $1 variable is unset it will default to the word following it
edit: just so you know, this has nothing to do with what you're asking for, the answer is that you need to open a terminal to use terminal programs.
Deleted before we saved it.
Remove file name (after last / in path). If no argument given then return the downloads folder.
I guess, you'll have to try because I'm not at my computer