You are not logged in.

#1201 2011-12-07 19:55:39

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

Re: Ranger, a textbased filemanager

misc wrote:

Probably an ignorant question, but… how do I get ranger to simply execute a binary? Currently all I get is the following printed on the terminal:

No applications found for mimetype: application/x-executable

:open_with self

Unless you mean "how do I make it default". Then I imagine you will run it with "sh -c", I imagine. "exec"'s probably better, but I still dunno. Just stick with ":open_with self", and you can make it a shortcut if you want.

Last edited by Veedrac (2011-12-07 20:09:54)

Offline

#1202 2011-12-07 20:15:06

misc
Member
From: Bavaria, Germany
Registered: 2010-03-22
Posts: 115

Re: Ranger, a textbased filemanager

Veedrac wrote:

Just stick with ":open_with self", and you can make it a shortcut if you want.

Will do. Thanks!

Offline

#1203 2011-12-09 06:08:57

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

Something strange but...
I've noticed that highlight has not always returns zero PIPESTATUS although it isn't an error sometimes. The same is with pdftotext. Sometimes a return value is 141. Does someone knows why is it happens and how to resolve this? This affects a preview.

P.S.I surmise this is because of head -n $maxln. head just reads $maxln form pipe and then the writer got SIGPIPE. So, maybe should this case be taken into account for success function? My skills in shell-scripting are about zero so I have had no success to resolve this. sad
What does that means: object of type 'type' has no len() ?

P.P.S. Further investigation result in a guess that the reason for "object of type 'type' has no len()" error is python-chardet package and how ranger uses it. Just guess.

P.P.P.S. For a while have fixed success func in scope.sh for SIGPIPE thing. At least it works.

Last edited by sarbash (2011-12-09 08:56:54)

Offline

#1204 2011-12-09 16:39:29

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

Re: Ranger, a textbased filemanager

sarbash wrote:

Something strange but...
I've noticed that highlight has not always returns zero PIPESTATUS although it isn't an error sometimes. The same is with pdftotext. Sometimes a return value is 141. Does someone knows why is it happens and how to resolve this? This affects a preview.

P.S.I surmise this is because of head -n $maxln. head just reads $maxln form pipe and then the writer got SIGPIPE. So, maybe should this case be taken into account for success function? My skills in shell-scripting are about zero so I have had no success to resolve this. sad
What does that means: object of type 'type' has no len() ?

run ranger --debug for more information on such errors.

sarbash wrote:

P.P.P.S. For a while have fixed success func in scope.sh for SIGPIPE thing. At least it works.

Can you post your fix?


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

Offline

#1205 2011-12-09 17:02:51

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

hut wrote:

Can you post your fix?

Sure. It's simple as that:

scope.sh

function success { test ${PIPESTATUS[0]} = 0 -o ${PIPESTATUS[0]} = 141; }

Here, 141=128+13 means SIGPIPE. I suppose that the cause of SIGPIPE is head -n. Not sure about consequences of this at least it works for now.

Yes, I'll try to run in debug mode, thanks for the advice.

P.S. Yes! chardet is killer, my assumptions were absolutly right! I can't place traceback here for a while (this is a work machine with MS WinXP on board), if it is worthy of it I'll place traceback here later. Now only one conclusion - the bug arises on non-ascii (my case is cyrillic-content) files. My tests showed that in console all of them are converted and showed right. Is that related to scope.sh? Just another guess.

Last edited by sarbash (2011-12-09 17:19:24)

Offline

#1206 2011-12-09 19:55:32

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

So, traceback is here.

[21:03:34 sergey@serenity ranger]$ ranger --debug
ranger version: 1.5.2, executed with python 3.2.2
Locale: ru_RU.UTF-8
Current file: /home/sergey/2011-декабрь-тимофей_сарбаш.pdf
Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 146, in safeDecode
    return string.decode("utf-8")
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd1 in position 511: unexpected end of data

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/ranger/core/main.py", line 103, in main
    fm.loop()
  File "/usr/lib/python3.2/site-packages/ranger/core/fm.py", line 181, in loop
    loader.work()
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 248, in work
    self.fm.notify(err)
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 243, in work
    next(item.load_generator)
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 101, in generate
    read = safeDecode(read)
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 149, in safeDecode
    return string.decode(chardet.detect(str)["encoding"])
  File "/usr/lib/python3.2/site-packages/chardet/__init__.py", line 24, in detect
    u.feed(aBuf)
  File "/usr/lib/python3.2/site-packages/chardet/universaldetector.py", line 65, in feed
    aLen = len(aBuf)
TypeError: object of type 'type' has no len()

ranger crashed.  Please report this traceback at:
http://savannah.nongnu.org/bugs/?group=ranger&func=additem

