You are not logged in.
Hi, this is a wonderful file manager.
I'm wondering if it is possibile to easily feed selected files to a shell script... I mean, I have a script called "script.sh" that for example does this:
IFS=$'\n\t'
for file in "$@"; do
convert -modulate 100,0 "$file" "black_$file"
done
I would like to select files in ranger and then feed them to it.
I tried running "./script.sh %s" but the (bash, zsh) shell tries to read literally "%s" as a filename. I tried "./script.sh $@" and nothing happened. I tried (as in rifle): "./script.sh -- $@", but it tried to read -- as a filename...
Offline
Have you tried "./script.sh %%s"?
Offline
Have you tried "./script.sh %%s"?
It works! Thank'you very much!
Last edited by andya (2014-11-04 11:03:04)
Offline
Hey I absolutely love this file manager but I seem to be having a minor problem.
Whenever I start Ranger in a tty and use it to open a file with any external program it seems to reset the colors in the terminal upon closing the external program. I have tried each of these programs individually and can't seem to replicate this issue. It is only when these programs are opened through Ranger.
Any help would be greatly appreciated.
Offline
@TheNineBaller - please pst your settings.
- Also, what colors does your terminal have before and after?
- how do yo open a terminal? ctrl-alt-F1 ? or do you use a terminal emulator like LXTerminal or Guake or Xterm? Does the problem happen in all those situations?
- if you run ranger without X, does it happen as well?
Offline
Can anybody give me a clue? I'd like an exta functionality for the up/down arrows. I think this asks for altering the source code, but I dpon't know where to start.
Suppose I'm in a directory that has 3 entries, say
file1.txt
file2.txt
subdirectory
What i'd like is that if I move the cursor down from file1.txt to file2.txt to subdirectory, that it re-starts at the top when I push the down arrow one more time.
And vice versa: I use the up-arrow: subdirectory ^ file2.txt ^ file1.txt and when I push the up arrow once more, I am again at the subdirectory and so on
Hope I made myself clear. That way, especially with long lists, you can go quickly to the top or bottom. Also, it feels logical, to go sort of in a circle: down, down and start at the top again. Any hints?
Last edited by PieterGen (2014-12-15 18:14:02)
Offline
I can't give you a real solution but typing Capital G will send you to the bottom of the directory and Ctrl-R to the top.
Last edited by Mercader1902 (2014-12-15 19:22:22)
Offline
Here is a quick solution.
Edit /usr/lib/python3.4/site-packages/ranger/ext/direction.py, add this in the move function, just above the return statement (l. 129 for me):
if self.get('cycle'):
return minimum + pos % (maximum + offset - minimum)
Also, beware of the indentation, use spaces (not tabulations) and align with the surrounding code. Python will complain elsewhere.
Then you can add (or redefine) this in your ~/.config/ranger/rc.conf :
map <DOWN> move down=1 cycle=true
map <UP> move up=1 cycle=true
copymap <down> j
copymap <up> k
This may be is worth a pull request: https://github.com/hut/ranger/pull/203.
Last edited by PotatoesMaster (2014-12-15 21:34:38)
Offline
@Mercader1902 - I know, but thanks anyway !
@PotatoesMaster - merci beaucoup! I am not that good at Python, this really helps. I'll try it out myself first and later make that pull request.
Edit: I see you have already made the pull request. Thanks PotatoesMaster!
Last edited by PieterGen (2014-12-16 16:27:02)
Offline
Hi,
I would like to be able to "cd" in a insensitive way. For example cd /home/user/vid and hit Tab to auto complete would bring me to /home/user/Vidéos.
Is that possible in ranger ? Thanks !
Asus 1225B - 11,6" - AMD E-60 Dual Core 1,3Ghz - 4 Go RAM - Disque dur SSD 128 Go - Radeon HD6290
ArchLinux Openbox - My Github
Offline
Hello,
It's already the case you can hit Shift + Tab to autocomplete the path.
Offline
It doesn't do anything at all for me
Can you share your config, maybe I'm missing something here.
Asus 1225B - 11,6" - AMD E-60 Dual Core 1,3Ghz - 4 Go RAM - Disque dur SSD 128 Go - Radeon HD6290
ArchLinux Openbox - My Github
Offline
Don't know if it's a ranger internal feature.
here it is.
command.py :
http://sebsauvage.net/paste/?71b35506d3 … UREqs4w8s=
rc.conf:
http://sebsauvage.net/paste/?73a2eeb1a4 … ixMwcmdIM=
I'm under zsh.
Cheers
Offline
It works for me (ranger-git) if you don't use slashes in the :cd command (TAB goes to the next completion, Shift+TAB to the previous one)
Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline
For me TAB bring back to cd history.
Offline
It works for me (ranger-git) if you don't use slashes in the :cd command (TAB goes to the next completion, Shift+TAB to the previous one)
I have the same behaviour, unfortunately it's still case sensitive.
Last edited by Kolibry (2015-01-28 15:40:29)
Asus 1225B - 11,6" - AMD E-60 Dual Core 1,3Ghz - 4 Go RAM - Disque dur SSD 128 Go - Radeon HD6290
ArchLinux Openbox - My Github
Offline
.
Last edited by Kolibry (2015-01-28 15:41:03)
Asus 1225B - 11,6" - AMD E-60 Dual Core 1,3Ghz - 4 Go RAM - Disque dur SSD 128 Go - Radeon HD6290
ArchLinux Openbox - My Github
Offline
I have overloaded the cd command of ranger: here.
The tab method is copied from ranger's original, with the block at lines 44 to 49 added.
Tab-completion is case-insensitive when no other match is found.
to use it, add this line at the top of your ~/.config/ranger/commands.py file (create it if needed):
from ranger.config.commands import cd
and paste the highlighted lines present in the page linked above.
Offline
Thanks for the help, but it didn't do anything. I also tried to replace my commands.py with the one from your link and my auto completion was simply just gone
Asus 1225B - 11,6" - AMD E-60 Dual Core 1,3Ghz - 4 Go RAM - Disque dur SSD 128 Go - Radeon HD6290
ArchLinux Openbox - My Github
Offline
Oh, you are using ranger-stable.
Here you go : same hack for ranger 1.6.1.
Offline
It works now ! Thanks you very much !
Asus 1225B - 11,6" - AMD E-60 Dual Core 1,3Ghz - 4 Go RAM - Disque dur SSD 128 Go - Radeon HD6290
ArchLinux Openbox - My Github
Offline
Using two different terminals: one being termite and the other urxvt, when i start ranger (the same source of config files), termite displays all the text in a regular manner, but with urxvt, the text is in bold?
Does anyone have any ideas what is going on?
Offline
A feature that I think would be incredibly useful, is to be able to mark a directory for copy, then select only specific subdirectories to be copied. I am currently trying to copy a bunch of music sorted by artist, then album, and wish I could do the entire copy in one go. What I want is a way to select albums to copy, but keep the folder hiearchy.
Does anyone have any idea if this is possible with Ranger?
Last edited by kalda341 (2015-02-09 19:24:55)
Offline
You could tag them with a specific tag, for example by typing "x, then use the --list-tagged-files=x option in a custom script to move them. Then clear the tags afterwards.
One script that worked for me was this:
ranger --list-tagged-files=x | xargs -d "\n" -n 1 bash -c 'source="$0"; target="/home/kalda/destination/${source#/home/kalda/source/}"; mkdir -p "$(dirname "$target")"; cp -av "$source" "$target"'
Make sure to replace /home/kalda/source/ with the directory you're copying from, and /home/kalda/destination/ with the target directory.
To clear all x tags, you could use
sed -i '/^x:/d' ~/.config/ranger/tagged
Last edited by hut (2015-02-09 23:59:45)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
I'm not sure what I'm missing here. I added the code to my commands.py as the Wiki instructed me to do here: https://wiki.archlinux.org/index.php/Ranger#Compression
Creating a archive works. I also added my own shortcut for it: ":map Pc compress %s.zip". But extracting archives (:extracthere) does not work at all. I dont get any output or anything?
What am I doing wrong?
Offline