You are not logged in.
The macro '%f' represents the currently highlighted file. '%s' represents all files selected using the spacebar. You can open a single file as th3voic3 suggested, and use the macros PieterGen and I mentioned to run shell commands on highlighted/selected files. The man page has more details; ranger is pretty powerful and versatile, and will do as much or as little as you make it. What I'd recommend is find some free time, create a directory with a bunch of empty files and play around with the different functions listed in the man page.
Offline
@ANOKNUSA, @mentat, @Th3Voic3 - THANK YOU ! :-)
And thanks to the makers of Ranger - what a great File Manager.
Offline
@th3voic3
Cool ! Thx
@PieterGen
you don't have to type the filename type '%s' indeed.
'%s' is a replacement pattern for the selected file.
Edit: sorry didn't see ANOKNUSA post.
Last edited by mentat (2014-04-18 13:04:35)
Offline
For quick editing of files as root I made the following changes to rc.conf under the command aliases section. Why type more than you need to?
alias e edit
map E shell sudo vim %s
Offline
Hi,
I am wondering why placing a defaults.py that I copied over and I placed in ~/.config/ranger/colorschemes isn't getting loaded.
I changed some values for example, from red to green just to see what it changes and I still can't see the changes taking place. I did try changing things from default to jungle and snow and those changes took place. But once I edit defaults.py, I can't see any of the changes I have made.b
Can anyone lend a hand?
Offline
Because you named it "defaults.py", but it's called "default.py". Rename it or type ":set colorscheme defaults"
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Apologies for the empty post but what a superb file-manager --- thank you to all involved!
Para todos todo, para nosotros nada
Offline
Because you named it "defaults.py", but it's called "default.py". Rename it or type ":set colorscheme defaults"
Thanks a bunch. I am an idiot sometimes.
Btw, would it be possible to make the color scheme source the .dir_colors file?
Offline
Hi all, I can't find out how to see the file and directory permissions in octals. If I browse my files, ranger shows the permissions in letter notation (such as -r -xrwrxrwx) but I prefer an octal notation (like 577). Which is easier to read for me.
How to set ranger to show me the octals? Thanks.
Offline
Little help please!
I want to have a simple shortcut to quickly backup files or directories with the naming scheme
name.ext #original file
name.ext.$(date +%Y%m%d%H%M%S) #backup file
In bash this is easy
bu() {cp -a "$1" "$1.$(date +%Y%m%d%H%M%S)"}
but how to get this done in ranger in the rc.conf? The best I can come up with is
map db shell cp -a %s %s.$(date +%Y%m%d%H%M%S)
which produces the output
cp: cannot create regular file ‘test.201405/tmp2008/tmp/test’: No such file or directory
I've never done something in the rc.conf by myself, so excuse my ignorance How can I do this / What am I doing wrong here?
Offline
Your command returns an error in my .bashrc, are you sure of it ?
bash: /home/kolibry/.bashrc: ligne 212: erreur de syntaxe près du symbole inattendu « {cp »
bash: /home/kolibry/.bashrc: ligne 212: `bu() {cp -a "$1" "$1.$(date +%Y%m%d%H%M%S)"}'
Edit : Ok, just saw my mistake, sorry
Last edited by Kolibry (2014-05-12 14:39:06)
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
You'll have to escape the % signs that ranger should not replace. Somehow you have to do that twice. I don't know why:
shell echo %s".$(date +%%%%Y%%%%m%%%%d%%%%H%%%%M%%%%S)" >>/tmp/test
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
I've set up ranger to show indicators for git repos. But I've noticed that the symbols/indicators are not updated as changes to files are made and/or changes are committed. The only time ranger 'rechecks' the status seems to be when I exit ranger entirely and restart.
Is there a way to get ranger to recheck this more often, and/or is there a command that can be bound to a keybinding to recheck/refresh these indicators?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Sorry for the late reply, I forgot to look back here. Thanks progandy, your hint was gold!
map db shell cp -a %s %s".$(date +%%%%Y%%%%m%%%%d%%%%H%%%%M%%%%S)"
does the job now. Perfect!
Offline
I've set up ranger to show indicators for git repos. But I've noticed that the symbols/indicators are not updated as changes to files are made and/or changes are committed. The only time ranger 'rechecks' the status seems to be when I exit ranger entirely and restart.
Is there a way to get ranger to recheck this more often, and/or is there a command that can be bound to a keybinding to recheck/refresh these indicators?
How did you set that up? I looked for a bit and couldn't find anything. Just in case...did you try ^r (refresh)?
Scott
Offline
Well I'll be, ^r does in fact do it - but changing in and out of the directory doesn't. I assumed that the "refresh" just redrew the screen.
As for the setup, it's pretty vanilla, I just `set vcs_aware true` in rc.conf.
edit: don't try to post while tipsy ... the submit button is too easy to hit prematurely.
Last edited by Trilby (2014-05-21 04:01:26)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
As for the setup, it's pretty vanilla, I just `set vcs_aware true` in rc.conf.
<facepalm>Right in the manpage</facepalm> Reminder: if you've been using a piece of software for a long time, re-read the man page and options periodically to see what you might be missing!!
Offline
Who has advice how to make my favorite file manager even more awesome?
1. How do I set ranger as the file manager that opens files in e.g. Chromium or Firefox?
2. How can I make ranger use feh for previews of pictures when X is running; but libcaca (txt2ascii) when I'm without X (e.g. in a terminal) ?
THANKS
Offline
1) I don't know how a file manager can open files - usually one would use a file manager to open a file in something else. But if you already have other file managers opening files in this way, you probably are using xdg_open, or an equivalent in your DE. So, are you using a DE? If so, which one?
2) You could have entirely different config files for within X or in a tty:
if [[ "$TERM" == "linux" ]]; then
alias ranger='ranger -r /path/to/ttyconfigdir'
fi
EDIT: Unia's answer makes me think I completely misunderstood question 1. His interpretation of the question makes a lot more sense. I was thinking for files that are downloaded/opened from a website - not a file selection dialog.
Last edited by Trilby (2014-05-21 16:41:11)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
1. How do I set ranger as the file manager that opens files in e.g. Chromium or Firefox?
That's impossible as far as I know, the dialog is the default for the toolkit the browser uses which in this case is GTK2's builtin file dialog.
Last edited by Unia (2014-05-21 16:13:36)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
@Unia: thanks, I know next to nothing about toolkits. Some Googling learned me that building a Qt Chromium is hard (the Qt project guys experimented with it).
Crazy idea: I might look into changing GTK2 instead. So, Chromium calls GTK2 and GTK2 does MY thing when asked for a file manager, which is open a terminal and start ranger........ Maybe a dive into the Gentoo forums will give me some info ...
BTW, it seems that more people want what I want, I'll experiment with xdg-mime first :-)
Offline
@PieterGen
1. Ranger executes/opens files with rifle, so you could just choose to open the file with /usr/bin/rifle in chromium. I guess I never tested this, but it ought to work.
2. In my opinion, this should work out of the box, and I think it used to work like this at some point. I think it's a bug :S
Trilby wrote:As for the setup, it's pretty vanilla, I just `set vcs_aware true` in rc.conf.
<facepalm>Right in the manpage</facepalm> Reminder: if you've been using a piece of software for a long time, re-read the man page and options periodically to see what you might be missing!!
Any idea how I could get more people to notice important changes in ranger?
Last edited by hut (2014-05-21 19:31:19)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
@hut - I will (re)read the man allright I'll fiddle with mime types, rifle, chromium & ranger and I'll report if I succeed. Been playing with it now for 45 minutes without success, but I WILL make it work grrr :-) I'll also look again at the libcaca/feh issue. It's no big deal
Offline
From time to time ranger takes 100% of my CPU and starts frying my laptop. The issue has been mentioned before in this thread, I could not find a solution.
Case:
- I open ranger from the terminal (LXTerm, using the Openbox wm)
- I do some light work. in this case; copy a few small files from a USB stick to the hard disk
- sometimes I close ranger properly (q), sometimes i just close the terminal with the mouse. I think i did that
- actually, I had closed all terminals, and (as a consequence) no ranger running...... That is......
- a few minutes later my fan starts to howl. htop shows one process that takes 99 or 100% CPU time. I didn't write down the exact name (sorry), but it was some python process started by ranger
- the process refuses to be killed from htop.
- I have to either reboot, or sudo killall -9 thatbitch
Any hints on what may be going on? How do I prevent this bad behaviour? Thanks!
For the record: my system is up to date.
Last edited by PieterGen (2014-06-07 18:55:47)
Offline