You are not logged in.
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
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
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
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
Offline
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
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
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
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
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 ) 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
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
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
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...
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
Last edited by 2ManyDogs (2012-06-18 02:00:35)
Offline
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
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
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
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
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
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
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
Doh, I still got lots to learn! Thank for your help everytime hut!
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
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
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!
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
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
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#p1081718Is 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
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
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