You are not logged in.

#1351 2012-06-13 10:45:47

D.
Member
Registered: 2012-05-15
Posts: 64

Re: Ranger, a textbased filemanager

I post just to express how great I think ranger is. Discovered it a few weeks ago, while looking for a new file manager and this is by far the coolest I've found and tested! I've been using it vanilla so far, didn't have much time to look into the configuration, but will sooner or later.

Thanks hut!

Offline

#1352 2012-06-13 12:05:02

myle
Member
Registered: 2011-08-11
Posts: 35

Re: Ranger, a textbased filemanager

I post to express my gratitude too. Even though I don't use emacs or vi, I remapped some of the key bindings and I am very happy with how fast and feature full ranger is.

Offline

#1353 2012-06-13 12:11:39

myle
Member
Registered: 2011-08-11
Posts: 35

Re: Ranger, a textbased filemanager

For what is worth and due to to discussion on the previous page:

I have set EDITOR=subl in my .profile and it works fine with ranger.

Offline

#1354 2012-06-14 07:32:31

Veedrac
Member
Registered: 2011-07-19
Posts: 81

Re: Ranger, a textbased filemanager

hut wrote:
Veedrac wrote:

EDIT: Probably best to implement proper escaping anyway, I think

What do you mean?

In other words, create a shell_escape variant that does work with it. It may be as simple as .replace('"', '\"'), but the current code is definately broken tongue

Offline

#1355 2012-06-15 17:01:42

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

I have two questions I couldn't find an answer on (although I haven't read through all 55 pages).

1. How can I create an option in ranger to set the selected image as background using feh? I saw some option on this in the config file but I'm not sure on how to enable it...
2. Can I get ranger to recognize the dir_colors I have set and use those? Or should I make my own colorscheme and if so, how can I do this?

Thanks in advance!


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

#1356 2012-06-15 17:24:30

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: Ranger, a textbased filemanager

If you haven't modified apps.py, just browse to an image file and use

<mode>l

or just

<mode>enter

to set the background.

From apps.py:

# A dependence on "X" means: this programs requires a running X server!
	@depends_on('feh', 'X')
	def app_set_bg_with_feh(self, c):
		c.flags += 'd'
		arg = {11: '--bg-scale', 12: '--bg-tile', 13: '--bg-center',
				14: '--bg-fill'}
		if c.mode in arg:
			return 'feh', arg[c.mode], c.file.path
		return 'feh', arg[11], c.file.path

