ranger-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ranger-users] passing / testing macros to shell


From: Diederich Hessling
Subject: [Ranger-users] passing / testing macros to shell
Date: Thu, 21 Jan 2016 06:38:03 +0100

Hi there. I couldn't find much about this on the web, so I thought I'd just ask 
here.
I am not very familiar with this stuff, so... my question might be more related 
to bash or python(?) than being ranger-specific.
My aim is to use ranger to create a list of files and directories for later 
use. I found that the --choosefiles option works only inside the directory one 
is currently browsing. As the manual says, the "%c" macro is the only one that 
transcends the current dir.
So I browse my file tree and mark files and dirs with the "yank/copy" function.
I mapped a key to something like 'map td shell echo "%c" >> list_of_stuff' with 
some sed piping to give me line breaks and it works fine.
I would like that to work also when nothing is yanked/copied, and the shell 
expression then should use "%f" instead. 
I tried to insert a simple shell test in my rc.conf like '[[ -z "%c" ]] &&' but 
apart from not knowing how to correctly pass the macro it seems that ranger 
always gives an error if "%c" is empty.
What would be the best way to decide whether the %c or %f macro will be passed 
to the shell?

Cheers, Dieter
-- 
Diederich Hessling <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]