You are not logged in.

#701 2010-12-13 17:15:16

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

Re: Ranger, a textbased filemanager

Yup, there's a search_inc function now. To use it by default, map the / key to fm.open_console("search_inc ")


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

Offline

#702 2010-12-13 18:33:36

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

Re: Ranger, a textbased filemanager

To all the users of ranger 1.2.2 (stable, non-git), a new version is out now!

2010-12-13: Version 1.2.3
* Enable binding to alt-keys
* Fixed memory leak in garbage collecting of old, unused directory objects
* Fixed python3 incompatibilities
* Fixed problems with identifying changes of files
* Fixed lazy lookup of some FSObject attributes

Btw. There is another branch (devel, see https://github.com/hut/ranger/tree/devel) which contains new code, but since I replaced a few parts (including configuration!), it is not as well tested and possibly incompatible to old hacks and configurations.

Currently there are two AUR packages for ranger. (I put the git branch name in parenthesis)
ranger (stable)
ranger-git (master)


And here are the options I see:

1. Simply merge the new code into ranger-git (master)
2. Create a new package named ranger-devel, so old configs don't break
3. Move ranger-git to ranger-old, merge the new code into ranger-git (master)
4. Move ranger-git to ranger (stable) since it works good enough, and merge devel to ranger-git (master)
5. Wait until it's complete

Vote, guys!

Last edited by hut (2010-12-13 18:50:30)


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

Offline

#703 2010-12-13 19:27:11

fuxter
Member
Registered: 2010-11-25
Posts: 3

Re: Ranger, a textbased filemanager

thank you, kind sir, for update smile

Offline

#704 2010-12-15 18:43:20

vasyabelkin
Member
Registered: 2009-09-10
Posts: 20

Re: Ranger, a textbased filemanager

Hello, hut. Could you, please, update the bulkrename script, so it would comply to the changes in Python3? Specifically with 3.1.3 I get "TypeError: must be bytes or buffer, not str" at line 39, etc.
For now I've fixed the exceptions with these changes:

 listfile.write("\n".join(filenames).encode('ascii'))
    listfile.flush()
    self.fm.run(['vim', listfile.name])
    listfile.seek(0)
    new_filenames = listfile.read().decode('ascii').split("\n")
    listfile.close()
    if all(a == b for a, b in zip(filenames, new_filenames)):
      self.fm.notify("No renaming to be done!")
      return

    # Generate and execute script
    cmdfile = tempfile.NamedTemporaryFile()
    cmdfile.write(b"# This file will be executed when you close the editor.\n")
    cmdfile.write(b"# Please double-check everything, clear the file to abort.\n")
    cmdfile.write(("\n".join("mv -vi " + esc(old) + " " + esc(new) \
        for old, new in zip(filenames, new_filenames) if old != new)).encode('ascii'))

But, obviously, this is wrong to use ASCII only. Sorry, I don't speak Python smile
Thank you

Offline

#705 2010-12-15 20:57:43

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

What do I have to do to tell ranger to only show me a preview of files when I hit F3? I want quick browsing, but I also really like the ability to preview files. I think this is a good middleway.

Offline

#706 2010-12-15 22:24:09

yvonney
Member
Registered: 2008-06-11
Posts: 671

Re: Ranger, a textbased filemanager

Enjoying ranger and ranger-git as much as Xmonad.
I'm still at the very basic level though more and more I'm not needing to use xfe.
So, my pictures open up nicely in feh though I often need to open them twice or more
to see any of them due to their typically showing as only a tiny cube in the corner or as a full vertical sliver
top to bottom on the side. No picture pixels actually visible.

So I kill that attempt and on the 2nd or 3rd subsequent attempt to open via ranger they display correctly.
They open in a new Xmonad window beside ranger (ranger in a tmux instance).
That's a bit long winded though I hope it's clear enough.
I've considered that any number of things could be causing the issue. Any ideas?

Last edited by yvonney (2010-12-15 22:25:43)

Offline

#707 2010-12-15 22:42:39

Miblo
Member
From: Manchester, UK
Registered: 2010-07-05
Posts: 160
Website

Re: Ranger, a textbased filemanager

With fluxbox it would be possible to create a configuration for feh in "~/.fluxbox/apps" which, for example, positions new instances of the program in the centre of the screen. I've never had the pleasure of using xmonad, so don't know if it has a similar ability, but according to the homepage, I would assume it probably does. However, failing that, hut will know whether ranger itself is capable of such positioning.


@archun: Intel® Core™ i5-4210M • [GPU] Intel® HD Graphics 4600 • [Kernel] linux-ck-haswell
Handmade.NetworkGitLab
The Life and Times of Miblo del Carpio

Offline

#708 2010-12-15 22:46:54

yvonney
Member
Registered: 2008-06-11
Posts: 671

Re: Ranger, a textbased filemanager

appreciated. yeah, Xmonad allows for such brilliance as well. I could set feh to always float so to speak. I will do this yet there's also much about pictures opening in a tiled window. (i think it's called). Interested if perhaps someone's had this issue. I would take the time to test with ranger not in tmux. I think that's next to try. And will be doing the floating, to try that, right now!


