You are not logged in.

#501 2010-09-21 14:31:17

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

Re: Ranger, a textbased filemanager

Hut, is there a way to see the changelogs for the latest git release? I've tried searching for it on ranger git project site, but I can't find any info.

Offline

#502 2010-09-21 15:05:04

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

Re: Ranger, a textbased filemanager

hi archman, the "git release" (version 1.3) is a rolling release, and I don't make change logs in text format.
But you can type this while you're inside the git repo:

git log --no-merges --oneline v1.2.1..master

Add a "-p" to see changes in the code.
As you see, there are not many new things in git, but they will keep coming.

Here's another log, not sure which one is more useful to you:
http://git.savannah.gnu.org/cgit/ranger … /?h=master


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

Offline

#503 2010-09-21 15:12:38

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

Re: Ranger, a textbased filemanager

Awesome, thanks!

Offline

#504 2010-09-23 08:01:19

botzoboy
Member
From: Romania/Deutschland
Registered: 2010-02-03
Posts: 90

Re: Ranger, a textbased filemanager

Sorry for the stupid question but how can I create a new folder or new file (.txt, doc) in ranger?

Offline

#505 2010-09-23 08:19:14

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

Re: Ranger, a textbased filemanager

There are no stupid questions. smile

New file: Write":touch somefilename" while in Ranger
New folder: Write ":mkdir somefoldername" while in Ranger.

Notice the ":" sign!

Cheers!

Offline

#506 2010-09-23 08:28:01

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

Re: Ranger, a textbased filemanager

New folder

:mkdir NAME

New file

:touch NAME

Just the way you would do it in the terminal wink

ARRGH, too slow ... it's still morning, so I think that's the reason wink

Last edited by Army (2010-09-23 08:28:45)

Offline

#507 2010-09-23 09:54:11

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

Re: Ranger, a textbased filemanager

@botzoboy you have the list of all commands by pressing :

3?

You can have more tips by reading all help sections. Press:

?

Offline

#508 2010-09-25 10:49:59

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

Re: Ranger, a textbased filemanager

Here is a command for bulk-renaming, demonstrating what you can do with a little python knowledge. It works like this:
1. A list of selected files is opened in vim
2. You can change each filename to what you want it to rename to. When you're done, save & close the file.
3. A shell script is generated which applies your changes. It will be opened in vim too.
4. Review this script and make sure this is what you want to do, then save & close it.
5. The script will be executed and you're back in ranger.