So if you have an image file highlighted and you type "14l" (that's a lower-case L) feh gets called with "bg-fill"

If you type "13<enter" feh gets called with "bg-center"

Last edited by 2ManyDogs (2012-06-15 17:30:34)

Offline

#1357 2012-06-15 17:26:07

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

Ah, oke! I saw that snipped indeed but couldn't figure out how to run it...


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

#1358 2012-06-15 17:30:10

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: Ranger, a textbased filemanager

Took me a little while too; but it's pretty cool once you figure it out...

Last edited by 2ManyDogs (2012-06-15 17:33:53)

Offline

#1359 2012-06-15 17:37:41

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

2ManyDogs wrote:

Took me a little while too; but it's pretty cool once you figure it out...

It is! This filemanager has all this little gems hidden inside of it which took me hours of work to get working on other GUI filemanagers (well, not hours.. but you get the idea wink) Now I just want to get the colorscheme sorted and I'm all set!


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

#1360 2012-06-16 19:45:36

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

Re: Ranger, a textbased filemanager

You can copy the default color scheme from /usr/lib/python3.2/site-packages/ranger/colorschemes/default.py to ~/.config/ranger/colorschemes/ and modify it.

I noticed a bug in ranger-git which sometimes hides the sizes of files (right of the name) in the main column. Did anyone see it too and does anyone know how to reproduce it?


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#1361 2012-06-17 23:01:46

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

hut wrote:

You can copy the default color scheme from /usr/lib/python3.2/site-packages/ranger/colorschemes/default.py to ~/.config/ranger/colorschemes/ and modify it.

Thanks, that's what I'm doing now. However, I'm running into an error I don't get. I want media files to display bold cyan, except for images. I have this piece in my colorscheme:

if context.media:
    if context.image:
        fg = magenta
    else:
        fg = cyan
        attr |= bold

I took this from the default colorscheme you suggested and only changed the colors and added attr |= bold. When I try to run this, I get the following error:

File "/home/jente/.config/ranger/colorschemes/unia.py", line 30
    attr |= bold
               ^
IndentationError: unindent does not match any outer indentation level

Can someone tell me what I'm doing wrong?

EDIT:

Also, could someone tell me how I can mark office files (like .doc, .docx, .pdf etc) and backup files? (.pacnew, .pacsave, .bak, .log, .tmp...)

Last edited by Unia (2012-06-17 23:02:43)


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

#1362 2012-06-17 23:20:23

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: Ranger, a textbased filemanager

Unia wrote:

I took this from the default colorscheme you suggested and only changed the colors and added attr |= bold. When I try to run this, I get the following error:

File "/home/jente/.config/ranger/colorschemes/unia.py", line 30
    attr |= bold
               ^
IndentationError: unindent does not match any outer indentation level

what editor are you using? python is very sensitive to indentation...

unia wrote:

Also, could someone tell me how I can mark office files (like .doc, .docx, .pdf etc) and backup files? (.pacnew, .pacsave, .bak, .log, .tmp...)

(edit) -- never mind; I read the man page and hut's reply hmm

Last edited by 2ManyDogs (2012-06-18 02:00:35)

Offline

#1363 2012-06-18 01:29:33

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

Re: Ranger, a textbased filemanager

Unia wrote:

Also, could someone tell me how I can mark office files (like .doc, .docx, .pdf etc) and backup files? (.pacnew, .pacsave, .bak, .log, .tmp...)

Try typing

:mark <regexp>

for example

:mark \.(docx?|pdf)$

if you don't know regular expressions, you can just write

:mark word1|word2|word3|word4

"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#1364 2012-06-18 11:01:53

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

2ManyDogs wrote:

what editor are you using? python is very sensitive to indentation...

Ah, I got it. Inside ~/.nanorc I had this set:

## Convert typed tabs to spaces.
set tabstospaces

I will look into the next issue now and see if I can fix it big_smile
EDIT: If I understand Hut correctly, I type that in Ranger itself. That would mean I'll have to type it everytime I start ranger and want to colorize those types of files. Is there any possible way of putting something like this in the colorscheme so I won't have to type it all the time?

Last edited by Unia (2012-06-18 11:11:54)


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

#1365 2012-06-18 11:26:18

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

Re: Ranger, a textbased filemanager

disregard my comment, I misunderstood you. It was about "marking" the files in order to do some action with them, for example, to delete them all with :delete.

It's currently not possible to colorize any chosen file types for efficiency reasons. You can only specify certian keywords which are defined in ranger/gui/context.py:

CONTEXT_KEYS = ['reset', 'error', 'badinfo',
        'in_browser', 'in_statusbar', 'in_titlebar', 'in_console',
        'in_pager', 'in_taskview',
        'directory', 'file', 'hostname',
        'executable', 'media', 'link', 'fifo', 'socket', 'device',
        'video', 'audio', 'image', 'media', 'document', 'container',
        'selected', 'empty', 'main_column', 'message', 'background',
        'good', 'bad',
        'space', 'permissions', 'owner', 'group', 'mtime', 'nlink',
        'scroll', 'all', 'bot', 'top', 'percentage', 'filter',
        'marked', 'tagged', 'tag_marker', 'cut', 'copied',
        'title', 'text', 'highlight', 'bars', 'quotes', 'tab',
        'keybuffer']

You already used "media" and "image", maybe the "document" keyword is useful for you too, but in the stable version it includes only text files, no .doc files. This is fixed in ranger-git.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#1366 2012-06-18 11:29:55

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

Thanks for the quick reply. I will try the git version and what I can do with that!

EDIT: Thanks, working perfectly now!

Last edited by Unia (2012-06-18 11:33:30)


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

#1367 2012-06-18 18:28:48

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

It seems that in the git version, sxiv won't load the other images in the directory when you open an image with it. This used to work in the 'stable' ranger provided in [community]. I tried editing the apps.py in ~/.config/ranger but this file doesn't seem to be read anymore.

Also, in both versions, .wmv files aren't recognized as video files.


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

#1368 2012-06-18 18:53:10

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

Re: Ranger, a textbased filemanager

apps.py has been replaced with "rifle" in ranger-git. rifle is a file opener with more simple syntax and can be run independently of ranger.

This post should solve your problem:
https://bbs.archlinux.org/viewtopic.php … 8#p1081718

And you're missing a wmv entry in your mime types file:

video/x-ms-wmv wmv

you could put this into ~/.mime.types for example.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#1369 2012-06-18 18:54:03

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

Doh, I still got lots to learn! Thank for your help everytime hut! big_smile


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

#1370 2012-06-18 18:59:02

jk121960
Member
From: Palos Hills, Illinois
Registered: 2011-12-09
Posts: 254

Re: Ranger, a textbased filemanager

Hi, I use jit and it recognizes wmv just fine, if you look in rifle.conf you will find he is matching mime types not extensions when he does video, for some reason your system is not recognizing that as a video mime type. Not sure of how to remedy that but that is what it seems like. Possibly a preferred applications listing of some kind not knowing what your using I can't guess.

--jerry


Arch Awesome, Ranger & Vim the coding triple threat.

Offline

#1371 2012-06-18 18:59:43

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

jk121960 wrote:

Hi, I use jit and it recognizes wmv just fine, if you look in rifle.conf you will find he is matching mime types not extensions when he does video, for some reason your system is not recognizing that as a video mime type. Not sure of how to remedy that but that is what it seems like. Possibly a preferred applications listing of some kind not knowing what your using I can't guess.

--jerry

Little late, but thanks anyway! big_smile


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

#1372 2012-06-18 19:11:47

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: Ranger, a textbased filemanager

hut wrote:

apps.py has been replaced with "rifle" in ranger-git. rifle is a file opener with more simple syntax and can be run independently of ranger.

This post should solve your problem:
https://bbs.archlinux.org/viewtopic.php … 8#p1081718

Is there any chance that this script will ever be redundant? Whilst it works (and it does good) it would of course be better to have this function back by default.

For example (I don't even know if it's doable), why can't we use options for applications? That way we could call sxiv with the -r option to load all the pics in the directory.


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

#1373 2012-06-18 19:21:49

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

Re: Ranger, a textbased filemanager

Unia wrote:
hut wrote:

apps.py has been replaced with "rifle" in ranger-git. rifle is a file opener with more simple syntax and can be run independently of ranger.

This post should solve your problem:
https://bbs.archlinux.org/viewtopic.php … 8#p1081718

Is there any chance that this script will ever be redundant? Whilst it works (and it does good) it would of course be better to have this function back by default.

For example (I don't even know if it's doable), why can't we use options for applications? That way we could call sxiv with the -r option to load all the pics in the directory.

Of course you can use options, but there is no option for sxiv that does the job. for feh, there is: https://bbs.archlinux.org/viewtopic.php … 4#p1110094

If you want to use sxiv -r, you just have to put it in rifle.conf.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

#1374 2012-06-18 19:38:25

jk121960
Member
From: Palos Hills, Illinois
Registered: 2011-12-09
Posts: 254

Re: Ranger, a textbased filemanager

Hi hut!, As long as you were on the subject, what determines which media player and the dimensions of the presented video?

thanks

--jerry


Arch Awesome, Ranger & Vim the coding triple threat.

Offline

#1375 2012-06-18 20:59:56

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

Re: Ranger, a textbased filemanager

rifle.conf, assuming that with "dimensions" you mean "full screen or not"

I'm not yet done with the man page that explains rifle, so the only thing I can point to is the documentation in the default rifle.conf. You can get it with "ranger --copy-config=rifle", it contains a description at the top. You can press "r" for a list of programs that can open the current file. They are in the order as their definitions appear in rifle.conf. When you press enter, program #0 is run but you can also press 3<enter> to run program #3 and so on.


"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users

Offline

Board footer

Powered by FluxBB