UPDATE: floating is as expected! great. and I can always then set the pix to join up with the tiled stuff. So, good!

UPDATE-2: just found the 'q' key for ranger (latest upd) ... wow, kills the pix, or audio or video.  Few computer things more beneficial than a small struggle/issue!

Last edited by yvonney (2010-12-15 22:53:27)

Offline

#709 2010-12-15 23:14:09

Miblo
Member
From: Manchester, UK
Registered: 2010-07-05
Posts: 160
Website

Re: Ranger, a textbased filemanager

Brilliant! I've just had a little read about xmonad, and I may actually switch to it myself (having a little trouble with fluxbox in my freshly installed system, but that's for another thread). Cheers for the "q" tip. I'll use that instead of the longer stretch to "Esc", or the contorted fingers of "Ctrl+c".


@archun: Intel® Core™ i5-4210M • [GPU] Intel® HD Graphics 4600 • [Kernel] linux-ck-haswell
Handmade.NetworkGitLab
The Life and Times of Miblo del Carpio

Offline

#710 2010-12-15 23:47:40

yvonney
Member
Registered: 2008-06-11
Posts: 671

Re: Ranger, a textbased filemanager

@Miblo : I'd guess many would agree that most of the time is spent figuring what to use. Sincere Sorry for my off-topic, figured to comment to Miblo, and here's why:after much much xmonad.hs studying our very own brisbin33 does the magic IMO. http://pbrisbin.com/ and files at: https://github.com/pbrisbin/   The /lib folder goes IN the .xmonad folder.   uhh, -- ranger loves Xmonad and Xmonad loves ranger -- adding a dash of tmux!

Last edited by yvonney (2010-12-16 20:30:40)

Offline

#711 2010-12-16 00:36:28

Miblo
Member
From: Manchester, UK
Registered: 2010-07-05
Posts: 160
Website

Re: Ranger, a textbased filemanager

Cheers for the sorrow, yvonney (unless you mean you're sorry for your own off-topic!), you can read about my woes here. I'm getting more and more enthralled by xmonad, but may possibly hold off the big switch until I see how my thread pans out.

Back to ranger!


@archun: Intel® Core™ i5-4210M • [GPU] Intel® HD Graphics 4600 • [Kernel] linux-ck-haswell
Handmade.NetworkGitLab
The Life and Times of Miblo del Carpio

Offline

#712 2010-12-16 08:00:19

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 158
Website

Re: Ranger, a textbased filemanager

Hut, would it be hard to make ranger display the content of an archive in the preview screen, just like it would display the content of a text file?

Offline

#713 2010-12-16 13:45:58

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

@Revelation60, just install atool and it works ootb

Offline

#714 2010-12-16 14:48:02

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 158
Website

Re: Ranger, a textbased filemanager

Okay, that's nice. It would be even better if it gets displayed in the right panel, I think.

Offline

#715 2010-12-16 15:50:45

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

A

ranger --copy-config=scope

might be necessary. This command line copies the scope script into ~/.config/ranger. Adjust it to your needs if necessary.

Offline

#716 2010-12-16 16:48:32

zeltak
Member
From: New England
Registered: 2010-08-07
Posts: 168

Re: Ranger, a textbased filemanager

Hi hut

i dunno if its to late but id vote to move ranger-git to ranger-old, merge the new code into ranger-git (master)

Btw is archive/VFS support coming in the near future (pretty please with sugar on top smile:))

i using apack, peazip etc but its just not well integrated

thx alot again

Zeltak

Offline

#717 2010-12-17 16:24:45

cap_sensitive
Member
Registered: 2010-04-05
Posts: 35

Re: Ranger, a textbased filemanager

Thanks hut, it works. smile

Offline

#718 2010-12-17 18:32:14

iosonofabio
Member
From: Australia
Registered: 2008-10-09
Posts: 105

Re: Ranger, a textbased filemanager

I would have a suggestion for apps.py. I want to edit text files with gvim when running an X server, with vim otherwise. I modified your app_editor function in apps.py in the following way:

try:
     os.environ['DISPLAY']
     return self.either(c, 'gvim')
except KeyError:
     return self.either(c, 'vim', 'emacs', 'nano')

Of course, it would be even better to integrate this cycle with the EDITOR or VISUAL variable.

Last edited by iosonofabio (2010-12-17 18:34:20)

Offline

#719 2010-12-18 10:29:28

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

Re: Ranger, a textbased filemanager

vasyabelkin wrote:

Hello, hut. Could you, please, update the bulkrename script, so it would comply to the changes in Python3? Specifically with 3.1.3 I get "TypeError: must be bytes or buffer, not str" at line 39, etc.
For now I've fixed the exceptions with these changes:
[...]
But, obviously, this is wrong to use ASCII only. Sorry, I don't speak Python smile
Thank you

if sys.version > "3":
  need_decoding = True
else:
  need_decoding = False
its_annoying_to_check_for_it = True
if any(character not in ASCII for character in text):
  better_use_encoding = "utf-8"
try:
  code = code.replace("ascii", "utf-8")