from ranger.api.commands import Command
class bulkrename(Command):
  """
  :bulkrename

  This command opens a list of selected files in an external editor.
  After you edit and save the file, it will generate a shell script
  which does bulk renaming according to the changes you did in the file.

  This shell script is opened in an editor for you to review.
  After you close it, it will be executed.
  """
  def execute(self):
    import tempfile
    from ranger.ext.shell_escape import shell_escape as esc

    # Create and edit the file list
    filenames = [f.basename for f in self.fm.env.get_selection()]
    listfile = tempfile.NamedTemporaryFile()
    listfile.write("\n".join(filenames))
    listfile.flush()
    self.fm.run(['vim', listfile.name])
    listfile.seek(0)
    new_filenames = listfile.read().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("# This file will be executed when you close the editor.\n")
    cmdfile.write("# 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))
    cmdfile.flush()
    self.fm.run(['vim', cmdfile.name])
    self.fm.run(['/bin/sh', cmdfile.name], flags='w')
    cmdfile.close()

You can put this in ~/.config/ranger/commands.py.
Select some files (with space) and type :bulkrename to test it.


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

Offline

#509 2010-09-26 23:34:14

Visti
Member
Registered: 2009-09-30
Posts: 13

Re: Ranger, a textbased filemanager

This file manager is great, it has completely replaced anything I used before. I do have one (followup) question.

As per my previous posting in this thread (page 19) I have made the :find function return false in order to not execute on a unique hit.However, I would like it to exit the commandline on a unique hit. I bet it's a really simple hack, but I can't quite wrap my head around it. I tried a couple of different things, but I'd very much like some advice on this.

And thanks again, it really is a great tool you have here.

Offline

#510 2010-09-26 23:54:17

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

Re: Ranger, a textbased filemanager

Visti wrote:

This file manager is great, it has completely replaced anything I used before. I do have one (followup) question.

As per my previous posting in this thread (page 19) I have made the :find function return false in order to not execute on a unique hit.However, I would like it to exit the commandline on a unique hit. I bet it's a really simple hack, but I can't quite wrap my head around it. I tried a couple of different things, but I'd very much like some advice on this.

And thanks again, it really is a great tool you have here.

Hi again Visti.
You could remove the function called "execute" in your find command. (after undoing all your previous changes first)

Or at least remove the self.fm.move(right=1) and self.fm.cd(parse(self.line).rest(1)) instructions, these are responsible for executing files and entering directories.


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

Offline

#511 2010-09-27 07:49:09

Visti
Member
Registered: 2009-09-30
Posts: 13

Re: Ranger, a textbased filemanager

Ah, thanks. That works splendidly.

Offline

#512 2010-09-30 20:32:14

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

Re: Ranger, a textbased filemanager

Hi

Thx so much for ranger, its truly spectacular

i have a Q.. is it possible to set by default to open all apps with the d mode (detached)?

thx alot

zeltak

Offline

#513 2010-09-30 20:53:40

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

Re: Ranger, a textbased filemanager

zeltak wrote:

Hi

Thx so much for ranger, its truly spectacular

i have a Q.. is it possible to set by default to open all apps with the d mode (detached)?

thx alot

zeltak

Hi zeltak, maybe this helps you:

pydoc ranger.defaults.apps

Edit:
Well I guess its non-trivial for non-programmers so here's a draft:

# file ~/.config/ranger/apps.py
from ranger.defaults.apps import CustomApplications as DefaultApps
from ranger.api.apps import *

class CustomApplications(DefaultApps):
        def app_default(self, c):
                c.flags += 'd'
                return DefaultApps.app_default(self, c)

Dunno if this is exactly what you want.

But you know that it will screw up things if you start console apps like vim, right.

Last edited by hut (2010-09-30 20:59:47)


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

Offline

#514 2010-10-01 14:00:22

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

Re: Ranger, a textbased filemanager

Hi Hut

thx for the tips..i have zero python ( and programming knowledge) but managed to alter my app.py to my needs smile

I have some bugs/suggestions/questions but couldn't find an IRC channel/Forum so im posting it here, i hope its ok. Also there are a few suggestions i have (not requests smile) that if you think are beneficial/have time i think could be cool.

ill start with the bug:

I cant get the mode number and then "l" to work. Is it a known issue..am i doing something wrong? im pressing a numer and then l while on a file but that dosent seem to work, isnt that how modes are operated?


ssh/samba support? is that possible? would be cool to browse ssh with ranger smile


its unclear what can be done with "marked" files..is it possible to have a popup menu for marked files (similar to the bookmarks popups) so one can quick access marked files (especially config files)

it seems that documentation on how to change file types colors is lacking for dummies like me smile can you give an example on how for example to change the color for *.zip files?


Would be nice to have a Filter indicator when filtering is on

would be cool to have an option to remember different sort order/filter views etc per folder


sorry for the long email and thx again for your truly awesome program

Zeltak

Offline

#515 2010-10-01 18:26:06

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

Re: Ranger, a textbased filemanager

zeltak wrote:

Hi Hut

thx for the tips..i have zero python ( and programming knowledge) but managed to alter my app.py to my needs smile

I have some bugs/suggestions/questions but couldn't find an IRC channel/Forum so im posting it here, i hope its ok. Also there are a few suggestions i have (not requests smile) that if you think are beneficial/have time i think could be cool.

There is a mailing list and a bugtracker on rangers website:
https://savannah.nongnu.org/projects/ranger

zeltak wrote:

ill start with the bug:

I cant get the mode number and then "l" to work. Is it a known issue..am i doing something wrong? im pressing a numer and then l while on a file but that dosent seem to work, isnt that how modes are operated?

Thats right, a number and then "l".
You can also try typing r2<enter>

Can you please post more information? Which kind of files, which application, the relevant code from the apps.py.


zeltak wrote:

ssh/samba support? is that possible? would be cool to browse ssh with ranger smile

For now, you're going to need tools that mount remote file systems onto the local ones. (sshfs,..)
Don't have the time/energy to safely and securely implement that in ranger.

zeltak wrote:

its unclear what can be done with "marked" files..is it possible to have a popup menu for marked files (similar to the bookmarks popups) so one can quick access marked files (especially config files)

The "t" key? It's actually called "tagged" files but that doesn't matter smile
You can tag files which are important to you and it will just show a * next to the file. Type ct and you immediately jump to the next tagged file in this directory. "cat ~/.config/ranger/tagged" for a list of tagged files.

zeltak wrote:

it seems that documentation on how to change file types colors is lacking for dummies like me smile can you give an example on how for example to change the color for *.zip files?

Rather than writing it here, I'm going to document it now.

EDIT:
Oh, there is some documentation already: http://git.savannah.gnu.org/cgit/ranger … chemes.txt
Basically, what you do is create a new colorscheme. You can start with the jungle-colorscheme:

mkdir ~/.config/ranger/colorschemes
cp /path/to/ranger/colorschemes/jungle.py ~/.config/ranger/colorschemes/myscheme.py

And adapt it to your likings, e.g.:

if context.container:
    fg = green

You'll also need this line in options.py:
colorscheme = "myscheme"

zeltak wrote:

Would be nice to have a Filter indicator when filtering is on

would be cool to have an option to remember different sort order/filter views etc per folder

Noted

zeltak wrote:

sorry for the long email and thx again for your truly awesome program

Zeltak

Sorry for the long reply and thanks for your suggestions

Last edited by hut (2010-10-01 18:42:50)


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

Offline

#516 2010-10-04 07:53:44

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

Re: Ranger, a textbased filemanager

hut wrote:

Here is a command for bulk-renaming, demonstrating what you can do with a little python knowledge. It works like this:
...
You can put this in ~/.config/ranger/commands.py.
Select some files (with space) and type :bulkrename to test it.

Thx for tis example, it's demonstrate the ranger/python power and it's exactly what I miss in ranger smile

Can I suggest a feature :

A dynamical help format for developpers.
For example,  ranger can search and compile all command.py headers formated comments to make a up to date help text.

Offline

#517 2010-10-04 17:50:59

mathieui
Member
Registered: 2009-07-21
Posts: 38
Website

Re: Ranger, a textbased filemanager

Do you plan a python3 version anytime soon?
(because testing just put python 3.1 as the python default package)

Edit: oops, my mistake, it already is, I just had to rebuild the git package

Last edited by mathieui (2010-10-04 17:54:39)

Offline

#518 2010-10-04 19:58:48

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

Re: Ranger, a textbased filemanager

mentat wrote:
hut wrote:

Here is a command for bulk-renaming, demonstrating what you can do with a little python knowledge. It works like this:
...
You can put this in ~/.config/ranger/commands.py.
Select some files (with space) and type :bulkrename to test it.

Thx for tis example, it's demonstrate the ranger/python power and it's exactly what I miss in ranger smile

Can I suggest a feature :

A dynamical help format for developpers.
For example,  ranger can search and compile all command.py headers formated comments to make a up to date help text.

Sounds very reasonable, I'll work on it.

mathieui wrote:

Do you plan a python3 version anytime soon?
(because testing just put python 3.1 as the python default package)

Edit: oops, my mistake, it already is, I just had to rebuild the git package

Yep, which python version to use is determined in the PKGBUILD and ranger is designed for both 2.6 and 3.1.
On a sidenote: For me, ranger runs faster on python2.6 smile

-------------------
Some updates:
1. Ranger is on ohloh now
2. There's a new sort algorithm, "natural sort", enable it with sort = "natural" in options.py or by typing "on". It sorts "foo.png" < "foo1.png" < "foo1423.png".
3. Ranger supports mimeopen. It's used to run files, currently just as a fallback for when apps.py is not successful in finding a program and only if you have it installed.
4. The algorithm for truncating the path in the titlebar (when it gets too long) was much improved. (you may have noticed that the previous one was TERRIBLE, never got around fixing it until now.) Try out the option dirname_in_tabs = True. It's not new, but it used to screw up the titlebar...


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

Offline

#519 2010-10-04 20:15:37

bgld
Member
Registered: 2010-10-04
Posts: 2

Re: Ranger, a textbased filemanager

Looks awesome so far, perfect for my server I think. Actually I think I'm gonna use this for my desktop too, the "new" pcmanfm sucks and qtfm is a bit slow to start up. I'll definitely give this a try. Thanks!

Offline

#520 2010-10-04 22:18:36

vi3dr0
Member
From: Poland
Registered: 2009-03-22
Posts: 208

Re: Ranger, a textbased filemanager

Great piece of software, I'm really impressed.

And I'd like to make tiny, tiny suggestion:

I'd like :cd with no arg eqivalent to :cd ~.

edit: bad tag

Last edited by vi3dr0 (2010-10-04 22:22:25)


Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox

Offline

#521 2010-10-04 22:32:51

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

Re: Ranger, a textbased filemanager

vi3dr0 wrote:

Great piece of software, I'm really impressed.

And I'd like to make tiny, tiny suggestion:

I'd like :cd with no arg eqivalent to :cd ~.

edit: bad tag

Thanks. And :cd is supposed to work like that, but it was bugged ;_;
The fix is uploaded.

Btw. you might as well type gh

Last edited by hut (2010-10-04 23:05:35)


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

Offline

#522 2010-10-05 00:48:35

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

Re: Ranger, a textbased filemanager

Thx again Hut for the great tips smile even though i have zero python knowledge i have managed to create my own color theme and config some other stuff for my liking smile

i have another idea (if you dont mind)

A really useful thing IMHO would be to have an option to either remember the currents tabs (session) that were open when closing ranger or even better yet have an option to save sessions. that is lets say i have 3 tabs open (/, ~, and tmp) i could save that as a session named default and then quick launch all 3 tabs by calling on "default" with either a key combo or a : command. i think that could be super useful. I use Vimperator alot (a VI mode for firefox smile) and there is something very similar there.


also how does one define what extensions go into a context (ie the container context). Currently it dosent include .deb and i would like to add that

thx again for ranger..it has become my full time file browser  smile

best

Zeltak

Offline

#523 2010-10-05 01:05:43

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

Re: Ranger, a textbased filemanager

zeltak wrote:

also how does one define what extensions go into a context (ie the container context). Currently it dosent include .deb and i would like to add that

That would require changes in the source code:
ranger/fsobject/fsobject.py lines 16-18

I'll give the session stuff some thought.


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

Offline

#524 2010-10-05 14:09:50

vi3dr0
Member
From: Poland
Registered: 2009-03-22
Posts: 208

Re: Ranger, a textbased filemanager

hut wrote:

Thanks. And :cd is supposed to work like that, but it was bugged ;_;
The fix is uploaded.

That was insanely fast big_smile


Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox

Offline

#525 2010-10-05 14:46:58

vi3dr0
Member
From: Poland
Registered: 2009-03-22
Posts: 208

Re: Ranger, a textbased filemanager

Ok, here I go with another idea:

How about some filter-mode indicator? Something like that (displaying filter used at the moment) somewhere at the bottom (status bar? ).

What do you think of that?


Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox

Offline

Board footer

Powered by FluxBB