You are not logged in.

#1251 2012-03-19 21:55:17

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

Re: Ranger, a textbased filemanager

Thanks for pointing that out.

I fixed it, but unfortunately there is no setsid command on bsd by default, so I kept nohup as a fallback... Maybe I should implement the setsid part purely in python.

Last edited by hut (2012-03-19 21:55:47)


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

Offline

#1252 2012-03-20 10:07:11

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

Re: Ranger, a textbased filemanager

Ok, I didn't think of bsd. Looks good now and your new implementation is really nice!

I do have to wonder about

ext od[tspfg]|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric,    X, flag f = gnumeric -- "$@"

Since when does gnumeric support e.g. odt files?

Offline

#1253 2012-03-20 12:58:50

igndenok
Member
From: Sidoarjo, Indonesia
Registered: 2010-06-07
Posts: 160

Re: Ranger, a textbased filemanager

Really love this new conf file (rifle.conf) hut!.
Got a problem with newest ranger-git, everytime I use open-with I get this.

'FM' object has no attribute 'apps'

Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.

Offline

#1254 2012-03-20 15:32:38

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

Re: Ranger, a textbased filemanager

Hut, there's one thing I miss in the new opener: c.mode from the appy.py! I heavily use them, especially with mplayer to be able to control the used soundcard. I have 4 Soundcards, 2 are internal (default and hdmi-audio) and 2 external ones. 1 means "soundcard 1", 2 "soundcard 2" and 3 "soundcard 3". I also have 7 to rotate to the left and 8 to rotate to the right (I have some videos which require this, because some people aren't able to correctly hold a camera... and 9 to heavily cache the movie so the harddisk can spin down, saves a lot of energy when I'm on battery with the laptop. Up to here it's possible to implement it in the new rifle.conf. But if I want to combine those, e.g. 27 to play the movie with "soundcard 2" and rotated to the left, implementing this isn't possible (or in a very ugly way)

          if f.video:
               if 'DISPLAY' in os.environ:
                    c.flags += 'sd'
                    if c.mode == 1:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=1.0', *c)
                    if c.mode == 17:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=1.0', '-vf', 'rotate=2', *c)
                    if c.mode == 18:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=1.0', '-vf', 'rotate=1', *c)
                    if c.mode == 19:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=1.0', '-cache', '1048576', '-cache-min', '99', *c)
                    if c.mode == 2:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=plughw=2.0', *c)
                    if c.mode == 27:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=2.0', '-vf', 'rotate=2', *c)
                    if c.mode == 28:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=2.0', '-vf', 'rotate=1', *c)
                    if c.mode == 29:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=2.0', '-cache', '1048576', '-cache-min', '99', *c)
                    if c.mode == 3:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=plughw=3.0', *c)
                    if c.mode == 37:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=3.0', '-vf', 'rotate=2', *c)
                    if c.mode == 38:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=3.0', '-vf', 'rotate=1', *c)
                    if c.mode == 39:
                         return tup('setsid', 'mplayer', '-ao', 'alsa:device=hw=3.0', '-cache', '1048576', '-cache-min', '99', *c)
                    if c.mode == 7:
                         return tup('setsid', 'mplayer', '-vf', 'rotate=2', *c)
                    if c.mode == 8:
                         return tup('setsid', 'mplayer', '-vf', 'rotate=1', *c)
                    if c.mode == 9:
                         return tup('setsid', 'mplayer', '-cache', '1048576', '-cache-min', '99', *c)
                    else:
                         return tup('setsid', 'mplayer', *c)
               else:
                    ...

Am I missing something or is this not possible anymore?

Offline

#1255 2012-03-20 18:40:36

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

Re: Ranger, a textbased filemanager

igndenok wrote:

Really love this new conf file (rifle.conf) hut!.
Got a problem with newest ranger-git, everytime I use open-with I get this.

'FM' object has no attribute 'apps'

what's the traceback? (run ranger --debug)
You probably have an outdated commands.py in ~/.config/ranger.

Army wrote:

Since when does gnumeric support e.g. odt files?

Oops

Army wrote:

Hut, there's one thing I miss in the new opener: c.mode from the appy.py!

Yes, I'll add a function that allows you to jump to a specific "mode".

Last edited by hut (2012-03-20 18:41:10)


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