The mess is about charsets.

Offline

#1207 2011-12-10 00:25:15

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

Re: Ranger, a textbased filemanager

sarbash wrote:

So, traceback is here.

[21:03:34 sergey@serenity ranger]$ ranger --debug
ranger version: 1.5.2, executed with python 3.2.2
Locale: ru_RU.UTF-8
Current file: /home/sergey/2011-декабрь-тимофей_сарбаш.pdf
Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 146, in safeDecode
    return string.decode("utf-8")
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd1 in position 511: unexpected end of data

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/ranger/core/main.py", line 103, in main
    fm.loop()
  File "/usr/lib/python3.2/site-packages/ranger/core/fm.py", line 181, in loop
    loader.work()
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 248, in work
    self.fm.notify(err)
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 243, in work
    next(item.load_generator)
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 101, in generate
    read = safeDecode(read)
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 149, in safeDecode
    return string.decode(chardet.detect(str)["encoding"])
  File "/usr/lib/python3.2/site-packages/chardet/__init__.py", line 24, in detect
    u.feed(aBuf)
  File "/usr/lib/python3.2/site-packages/chardet/universaldetector.py", line 65, in feed
    aLen = len(aBuf)
TypeError: object of type 'type' has no len()

ranger crashed.  Please report this traceback at:
http://savannah.nongnu.org/bugs/?group=ranger&func=additem

The mess is about charsets.

Oh. Looks like a typo in the code, should be fixed now. smile


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

Offline

#1208 2011-12-10 07:40:06

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

Assume should I use ranger-git from AUR? Now, I use ranger package from community repo.

Last edited by sarbash (2011-12-10 07:40:29)

Offline

#1209 2011-12-10 11:56:37

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

Re: Ranger, a textbased filemanager

sarbash wrote:

Assume should I use ranger-git from AUR? Now, I use ranger package from community repo.

Yes. The "ranger" package will be updated after some testing.


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

Offline

#1210 2011-12-10 19:03:43

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

Thank you.
len() is fixed. But decoding error is still persist. I guess, decoding from utf8 to utf8 may be the reason.

[22:57:45 sergey@serenity ranger]$ ranger --debug
ranger version: 1.5.2, executed with python 3.2.2
Locale: ru_RU.UTF-8
Current file: /home/sergey/2011-декабрь-тимофей_сарбаш.pdf
Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 146, in safeDecode
    return string.decode("utf-8")
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd1 in position 511: unexpected end of data

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/ranger/core/main.py", line 110, in main
    fm.loop()
  File "/usr/lib/python3.2/site-packages/ranger/core/fm.py", line 184, in loop
    loader.work()
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 248, in work
    self.fm.notify(err)
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 243, in work
    next(item.load_generator)
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 101, in generate
    read = safeDecode(read)
  File "/usr/lib/python3.2/site-packages/ranger/core/loader.py", line 149, in safeDecode
    return string.decode(chardet.detect(string)["encoding"])
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd1 in position 511: unexpected end of data

ranger crashed.  Please report this traceback at:
http://savannah.nongnu.org/bugs/?group=ranger&func=additem

Offline

#1211 2011-12-10 20:02:16

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

Not sure about correctness, but...

loader.py

144 def safeDecode(string):                                                                                               
145     try:        
146         return string.decode("utf-8")
147     except (UnicodeDecodeError):
148         if HAVE_CHARDET:
149             try:
150                 return string.decode(chardet.detect(string)["encoding"])
151             except (TypeError, UnicodeDecodeError):
152                 return string.decode(sys.getdefaultencoding(), "ignore")
153         else:   
154             return string.decode(sys.getdefaultencoding(), "ignore")

Now I've got all that preview things working. smile

Last edited by sarbash (2011-12-10 20:09:56)

Offline

#1212 2011-12-10 21:11:09

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

Finally, my hacked scope.sh:

scope.sh

Offline

#1213 2012-01-04 05:25:00

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

Happy New Year to everybody! smile

Is there an easy way to see a summary on cumulative sizes of the selected directories & files?
Thanks in advance.

Last edited by sarbash (2012-01-04 05:26:09)

Offline

#1214 2012-01-04 14:55:04

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

Re: Ranger, a textbased filemanager

sarbash wrote:

Happy New Year to everybody! smile

Is there an easy way to see a summary on cumulative sizes of the selected directories & files?
Thanks in advance.

Not sure what you mean, but maybe you're looking for the key combination "dc"


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

Offline

#1215 2012-01-04 16:21:37

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

