You are not logged in.
Thanks for the quick answer.
2. Well, the first argument is -FY, not a file
Yeah but how should the syntax be? I don't know the first thing about python or programming for that matter.
Offline
Hi hut,how can i define a key to paste selection to a directory without entering the directory?
Last edited by killua (2011-04-12 00:33:17)
Offline
1. Army did that already, see here: (the entry of mupdf)
https://bbs.archlinux.org/viewtopic.php … 62#p869262
and don't forget to add the fix in the following post.
This worked for everything I tried except smplayer. It crashes with the error "Mplayer has finished unexpectedly. Exit code: 1"
MPlayer interrupted by signal 1 in module: sleep_timer
ID_SIGNAL=1
- MPlayer crashed. This shouldn't happen.
It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
gcc version. If you think it's MPlayer's fault, please read
DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
won't help unless you provide this information when reporting a possible bug.
Offline
1. Army did that already, see here: (the entry of mupdf)
https://bbs.archlinux.org/viewtopic.php … 62#p869262
and don't forget to add the fix in the following post.
And it works pretty well With one excepction, mplayer. I have the following in my apps.py
if f.video:
c.flags += 'sd'
return tup('nohup', 'mplayer', *c)
but mplayer is being killed when ranger is being closed. Everything's fine with
nohup mplayer file.mkv > /dev/null &
I don't understand why it works with every program except mplayer. I also tested it with ffplay to have a similar example, but with ffplay it works just fine.
Any ideas?
edit: Crap, I didn't read the last post. I guess it's the same issue.
Last edited by Army (2011-04-12 08:35:40)
Offline
Could ranger get bash-like completion? For example when I type :shell mplayer -chan and then press tab, that I get -channels?
Offline
Hi hut,how can i define a key to paste selection to a directory without entering the directory?
You know how binding keys works in general?
Just bind this command to a key:
shell cp %c "$(grep '^a' ~/.config/ranger/bookmarks | cut -b3-)"
this will cp the copied stuff to bookmark "a"
@Revelation60:
I could write a plugin for that some time, it should be possible.
@mplayer thingie:
Sorry, no idea.. make sure to post here if you find a solution!
It works fine by itself but if I add arguments I get the error “first argument is not a file”. This is what I have in apps.py:
class CustomApplications(Applications): def feh_cycle(self, c): return tup(‘feh-cycle’, ‘-FY’, *c) def app_default(self, c): f = c.file if f.image: return self.feh_cycle(c)
And this is the script in question just in case it has nothing to do with me sucking at python:
#!/bin/bash shopt -s nullglob if [[ ! -f $1 ]]; then echo “$0: first argument is not a file” >&2 exit 1 fi file=$(basename -- “$1”) dir=$(dirname -- “$1”) arr=() shift cd -- “$dir” for i in *; do [[ -f $i ]] || continue arr+=(“$i”) [[ $i == $file ]] && c=$((${#arr[@]} - 1)) done exec feh “$@” -- “${arr[@]:c}” “${arr[@]:0:c}”
Your shell script requires the first argument to be a filename, so lets do that:
def feh_cycle(self, c):
return ('feh-cycle', c.file.path, '-FY')
by the way, ranger already includes code that does this. You simply need to open an image with mode 11. (type 11<enter> or 11l). I got this in my apps.py to use this by default:
def app_feh(self, c):
if c.mode is 0: c.mode = 11
return DefaultApps.app_feh(self, c)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Thank you, now it works. Didn't notice the same functionality was built-in.
Offline
Try closing ranger by typing :quit or Q, mplayer will still be there (with default ranger settings, without nohup or anything)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Try closing ranger by typing :quit or Q, mplayer will still be there (with default ranger settings, without nohup or anything)
There are two ways to start ranger:
1. I open a terminal, e.g. urxvt and then type ranger<Enter>. That way mplayer isn't being killed.
2. I open ranger via a key combination which I configured to execute "/usr/bin/urxvtc -e /usr/bin/ranger". This way mplayer is being killed when ranger is quit with Q or :quit.
I open ranger like 2., that's the whole problem (I think I mentioned it when I first came up with what lead to using nohup)
Offline
killua wrote:Hi hut,how can i define a key to paste selection to a directory without entering the directory?
You know how binding keys works in general?
Just bind this command to a key:shell cp %c "$(grep '^a' ~/.config/ranger/bookmarks | cut -b3-)"
this will cp the copied stuff to bookmark "a"
Thanks~
It works like:
map('PP', fm.execute_console('shell cp -r %c $(grep ^a ~/.config/ranger/bookmarks | cut -b3-)'))
Actually what i want is to move selection to current directory without entering it, so i read some code, and then define:
map('PP', fm.execute_console('shell -s mv %c %f'))
I tried "shell -d " mode, but it's quite slow, 2-3s to respond , so silent mode instead.Is it possible to be faster to use detach mode?
Offline
hut wrote:killua wrote:Hi hut,how can i define a key to paste selection to a directory without entering the directory?
You know how binding keys works in general?
Just bind this command to a key:shell cp %c "$(grep '^a' ~/.config/ranger/bookmarks | cut -b3-)"
this will cp the copied stuff to bookmark "a"
Thanks~
It works like:map('PP', fm.execute_console('shell cp -r %c $(grep ^a ~/.config/ranger/bookmarks | cut -b3-)'))
Actually what i want is to move selection to current directory without entering it, so i read some code, and then define:
map('PP', fm.execute_console('shell -s mv %c %f'))
I tried "shell -d " mode, but it's quite slow, 2-3s to respond , so silent mode instead.Is it possible to be faster to use detach mode?
When you detach it, ranger will redraw before it finished moving so you see the old situation. Just press any key to redraw again. If I come up with a good way to do this automatically, I'll patch it. Thanks for pointing it out
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
I'm having a bit of a strange problem lately. I'm using autofs to mount a couple of remote servers with sshfs (/media/ssh/servername) and while a normal ls or cd into their directories works fine, using ranger often causes a timeout/hang that lasts 20-30 seconds to several minutes. During this time all sshfs traffic is stalled, so other open connections also stop working. Once the freeze is over, all traffic is and stays back normal. This only happens on the first 'connect' to a directory managed by autofs.
Any idea where to start debugging this..?
ᶘ ᵒᴥᵒᶅ
Offline
I think its because ranger accesses too many files to generate its preview but it could be anything... look what kind of traffic is generated, what files are accessed. I'm working on general optimizations but I don't know if it helps with your problem.
EDIT
Try upgrading now and see if it helps
Last edited by hut (2011-04-19 16:16:11)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
look what kind of traffic is generated, what files are accessed.
How could i best determine this?
P.s., if i have multiple remote servers like this:
/media/ssh/server1
/media/ssh/server2
etc.
and from / i use ranger to :cd /media/ssh/server1, i guess there isn't any chance that ranger is trying to access server2 as well is there?
edit: will upgrade first
edit2: i'm doing a simple test with the latest ranger:
:cd /media/ssh/server1
This results in an immediate timeout that lasts several minutes, cpu usage and load are both 0 during the timeout.
Last edited by litemotiv (2011-04-19 16:37:15)
ᶘ ᵒᴥᵒᶅ
Offline
hut wrote:look what kind of traffic is generated, what files are accessed.
How could i best determine this?
P.s., if i have multiple remote servers like this:
/media/ssh/server1 /media/ssh/server2 etc.
and from / i use ranger to :cd /media/ssh/server1, i guess there isn't any chance that ranger is trying to access server2 as well is there?
edit: will upgrade first
The earlier version in fact did an os.listdir('/media/ssh/server2'). After the latest patch it will only do os.stat('/media/ssh/server2') to determine what kind of file/directory it is, but shouldn't use ssh...
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Right, actually when i do :cd /media/ssh/servernam[tab], netstat does only list a connection to the servername that it should complete, yet it's still stalling for quite some time (minutes).
ᶘ ᵒᴥᵒᶅ
Offline
Right, actually when i do :cd /media/ssh/servernam[tab], netstat does only list a connection to the servername that it should complete, yet it's still stalling for quite some time (minutes).
And when you :cd into the directory by typing the full name and pressing enter? Same thing?
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
And when you :cd into the directory by typing the full name and pressing enter? Same thing?
Yes same thing. Doing the same from a terminal (either cd or ls) works straight away.
ᶘ ᵒᴥᵒᶅ
Offline
Hmm. If you look at cd.tab() in commands.py, all it does is os.walk(dirname) and some logic. Can you run this script and see if it has the same effect?
import os
next(os.walk('/media/ssh/servername'))
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hmm. If you look at cd.tab() in commands.py, all it does is os.walk(dirname) and some logic. Can you run this script and see if it has the same effect?
import os next(os.walk('/media/ssh/servername'))
Ok, i first ran that script, it finished immediately and ended in:
49:unix 2 [ ACC ] STREAM LISTENING 79942 /home/ollie/.ssh/cm_socket/user@server1.AIdei9FFSLSEAQNe
Then i fired up ranger and cd'd to server2:
49:unix 2 [ ACC ] STREAM LISTENING 79942 /home/ollie/.ssh/cm_socket/user@server1.AIdei9FFSLSEAQNe
53:unix 2 [ ACC ] STREAM LISTENING 89149 /home/ollie/.ssh/cm_socket/user@server2.A0h1X9xKtVN6xCKP
But the ranger interface hang for about a minute until it displayed the contents of the directory..
ᶘ ᵒᴥᵒᶅ
Offline
hut, i got some problem when previewed some files which always are temp files generated by some download manager of windows.When previewing it ,ranger stops working, and high %CPU & %MEM happens, especially %MEM, above 50% But everything is ok, if i turn off preview option.
So is it possible to prevent such situation happening?
Offline
is there a way in ranger to search for filename
and if results >0 display:
one list with all files in all subdirs recursively??
or using "n" key like in search jump to every found file?
Offline
My Ranger seems to have a memory leak, or something. I have only narrowed it down to Ranger. It seems when I leave Ranger open it slowly builds up memory usage within Urxvt. At the start Urxvt uses about .4% memory. After leaving Ranger open for a while the usage creeps up. I have had it use over 10% of 4gb memory! After closing ranger the usage drops back down to .4% for Urxvt.
Any reason for this?
Offline
is there a way in ranger to search for filename
and if results >0 display:
one list with all files in all subdirs recursively??
or using "n" key like in search jump to every found file?
I also would like something like this.
Sometimes you're looking for a file that's buried a few more levels of directories deep, so if you want to look for it, you need to go into directories, to list their contents, go out of them again, do the next, etc. this is very cumbersome.
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
Before Ranger, I used to use Thunar.
In Thunar, I was able to add custom command in a bash script style :
e.g : [command file name] %f
associated to a particular file type based on the extension in the file name. When I accessed the context menu through a right-click I was able to access a list of custom command specific to a particular type.
Is there a similar feature in Ranger ?
e.g : showing a list of custom commands for a particular file type that can be executed by typing a shortcut character, in a similar way to the Ranger's bookmark feature.
Offline