Offline

#1256 2012-03-21 00:04:14

igndenok
Member
From: Sidoarjo, Indonesia
Registered: 2010-06-07
Posts: 160

Re: Ranger, a textbased filemanager

hut wrote:

You probably have an outdated commands.py in ~/.config/ranger.

You're so right, again with this problem (My bad hut, I'll remember about this.). I tried again, and I got this

No action found.

Last edited by igndenok (2012-03-21 00:06:17)


Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.

Offline

#1257 2012-03-21 00:26:33

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

Re: Ranger, a textbased filemanager

igndenok wrote:
No action found.

Strange. By default, every file has at least one action. Maybe you have a broken/old rifle.conf? Try to remove ~/.config/ranger/rifle.conf and upgrade ranger. If the problem persists, contact me on IRC. (h00th00t on irc.freenode.net)


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

Offline

#1258 2012-03-21 00:59:37

mahatman2
Member
From: Baton Rouge, LA, USA
Registered: 2010-03-04
Posts: 46
Website

Re: Ranger, a textbased filemanager

Hi, I'm using the newest ranger from git as well and I have the same problem. When I press "l" (ell) on everything with a gui (feh, file-roller, etc), the line is replaced with

/bin/sh:  1: Syntax error: Bad fd number

, and when I try ":open_with" and type anything it says

No action found.

.

If I try to use one of the numbers at the bottom with the predefined commands, nothing happens as to the file but ranger itself gets some weird functionality.

If it helps, I'm using ranger from the main git repo on Debian Testing.


Clever Linux quote.

Offline

#1259 2012-03-21 01:06:01

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

Re: Ranger, a textbased filemanager

Same problem, same answer: Try to remove config files and contact me on IRC. It's faster to debug with instant messaging.


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

Offline

#1260 2012-03-21 10:52:30

suborbital
Member
From: #freenode
Registered: 2012-03-21
Posts: 21

Re: Ranger, a textbased filemanager

+ 1 for OpenBSD support.

Offline

#1261 2012-03-21 17:41:26

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

Re: Ranger, a textbased filemanager

mahatman2 wrote:
No action found.

This should be fixed now. Shout if something is still broken.


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

Offline

#1262 2012-03-22 00:56:21

nonah
Member
Registered: 2012-03-18
Posts: 24

Re: Ranger, a textbased filemanager

Is there any way to access a samba/windows share using Ranger? Haven't been able to find an answer using search, so I guess not, and if so, any plans to support this?

Offline

#1263 2012-03-22 01:42:00

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

Re: Ranger, a textbased filemanager

It's not supported and not planned in the near future.


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

Offline

#1264 2012-03-22 06:56:28

nonah
Member
Registered: 2012-03-18
Posts: 24

Re: Ranger, a textbased filemanager

Allright, thanks for the answer smile

Offline

#1265 2012-03-23 02:48:02

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: Ranger, a textbased filemanager

will ranger support unzip?
i have to switch to shell every time when i need to unzip a file.


"After you do enough distro research, you will choose Arch."

Offline

#1266 2012-03-23 02:59:49

Baabelfish
Member
From: Finland
Registered: 2012-02-14
Posts: 17

Re: Ranger, a textbased filemanager

taylorchu wrote:

will ranger support unzip?
i have to switch to shell every time when i need to unzip a file.

I put this into my rc.conf:

map Pu shell atool -x %s

Just remember to install atool wink

Last edited by Baabelfish (2012-03-23 03:00:14)


usability == arch + i3 + urxvt + vim + ranger + dwb + vlc + cmus + mutt + shitload of scripts

Offline

#1267 2012-03-23 03:00:11

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

Re: Ranger, a textbased filemanager

taylorchu wrote:

will ranger support unzip?
i have to switch to shell every time when i need to unzip a file.

It already does. I just hit 1l on a zip file, and aunpack gets down to it.


@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

#1268 2012-03-23 03:18:17

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: Ranger, a textbased filemanager

where do you see this in the manual?


"After you do enough distro research, you will choose Arch."

Offline

#1269 2012-03-23 07:53:51

igndenok
Member
From: Sidoarjo, Indonesia
Registered: 2010-06-07
Posts: 160

Re: Ranger, a textbased filemanager