except you_use_both_python2_and_python3:
  # I updated the script in the wiki
  click("http://ourproject.org/moin/projects/ranger/bulkrename")

Army wrote:

What do I have to do to tell ranger to only show me a preview of files when I hit F3? I want quick browsing, but I also really like the ability to preview files. I think this is a good middleway.

I personally have previews turned off and I toggle with zp. (preview_files = False in options.py)
Or do you mean ranger should load a preview (and display it on the right side) only when you press some key? I thought about that, but dunno, I get along with zp and i/F3 just fine

iosonofabio wrote:

I would have a suggestion for apps.py. I want to edit text files with gvim when running an X server, with vim otherwise. I modified your app_editor function in apps.py in the following way:

try:
     os.environ['DISPLAY']
     return self.either(c, 'gvim')
except KeyError:
     return self.either(c, 'vim', 'emacs', 'nano')

Of course, it would be even better to integrate this cycle with the EDITOR or VISUAL variable.

That looks good, but it's up to the user if he/she/it wants gvim or not. Perhaps put this on archwiki or rangers wiki?

zeltak wrote:

Hi hut

i dunno if its to late but id vote to move ranger-git to ranger-old, merge the new code into ranger-git (master)

Btw is archive/VFS support coming in the near future (pretty please with sugar on top smile:))

i using apack, peazip etc but its just not well integrated

thx alot again

Zeltak

Thats a lot of work... And my deep-hack-mode doesn't work these days

Anyway, here's another poll:

Do you use ranger-stable or not? Any objections with making 1.3.1 the new stable version?
(1.3.1 is the one thats currently on ranger-git)


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

Offline

#720 2010-12-18 14:50:59

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

hut wrote:
Army wrote:

What do I have to do to tell ranger to only show me a preview of files when I hit F3? I want quick browsing, but I also really like the ability to preview files. I think this is a good middleway.

I personally have previews turned off and I toggle with zp. (preview_files = False in options.py)
Or do you mean ranger should load a preview (and display it on the right side) only when you press some key? I thought about that, but dunno, I get along with zp and i/F3 just fine

This zp thing is cool to have if you want to preview many files quickly. But what I mean is the way the midnight commander works. There you can have a second command executed, if F3 is being pressed. I used that for such previews when I used mc and I really liked it. So what I want to have is preview_files = False in options.py, so it doesn't preview every file which is set in the scope.sh, but ranger should then preview the files (execute scope.sh) with pressing of F3. Right now, with preview_files = False there's no preview at all, not in the file view and not with F3. I think previews with F3 could stay enabled no matter if preview_files is = False or = True, because as far as I can see this is the only function F3 has. For those who don't want previews, they won't press F3 anyway.
I hope I'm not wrong with what I'm saying, but I think the idea is not bad wink

edit: I just discovered, with preview_files = False and pressing F3 TWICE the preview works. Could it be that you already implemented the abovely described behavior, but it's a little buggy?

Last edited by Army (2010-12-18 14:53:44)

Offline

#721 2010-12-18 15:33:43

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

Re: Ranger, a textbased filemanager

Army wrote:

edit: I just discovered, with preview_files = False and pressing F3 TWICE the preview works. Could it be that you already implemented the abovely described behavior, but it's a little buggy?

Indeed. It's fixed now.
I noticed it before, but forgot, since I rarely use this version atm. ranger-devel just pipes the stuff into an external pager.

Last edited by hut (2010-12-18 15:36:29)


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

Offline

#722 2010-12-18 18:06:29

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

Nice! smile

Something else came to my mind. I once asked for a way to prevent apps being started by opening files in ranger from being killed, when ranger exits. You already gave me an answer here https://bbs.archlinux.org/viewtopic.php … 88#p753288 Back then I didn't get it and stopped trying it. Now I know what nohup really does and now I want to implement it.

I tried

if f.extension in ('pdf', ):
                                if 'DISPLAY' in os.environ:
                                        c.flags += 'd'
                                        return self.either(c, 'nohup', 'mupdf')
                                else:
                                        return self.either(c, 'fbgs')

That's the way you described it, right? But this way ranger tries to open the pdf file with nohup, which of course won't work. I also tried (c, 'nohub mupdf') and (c, 'nohub' 'mupdf'), but it seems like this isn't the way this is done in python. How can this be done?

Offline

#723 2010-12-18 18:14:07

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

Re: Ranger, a textbased filemanager

self.either(...) is a method for finding installed programs, so ranger runs out of the box on many systems. Since you know the programs you need, you can throw it out and just use

return tup("nohup", "mupdf", *c)

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

Offline

#724 2010-12-18 19:15:13

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

Ok, I only replaced self.either with tup, but apparently that wasn't enough wink Thanks hut!!

Offline

#725 2010-12-18 19:36:51

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Ranger, a textbased filemanager

Damn, I have to ask one (hopefully) last thing, nohup always creates a nohup.out. To avoid this, the command has to be executed like this

nohup command > /dev/null &

instead of

nohup command &

How to do that?

Last edited by Army (2010-12-18 20:26:13)

Offline

Board footer

Powered by FluxBB