You are not logged in.

#1851 2014-04-17 21:53:29

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Ranger, a textbased filemanager

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. wink

Offline

#1852 2014-04-18 09:01:46

PieterGen
Member
From: Groningen, NL, EU
Registered: 2012-01-18
Posts: 59

Re: Ranger, a textbased filemanager

@ANOKNUSA, @mentat, @Th3Voic3 -  THANK YOU !  :-)

And thanks to the makers of Ranger - what a great File Manager.

Offline

#1853 2014-04-18 13:03:08

mentat
Member
From: France
Registered: 2009-01-13
Posts: 138
Website

Re: Ranger, a textbased filemanager

@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

#1854 2014-04-18 21:21:04

fukin_jim
Member
Registered: 2013-02-27
Posts: 19

Re: Ranger, a textbased filemanager

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

#1855 2014-04-22 09:09:26

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: Ranger, a textbased filemanager

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

#1856 2014-04-22 09:42:02

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 561
Website

Re: Ranger, a textbased filemanager

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

#1857 2014-04-22 19:22:52

Head_on_a_Stick
Member
From: Asteroid B-612
Registered: 2014-02-20
Posts: 3,944
Website

Re: Ranger, a textbased filemanager

Apologies for the empty post but what a superb file-manager --- thank you to all involved!
smile


_0_
__0
000

Offline

#1858 2014-04-22 20:35:05

3xOSC
Member
Registered: 2013-03-18
Posts: 107

Re: Ranger, a textbased filemanager

hut wrote:

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

#1859 2014-04-24 20:35:40

PieterGen
Member
From: Groningen, NL, EU
Registered: 2012-01-18
Posts: 59

Re: Ranger, a textbased filemanager

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

#1860 2014-05-11 18:11:17

sekret
Member
Registered: 2013-07-22
Posts: 206

Re: Ranger, a textbased filemanager

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 wink How can I do this / What am I doing wrong here?

Offline

#1861 2014-05-12 05:37:24

Kolibry
Member
Registered: 2012-12-20
Posts: 110

Re: Ranger, a textbased filemanager

Your command returns an error in my .bashrc, are you sure of it ? smile

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 smile

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

#1862 2014-05-12 06:53:41

progandy
Member
Registered: 2012-05-17
Posts: 2,151

Re: Ranger, a textbased filemanager

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

Offline

#1863 2014-05-20 17:37:13

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,213
Website

Re: Ranger, a textbased filemanager

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?


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#1864 2014-05-20 19:27:07

sekret
Member
Registered: 2013-07-22
Posts: 206

Re: Ranger, a textbased filemanager

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

#1865 2014-05-20 23:31:48

firecat53
Member
From: Sammamish, Wa
Registered: 2007-05-14
Posts: 1,448
Website

Re: Ranger, a textbased filemanager

Trilby wrote:

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

#1866 2014-05-21 04:00:25

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,213
Website

Re: Ranger, a textbased filemanager

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)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#1867 2014-05-21 04:12:54

firecat53
Member
From: Sammamish, Wa
Registered: 2007-05-14
Posts: 1,448
Website

Re: Ranger, a textbased filemanager

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!!

Offline

#1868 2014-05-21 15:38:43

PieterGen
Member
From: Groningen, NL, EU
Registered: 2012-01-18
Posts: 59

Re: Ranger, a textbased filemanager

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

#1869 2014-05-21 15:52:02

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,213
Website

Re: Ranger, a textbased filemanager

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)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#1870 2014-05-21 16:12:52

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,474
Website

Re: Ranger, a textbased filemanager

PieterGen wrote:

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

#1871 2014-05-21 19:10:03

PieterGen
Member
From: Groningen, NL, EU
Registered: 2012-01-18
Posts: 59

Re: Ranger, a textbased filemanager

@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

#1872 2014-05-21 19:27:38

hut
Member
From: Hanover, Germany
Registered: 2010-03-12
Posts: 561
Website

Re: Ranger, a textbased filemanager

@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


firecat53 wrote:
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

#1873 2014-05-21 19:52:49

PieterGen
Member
From: Groningen, NL, EU
Registered: 2012-01-18
Posts: 59

Re: Ranger, a textbased filemanager

@hut - I will (re)read the man allright wink smile   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

#1874 2014-05-21 20:28:26

firecat53
Member
From: Sammamish, Wa
Registered: 2007-05-14
Posts: 1,448
Website

Re: Ranger, a textbased filemanager

hut wrote:

Any idea how I could get more people to notice important changes in ranger?

Add post-install/upgrade message to the PKGBUILD?

Scott

Offline

#1875 2014-06-07 18:54:27

PieterGen
Member
From: Groningen, NL, EU
Registered: 2012-01-18
Posts: 59

Re: Ranger, a textbased filemanager

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

Board footer

Powered by FluxBB