You are not logged in.

#1051 2011-08-24 10:27:21

jumper
Member
Registered: 2011-08-24
Posts: 2

Re: Ranger, a textbased filemanager

Thank you for the excellent file manager that he is incomparable smile
But I do not have enough in him for one thing - the integration with Dropbox - sync status file, and an external reference (if the file Share) in the preview file, for example. And a couple of console commands - something like ":dbox share". As far as I know, there is a console application to manage Dropbox written in Python, maybe it will help you.

Offline

#1052 2011-08-24 14:54:55

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

Re: Ranger, a textbased filemanager

jumper: Thank you. I have no experience with dropbox but I'd be glad to give you some hints if you wanna try to add it yourself.


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

Offline

#1053 2011-08-24 17:20:33

jumper
Member
Registered: 2011-08-24
Posts: 2

Re: Ranger, a textbased filemanager

Ok, I'm all ears. I do not know how to program, only
   wrote a couple of simple bash scripts. But I'll try to figure out, suddenly come out:)

Offline

#1054 2011-08-24 19:06:38

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

Re: Ranger, a textbased filemanager

jumper wrote:

Ok, I'm all ears. I do not know how to program, only
   wrote a couple of simple bash scripts. But I'll try to figure out, suddenly come out:)

I guess the dropbox program can do everything you want ranger to do? If so, take a look at the file ranger/defaults/keys.py. You can map keys to commands there. You could take the mapping "du" as a reference.

For previews: Do you know about scope.sh? that's a bash script that generates the preview by taking the file name (and some other information) as the argument and printing the preview to the standard output. It's not active by default, but you can activate it by running "ranger --copy-config=scope" and then edit it at ~/.config/ranger/scope.sh.

Last edited by hut (2011-08-24 19:07:14)


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

Offline

#1055 2011-08-26 09:51:30

quatrix
Member
Registered: 2011-07-13
Posts: 7

Re: Ranger, a textbased filemanager

Thanks for the wonderful program. I'm liking it better than mc. But is there any way to select files based on a pattern?  And is there a way to sort according to atime?

Offline

#1056 2011-08-26 10:02:40

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

Re: Ranger, a textbased filemanager

quatrix wrote:

Thanks for the wonderful program. I'm liking it better than mc. But is there any way to select files based on a pattern?  And is there a way to sort according to atime?

1. The :mark command, and 2. no. But sorting by atime is trivially implemented, try upgrading in a few minutes. smile


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

Offline

#1057 2011-08-27 03:51:35

quatrix
Member
Registered: 2011-07-13
Posts: 7

Re: Ranger, a textbased filemanager

Thank you for the quick reply!

One thing I miss from mc is that in mc, when I press Enter, the file directly under the cursor is opened, whatever other files I have already marked.
Is ranger, wherever I press, Enter, it opens all the files that are marked. Is there a way to get the mc behaviour?

Offline

#1058 2011-08-29 21:24:43

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

Re: Ranger, a textbased filemanager

I thought the "r" key does that... but it doesn't ;(
Let me fix that, i dont have much time atm tho


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

Offline

#1059 2011-09-01 15:17:34

AMA
Member
Registered: 2009-05-03
Posts: 46

Re: Ranger, a textbased filemanager

Hi. I discovered ranger two days ago and its awesome. Does anyone have a script for extracting and compressing archives using tar ? Thanks.

Offline

#1060 2011-09-03 13:59:49

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

Re: Ranger, a textbased filemanager

AMA wrote:

Hi. I discovered ranger two days ago and its awesome. Does anyone have a script for extracting and compressing archives using tar ? Thanks.

I just use use ":shell atool -x %s" with unrar (and atool) installed to extract.
You can bind it to a key, if you want (replace KEY wih your preferred shortcut key):

# WARNING: UNTESTED
map('KEY', fm.execute_console("shell atool -x %s"))

Use atool's -a to compress (with -f to set format).

Offline

#1061 2011-09-05 13:07:17

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

Re: Ranger, a textbased filemanager

Press "1l" to extract with atool. (thats a one and a lowercase L.)
To compress, I use "@apack name.tar" after selecting the files i want to store.


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

Offline

#1062 2011-09-05 14:28:38

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

Re: Ranger, a textbased filemanager

I've been trying this for a while, but I can't figure out how to achive this:
I use

if f.audio:
               c.flags += 'sd'
               return tup('nohup', 'urxvtc', '-e', 'mplayer', *c)

to playback audio files. Now, I have an external soundcard, which is used by mplayer with

mplayer -ao alsa:device=plughw=2.0

Now, what do I have to put in the apps.py to make "1l" use the line

return tup('nohup', 'urxvtc', '-e', 'mplayer', '-ao', 'alsa:device=plughw=2.0', *c)

? It can be done this way

if f.audio:
               c.flags += 'sd'
               return self.either(c, 'mplayer')
