You are not logged in.

#376 2010-07-01 12:45:03

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

Re: Ranger, a textbased filemanager

I'm trying to use qiv as the default image viewer, since it can handle exif rotation, and to queue all the image files in the current directory. With plain qiv, the command line I want is:

qiv -film *

But if I try to add the following to apps.py:

    @depends_on('qiv')
    def app_qiv(self, c):
        c.flags += 'd'
        return tup('qiv', '-film', '*', *c)

It doesn't work: only the current image is loaded. What am I doing wrong?

Offline

#377 2010-07-01 12:49:18

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

Re: Ranger, a textbased filemanager

try:
return "qiv -film *"


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

Offline

#378 2010-07-01 13:39:11

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

Re: Ranger, a textbased filemanager

Ah - was it that simple? I thought it had to be a tuple line. Thanks, works perfectly.

Offline

#379 2010-07-01 15:51:06

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

Re: Ranger, a textbased filemanager

I should have made it simpler from the start:

return "mplayer -arg1 -arg2 %s"
rather than:
return tup("mplayer", "-arg1", "-arg2", *c)

But right now, %s is not substituted with the selected files, so you gotta use *c (which just gives you a tuple of all selected files.)


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

Offline

#380 2010-07-02 08:21:05

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Ranger, a textbased filemanager

Hi. Thanks for this impressive piece of software. I was growing tired of pressing jjjhhllkkk in mc tongue

I've two questions, if you don't mind.

1) There will be some support for dual panel view? Like mc.

2) There're plans to do ranger in client / server mode with a daemon? Like urxvt.

Thanks!


Sorry for my English. Feel free to point out my errors.

Offline

#381 2010-07-02 08:33:09

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

Re: Ranger, a textbased filemanager

Hi rb. Unfortunately the answer is "no" to both questions.
But nobody knows what the future will bring tongue

You can still use "ranger /bin /usr/bin" to open both directories, and use TAB to toggle between them, similar to mc smile


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

Offline

#382 2010-07-02 08:37:48

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: Ranger, a textbased filemanager

I guess I'll stay in mc, I just can't live without dual panel view tongue

Either way, I'll stay tuned smile Thanks for your reply!


Sorry for my English. Feel free to point out my errors.

Offline

#383 2010-07-02 18:48:32

bjesus
Member
Registered: 2007-04-06
Posts: 55

Re: Ranger, a textbased filemanager

dude this ranger is awesome! great work!

Offline

#384 2010-07-03 06:55:13

saline
Member
Registered: 2010-02-20
Posts: 86

Re: Ranger, a textbased filemanager

Sorry if I've glazed past if this was already brought up, but could

map('du', fm.execute_command('du --max-depth=1 -h | less'))

(defaults/keys.py +184) be altered to use what is given in CustomApplications.app_pager?  I have this fixed for myself in my user keys.py, so this is not a big issue for me.  I just thought the single config point might be better.

Thanks for reading this, and thanks for ranger!

Offline

#385 2010-07-03 09:15:12

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

Re: Ranger, a textbased filemanager

Sure. How did you fix it though? (or did you just replace "less" with your pager ^^?)


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

Offline

#386 2010-07-03 16:17:56

saline
Member
Registered: 2010-02-20
Posts: 86

Re: Ranger, a textbased filemanager

Exactly: 

map = keymanager.get_context('browser')
map('du', fm.execute_command('du --max-depth=1 -mh | vimpager'))

Offline

#387 2010-07-05 03:25:17

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: Ranger, a textbased filemanager

Hello, I want to launch movie files with a special bash script:

#!/bin/sh
#Script to turn off monitor modes that will power down, standby or blank the screen
#

#Disable modes
/usr/bin/xset -dpms &
/usr/bin/xset s off &

#Open VLC
/usr/bin/vlc $1

#Re-enable modes
/usr/bin/xset dpms
/usr/bin/xset s on

I have used an alias in bashrc,

alias vlc='vlc.sh' # vlc.sh is the script above

In Ranger, I use this:

if f.extension in (c, 'tp', 'wav', 'asf', 'vob', 'ts', 'mpg', 'mpeg', 'mp3', 'flv', 'wmv'):
                                return self.either(c, 'vlc')

However when I load files from Ranger it doesn't appear the script is loaded because my screens still shut off after 5 minutes, but if I load the script manually or by running 'vlc' in the command line, it works perfectly.

I can only assume Ranger isn't calling vlc in a typical way, is there any easy fix for this?

One user has suggested:

jac wrote:

I'm guessing that Ranger is still running the actual vlc. I'm going to take a stab at it and say that you could either change that line to be

if f.extension in (c, 'tp', 'wav', 'asf', 'vob', 'ts', 'mpg', 'mpeg', 'mp3', 'flv', 'wmv'):
                                return self.either(c, 'vlc.sh')

Or, rename vlc.sh to just vlc and make sure it's in your path (the directory it's in must also be before the /usr/bin directory, so that it will take precedence). If it is, anything trying to execute vlc from your user should execute the script without needing any aliases or other work-arounds.

But I should think it would be possible just by changing Ranger, no?

Offline

#388 2010-07-05 08:04:38

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

Re: Ranger, a textbased filemanager

Aliases defined in the bashrc have no effect on ranger


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

Offline

#389 2010-07-05 08:07:00

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: Ranger, a textbased filemanager

Yes, I came to that conclusion when it didn't work. The real question is how can ranger open a script without changing the original /usr/bin/vlc file?

Offline

#390 2010-07-05 08:12:02

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

Re: Ranger, a textbased filemanager

jac gives the answer already smile

My bashrc contains this:
export PATH="$HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"

and there is a script at ~/bin/mplayer which is used instead of the /usr/bin/mplayer