Run ranger with

$ ranger --copy-config=all

To copy all config to ~/.config/ranger, then edit
    1. rc.conf = keymap
    2. apps.py = list of application used for open_with (rifle.conf if you using ranger-git)
    3. scope.sh = list of application used for preview
For ranger manual

$ man ranger

or press ? inside ranger


Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.

Offline

#1270 2012-03-23 18:49:51

bananagranola
Member
From: US
Registered: 2011-08-07
Posts: 88
Website

Re: Ranger, a textbased filemanager

Would it be highly inadvisable to use mimi (an xdg-open replacement) in ranger with rifle?

Mimi recommends that its default opener be a file manager (ranger), but if I call mimi from ranger that seems rather stupidly circular, so I'm using vim as my default.

I was hoping to use mimi from ranger so I would only need to configure one opener (I try out new applications constantly and it'd be nice to only have to change one file.)

Is this a bad idea for a reason I haven't thought of? I tried googling "ranger xdg-open" but since rifle is newer, I haven't found an answer.

Offline

#1271 2012-03-23 19:57:48

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

Re: Ranger, a textbased filemanager

If you want to use mimi (or any other file opener) in ranger, I'd suggest this rifle.conf:

else = mimi "$@"
label editor, terminal = vim -- "$@"

Don't use ranger as a fallback in mimi then, for the reason you mentioned. Just put all programs you need into the mimi config. You could copy them from the default rifle.conf.

If you want to use rifle's advanced features at the cost of a somewhat more complex configuration, you could use rifle as a standalone file opener:

python /usr/lib/python3.2/site-packages/ranger/ext/rifle.py

It currently takes around 0.4s to startup because of python, but it is still faster than using ranger.

EDIT: oops, mimi has to be the first entry in the list, not the editor. But make sure there's an editor, or the  "E" key will not work.

Last edited by hut (2012-03-24 08:54:33)


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

Offline

#1272 2012-03-24 00:23:31

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: Ranger, a textbased filemanager

https://github.com/taylorchu/march/blob … /mime.conf

this is my current mimi setting. i hope this will help someone who wants to use mimi with ranger like me.


"After you do enough distro research, you will choose Arch."

Offline

#1273 2012-03-24 23:04:29

bananagranola
Member
From: US
Registered: 2011-08-07
Posts: 88
Website

Re: Ranger, a textbased filemanager

Thanks, hut and taylorchu.

I tried using

else, flag f = xdg-open "$1"

after all the extensions, similar to hut's suggestion. It works fine. (I don't think xdg-open can take more than one argument.) I also tried

has xdg-open, flag f = xdg-open "$1"

at the top of the file, and that works fine as well.

I've edited my default in mimi as well, to

default:urxvtc -e ranger --selectfile

like taylorchu suggested. It eliminates the circular problem.

Thanks!

Offline

#1274 2012-03-27 12:18:34

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

Re: Ranger, a textbased filemanager

I guess some people miss the apps.py entry which opens all image files in sxiv and starts at the current file. Here's a script for that:

#!/bin/sh
target="$(realpath -s "$1")"
[ "$1" == '--' ] && shift
function listfiles {
  find "$(dirname "$target")" -maxdepth 1 -type f -regex '.*\(jpe?g\|png\|gif\)$' -print0 | sort -z
}
count="$(listfiles | grep -m 1 -Zznx "$target" | cut -d: -f1)"

if [ -n "$count" ]; then
  listfiles | xargs -0 sxiv -n "$count" --
else
  sxiv -- "$@" # fallback
fi

rifle.conf entry:

ext jpe?g|png|gif, flag f, X = <scriptname> "$@"

It would be good to have in ranger by default but such a large script doesn't fit in rifle.conf. I guess i'll put it in the doc/ directory or something.

Last edited by hut (2012-03-28 00:25:39)


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

Offline

#1275 2012-04-01 20:34:07

JoKo
Member
Registered: 2010-04-09
Posts: 37

Re: Ranger, a textbased filemanager

Hello,

Is it possible to rename a file / directory starting from its original name? E.g. I want to rename hello1 to hello , so I select the file, press a mapping and ":rename hello1" appears, I press Backspace and Enter and it's done.


Thanks in advance!

Offline

Board footer

Powered by FluxBB