I mean the summary.
"dc" is just great but lacks some functionality. Let me explain.
There is some directory there. It has a couple of subdirs and files. I select some of them and call "dc". Now I can see the size of each marked item. What I want is to see the total amount of the sizes of selected items. For example, it may be in the status line where are indicated the marked items.
Another solution is to move desired items into temp dir and get it's size but I think it should be possible without such tricks. smile
Any advice?

Last edited by sarbash (2012-01-04 16:22:55)

Offline

#1216 2012-01-04 21:25:56

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

Re: Ranger, a textbased filemanager

In the newest ranger, directory sizes are now added to the sum of sizes of marked files in the statusbar, once the directories sizes have been calculated with "dc". smile

Note that selections are limited to one directory so you can't copy from multiple places at the same time :S

Last edited by hut (2012-01-04 21:28:47)


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

Offline

#1217 2012-01-05 13:29:31

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: Ranger, a textbased filemanager

Thanks a lot! That's great! That is exactly what has had been expected. smile

Offline

#1218 2012-01-08 21:05:55

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: Ranger, a textbased filemanager

Anyone managed to get aunpack working for extraction once the archive file is chosen?

Offline

#1219 2012-01-08 21:23:37

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

Re: Ranger, a textbased filemanager

archman-cro wrote:

Anyone managed to get aunpack working for extraction once the archive file is chosen?

Mode 1. Type "1l" instead of just "l"


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

Offline

#1220 2012-01-21 16:40:21

eyolf
Member
From: Copenhagen
Registered: 2005-11-29
Posts: 339
Website

Re: Ranger, a textbased filemanager

After a hardware-enforced exile in Windows, I'm back to Arch again, and man is it great to be here again.
And ranger... just getting better.
One functionality that I've been waiting for (ever since i requested it...) is still missing, however: a Branch view, something like the output of

find .

, only as a file list just like any other, that can be sorted by name, size, date, etc.
Hut said, back when I requested it, that it would be relatively easy to implement, so I figured perhaps a small reminder is all it will take to bring it out of the TODO list.... smile

Offline

#1221 2012-01-21 19:47:20

SquareRoot
Member
From: Granville, Ohio USA
Registered: 2011-10-08
Posts: 7

Re: Ranger, a textbased filemanager

Is there any way to toggle or configure or hack:

1) "user@host:" in the title bar off

2) the summary information on the right of the status bar off (... sum, ... free x/y Top)

3) more information into the main column in addition to size/count, such as any combo of type, permissions, links, user, group, inode, dates, times, ...
there is a lot of room here to provide some really useful information about the displayed files and directories - I really miss this info
then make what is shown in the left side of the status bar for the current file/directory configurable as well, probably a subset of what is not shown in the main column

4) I can toggle column 3 via zP and/or zp, additionally I want to toggle column 1 (all parent directories)

Offline

#1222 2012-01-28 15:18:34

bencahill
Member
Registered: 2011-03-20
Posts: 40

Re: Ranger, a textbased filemanager

Wow. Just wow! I just tried ranger, and it's awesome! I mainly love the preview of dirs and other things.

I have one feature request...

Can you make any preview scripts (e.g. highlight) be killed if the cursor moves off their item? Right now, if I hold j, and go over lots of CPU-intensive previewing files (like jpgs or huge sql files), the CPU will continue to be eaten up, even though I'm not on them currently. If that's possible, that is...

Thanks!

Offline

#1223 2012-01-28 15:42:35

dionisos
Member
Registered: 2012-01-28
Posts: 8

Re: Ranger, a textbased filemanager

Hello, thanks for this software.

I have a problem with bulkrename.
It’s like

self.fm.execute_file([File(listfile.name)], app='editor')

doen’t block the execution of the rest of the script.

Then i am "No renaming to be done!" all the time.

ok, i understood what was wrong, gedit (my default editor) was already launched.
Then The next "launch" was done in the background. (and then doen’t block).

Last edited by dionisos (2012-01-28 17:02:42)

Offline

#1224 2012-01-28 19:21:59

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Ranger, a textbased filemanager

thinking out loud... file previous being limited to text/curses is pretty frustrating. esp. for images and video.  In theory it should be perfectly possible to port ranger to something like Gtk.  the interface would look the same, all features (keybinds, python configuration etc) would be identical (or at least very similar as keybinding in X is a bit different).
Question is: how tightly coupled is ranger to ncurses?  Is the UI abstracted or tightly interweaved?


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#1225 2012-01-28 19:27:22

Falstaff
Member
Registered: 2008-11-03
Posts: 81

Re: Ranger, a textbased filemanager

I have 3 questions:

1) How can I make the 'filter' function case insensitive?
2) Is there a way to make the filter update the result real-time as you type?
3) Is there a command to clear the filter?

My thanks in advance.

Offline

Board footer

Powered by FluxBB