Last edited by hut (2010-07-05 08:12:43)


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

Offline

#391 2010-07-05 09:00:48

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: Ranger, a textbased filemanager

Ahh, so setting that should take priority before it's ran via somewhere else. How can i be sure i included all the excutable paths on my system?  I only have one extra one I want to add. I won't break anything if I forget something will I? ):

Offline

#392 2010-07-05 09:09:25

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

Re: Ranger, a textbased filemanager

export PATH="$HOME/bin:$PATH"

this will prepend ~/bin to your original path. (the problem is, it will do this again each time you write "source ~/.bashrc", resulting in something like PATH="$HOME/bin:$HOME/bin:$HOME/bin:....." which is not harmful but annoying.)

Or just replace the variable $PATH above with the output of the command echo $PATH

Last edited by hut (2010-07-05 09:10:46)


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

Offline

#393 2010-07-05 09:12:41

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: Ranger, a textbased filemanager

I will give it a shot! I may as well make a few more. custom script for ranger. I need to make some for uncompressing files on opening them. thanks smile

Ps, writing on mobile is tough sad

Last edited by Google (2010-07-05 09:13:38)

Offline

#394 2010-07-05 11:09:14

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: Ranger, a textbased filemanager

Ok, I did it. Now it opens my script and starts VLC, but it doesn't load the file I clicked on in Ranger, it simply opens Ranger. I posted the bash script above. Can anyone tell me why it wouldn't load the file based on that script?

/usr/bin/vlc $1 # This should load the file clicked on, right?

Offline

#395 2010-07-05 11:18:55

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

Re: Ranger, a textbased filemanager

That should play the file if ranger only passes the file name to vlc and it's full path contains no spaces.
First, I would try putting quotes around the variable. Then, if it has spaces in it it will all be one token instead of being broken up and trying to open multiple files.
Then, I would change 1 to be an @ symbol, so it uses all the arguments ranger is trying to pass to vlc, so you get

/usr/bin/vlc "$@"

This will fix the problem with the script in the case that the file name has a space in it, or if the file name is not the first thing ranger passes to vlc.

If that doesn't fix it, mention if the file does indeed have a space in it.

Last edited by jac (2010-07-05 11:24:50)

Offline

#396 2010-07-05 11:33:17

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: Ranger, a textbased filemanager

Hello, I tried a file with and without spaces. Nothing is different. It opens and stays open but doesn't play anything. Also, it shoots me an error when I attempt to open a .vob/.ts DVD file saying it is encrypted and will not play, can't find the directory or something of the sort.

#!/bin/sh
#Script to turn off monitor modes that will power down, standby or blank the screen
#   

#Disable modes
/usr/bin/xset -dpms &
/usr/bin/xset s off &

#Open VLC
/usr/bin/vlc "$@"

#Re-enable modes
/usr/bin/xset dpms
/usr/bin/xset s on

VLC media player 1.1.0 The Luggage (revision exported)
Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS")
Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE")
Warning: call to signal(13, 0x1)
Blocked: call to setlocale(6, "")
Blocked: call to sigaction(17, 0xb0fc9058, 0xb0fc90e4)
Warning: call to signal(13, 0x1)
Blocked: call to setenv("ORBIT_SOCKETDIR", "/tmp/orbit-corey", 1)
Warning: call to srand(1278531838)
Warning: call to rand()
Blocked: call to setlocale(6, "")

(process:2854): Gtk-WARNING **: Locale not supported by C library.
    Using the fallback 'C' locale.
Warning: call to signal(13, 0x1)
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdread: Can't stat /mnt/storage/Videos/Music
No such file or directory
libdvdnav: vm: failed to open/read the DVD
[0xb0e01084] filesystem access error: cannot open file /mnt/storage/Videos/Music (No such file or directory)
[0x9b58914] main input error: open of `file:///mnt/storage/Videos/Music' failed: (null)
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdread: Can't stat /mnt/storage/Videos/Music Videos/Videos/BoA-Bewithyou.vob
No such file or directory
libdvdnav: vm: failed to open/read the DVD
[0xb0e01084] filesystem access error: cannot open file /mnt/storage/Videos/Music Videos/Videos/BoA-Bewithyou.vob (No such file or directory)
[0x9b4edf4] main input error: open of `file:///mnt/storage/Videos/Music%20Videos/Videos/BoA-Bewithyou.vob' failed: (null)

Offline

#397 2010-07-05 11:34:35

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: Ranger, a textbased filemanager

libdvdread: Can't stat /mnt/storage/Videos/Music

I notice this is wrong, it should be

/mnt/storage/Videos/Music Videos/

The folder has a space in it. Could this be the reason? How can we fix this?

edit:

I renamed my folder without a space, and the file without a space and it works. Now the question is how can we get it to read a filename with spaces (and the directory, if possible!)?

Last edited by Google (2010-07-05 11:44:54)

Offline

#398 2010-07-05 15:25:04

BenderRodriguez
Member
Registered: 2010-07-05
Posts: 16
Website

Re: Ranger, a textbased filemanager

Just wanted to say "Thank You!" for this awesome filemanager!

Offline

#399 2010-07-06 20:36:26

fl4t3r1c
Member
Registered: 2010-07-06
Posts: 1

Re: Ranger, a textbased filemanager

Great work so far!

I'm not sure whether this question has been asked already or if it is kind of stupid :-).
Is a default action ('l' command or <Enter>) for mouse doubleclick implemented? Can i configure this?

Offline

#400 2010-07-06 21:09:45

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

Re: Ranger, a textbased filemanager

You can do a "l" with the mouse by clicking into the preview, just like with directories. Even if there's no preview, there will be some whitespace at the right which you can click at.
Double clicks are not supported yet.


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

Offline

Board footer

Powered by FluxBB