[...]
@depends_on('mplayer')
     def app_mplayer(self, c):
          if c.mode is 1:
               return tup('mplayer', '-ao', 'alsa:device=plughw=2.0', *c)
          else:
               return tup('mplayer', *c)

But I like mplayer to start in a new shell so I can still work in ranger.

Thanks for your help!

Last edited by Army (2011-09-05 14:30:08)

Offline

#1063 2011-09-05 21:10:33

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

Re: Ranger, a textbased filemanager

if f.audio:
  c.flags += 'sd'
  if c.mode == 1:
    return tup('nohup', 'urxvtc', '-e', 'mplayer', '-ao', 'alsa:device=plughw=2.0', *c)
  else:
    return tup('nohup', 'urxvtc', '-e', 'mplayer', *c)

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

Offline

#1064 2011-09-06 08:02:14

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

Re: Ranger, a textbased filemanager

Oh this can be done this way? Nice!! Now that I see it it makes perfect sense, thanks hut!

Offline

#1065 2011-09-06 14:19:24

Sirsurthur
Member
Registered: 2009-02-02
Posts: 124

Re: Ranger, a textbased filemanager

Hi Hut,

I just experienced the following crash that I wanted to report :

***

Ranger version: 1.4.3, executed with python 3.2.2
Locale: fr_FR.UTF-8
Current file: /home/julien/Téléchargements/5622441calendrier-2011-2012-pdf.pdf
Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/ranger/core/main.py", line 90, in main
    fm.loop()
  File "/usr/lib/python3.2/site-packages/ranger/core/fm.py", line 198, in loop
    ui.redraw()
  File "/usr/lib/python3.2/site-packages/ranger/gui/ui.py", line 221, in redraw
    self.draw()
  File "/usr/lib/python3.2/site-packages/ranger/gui/ui.py", line 242, in draw
    DisplayableContainer.draw(self)
  File "/usr/lib/python3.2/site-packages/ranger/gui/displayable.py", line 268, in draw
    displayable.draw()
  File "/usr/lib/python3.2/site-packages/ranger/gui/widgets/browserview.py", line 102, in draw
    DisplayableContainer.draw(self)
  File "/usr/lib/python3.2/site-packages/ranger/gui/displayable.py", line 268, in draw
    displayable.draw()
  File "/usr/lib/python3.2/site-packages/ranger/gui/widgets/browsercolumn.py", line 143, in draw
    self._draw_file()
  File "/usr/lib/python3.2/site-packages/ranger/gui/widgets/browsercolumn.py", line 172, in _draw_file
    Pager.draw(self)
  File "/usr/lib/python3.2/site-packages/ranger/gui/widgets/pager.py", line 78, in draw
    self._draw_line(i, line)
  File "/usr/lib/python3.2/site-packages/ranger/gui/widgets/pager.py", line 114, in _draw_line
    self.win.move(i, 0)
_curses.error: wmove() returned ERR

Ranger crashed.  Please report this traceback at:
http://savannah.nongnu.org/bugs/?group= … nc=additem

Offline

#1066 2011-09-13 23:03:56

totte
Member
Registered: 2011-08-22
Posts: 64

Re: Ranger, a textbased filemanager

Is it possible to edit the "user@host:path" at the top left to match ones actual shell prompt?

Offline

#1067 2011-09-14 13:43:14

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

Re: Ranger, a textbased filemanager

Sirsurthur wrote:

Hi Hut,

I just experienced the following crash that I wanted to report :

Fixed, thank you

totte wrote:

Is it possible to edit the "user@host:path" at the top left to match ones actual shell prompt?

To change the title once:
1. Open rangerdir/gui/widgets/titlebar.py and copy the function _get_left_part (line 110) into your ~/.config/ranger/options.py.
btw, "rangerdir" is where you get when you type gR in ranger.
2. You will need to remove one tab per line for correct indentation.
3. Below the function, write:

from ranger.gui.widgets.titlebar import TitleBar
TitleBar._get_left_part = _get_left_part

4. Now modify the function to fit your needs.

Here's an example


To change it to your bash prompt:
Either do it manually by translating the bash PS1 to python, or write a little parser. A parser would obviously be shell-dependent. sad To access the prompt in python you need to export it in your shell rc file first, then access it with os.environ['PS1']


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

Offline

#1068 2011-09-14 18:07:31

totte
Member
Registered: 2011-08-22
Posts: 64

Re: Ranger, a textbased filemanager

hut wrote:
Sirsurthur wrote:

Hi Hut,

I just experienced the following crash that I wanted to report :

Fixed, thank you

totte wrote:

Is it possible to edit the "user@host:path" at the top left to match ones actual shell prompt?

To change the title once:
1. Open rangerdir/gui/widgets/titlebar.py and copy the function _get_left_part (line 110) into your ~/.config/ranger/options.py.
btw, "rangerdir" is where you get when you type gR in ranger.
2. You will need to remove one tab per line for correct indentation.
3. Below the function, write:

from ranger.gui.widgets.titlebar import TitleBar
TitleBar._get_left_part = _get_left_part

4. Now modify the function to fit your needs.

Here's an example


To change it to your bash prompt:
Either do it manually by translating the bash PS1 to python, or write a little parser. A parser would obviously be shell-dependent. sad To access the prompt in python you need to export it in your shell rc file first, then access it with os.environ['PS1']

Wicked, ta.

Offline

#1069 2011-09-15 06:54:15

ttfung
Member
Registered: 2010-05-25
Posts: 4

Re: Ranger, a textbased filemanager

Hi, I have a question: how can I keep the filter setting after changing directory (e.g. through [ and ])?

Offline

#1070 2011-09-15 20:34:28

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

Re: Ranger, a textbased filemanager

ttfung wrote:

Hi, I have a question: how can I keep the filter setting after changing directory (e.g. through [ and ])?

It's a hackish method - all it does is move the filter when you move directory if the setting 'permanant_filter' is True - but I've done this.

I assume you have made a copy of your settings using ranger's --copy-config here.

In your options.py add:

permanant_filter = BOOL

..where BOOL is either True or False. This will choose whether it's on by default.
In your keys.py, add:

map('YOUR KEY', fm.toggle_boolean_option('permanant_filter'))

...where YOUR KEY is the shortcut you want to use ('ze' for me).

The rest is done in ranger's source.
In the enter_dir function of core/environment.py, after the line self.cwd = new_cwd add:

		if self.settings['permanant_filter']:
			self.cwd.filter = previous.filter
			previous.filter = ""
			previous.load_content()

In container/settingsobject.py add to ALLOWED_SETTINGS:

	'permanant_filter': bool,

I think that's it. Tell me if it's not working. There's probably an easier way to do this, but I don't know it.

Offline

#1071 2011-09-23 22:24:33

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

Re: Ranger, a textbased filemanager

quatrix wrote:

Thank you for the quick reply!

One thing I miss from mc is that in mc, when I press Enter, the file directly under the cursor is opened, whatever other files I have already marked.
Is ranger, wherever I press, Enter, it opens all the files that are marked. Is there a way to get the mc behaviour?

Sorry for the not-so-quick reply. I added the "c" flag to open the current file only, even when other files are marked. To use it, type "rc<enter>".


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

Offline

#1072 2011-09-26 19:59:46

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: Ranger, a textbased filemanager

Man, i really love ranger :3 i just have a quick requests: it should check if the free space on the device is enough before copying as i messed up badly my usb drive many times because of this smile
Thanks and keep up the good work big_smile

Offline

#1073 2011-09-29 18:42:08

Sirsurthur
Member
Registered: 2009-02-02
Posts: 124

Re: Ranger, a textbased filemanager

Hello Hut,

Just for you to know that with the latest updates, the pkgbuild gives the following error :

Best regards,

***

packer -S ranger-git
warning: ranger-git-20110926-1 is up to date -- reinstalling

Aur Targets    (1): ranger-git

Proceed with installation? [Y/n] y

Edit ranger-git PKGBUILD with $EDITOR? [Y/n]
==> Détermination de la dernière révision git...
  -> Version trouvée        : 20110929
==> Création du paquet ranger-git 20110929-1 (jeu. sept. 29 20:37:10 CEST 2011)
==> Vérification des dépendances pour l'exécution...
==> Vérification des dépendances pour la compilation...
==> Récupération des sources...
==> Extraction des sources...
==> Entre dans l'environnement fakeroot...
==> Lancement de build()...
==> Connecting to GIT server...
Cloning into ranger...
remote: Counting objects: 13826, done.
remote: Compressing objects: 100% (3398/3398), done.
remote: Total 13826 (delta 10637), reused 13474 (delta 10375)
Receiving objects: 100% (13826/13826), 2.46 MiB | 490 KiB/s, done.
Resolving deltas: 100% (10637/10637), done.
==> GIT checkout done or server timeout
Cloning into /tmp/packerbuild-1000/ranger-git/ranger-git/src/ranger-build...
done.
==> Running setup.py...
error: package directory 'ranger/help' does not exist
==> ERREUR: Une erreur s'est produite dans build().
    Abandon...
The build failed.

Offline

#1074 2011-09-29 19:04:40

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

Re: Ranger, a textbased filemanager

Fixed


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

Offline

#1075 2011-09-30 05:21:22

quatrix
Member
Registered: 2011-07-13
Posts: 7

Re: Ranger, a textbased filemanager

hut wrote:
quatrix wrote:

Thank you for the quick reply!

One thing I miss from mc is that in mc, when I press Enter, the file directly under the cursor is opened, whatever other files I have already marked.
Is ranger, wherever I press, Enter, it opens all the files that are marked. Is there a way to get the mc behaviour?

Sorry for the not-so-quick reply. I added the "c" flag to open the current file only, even when other files are marked. To use it, type "rc<enter>".


Thanks!

Offline

Board footer

Powered by FluxBB