You are not logged in.
ngoonee wrote:Sorry, hut, I must be blind, but I can't see anything referring mimeopen in apps.py. Also, ranger --copy-config doesn't exist .
Okay, you didn't tell me what version you use so I just guessed
Then just add this at the bottom of the function:
return tup("xdg-open", *c)
Sorry hut, I really feel stupid, but it doesn't seem to 'work'. I tried with ranger (wouldn't even start), so upgraded to ranger-git, after line 188 I added this:-
def app_mimeopen(self, c):
if c.mode is 0:
return tup("xdg-open", *c)
if c.mode is 1:
# Will ask user to select program
# aka "Open with..."
return tup("xdg-open", "--ask", *c)
Doesn't seem to work though, pressing 'Enter' still goes to command mode with :open_with
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Ranger rocks! Thanks for your great job,hut ^_^ Ranger is the only one file manager i have installed.
Just one question: is it possible to map key to do combined actions,for example,can i map J to firstly move down and then enter ? ( J = j+l )
Yep, but it's a bit tricky. You need to define your own function, basically. Either anonymous (like the "um<bg>" mapping) or named (like the "gn" mapping) functions. Take a look at those mappings and adapt them to your needs.
Edit: try something like this:
@map("x")
def downright(arg):
arg.fm.move(down=1)
arg.fm.move(right=1)
hut wrote:ngoonee wrote:Sorry, hut, I must be blind, but I can't see anything referring mimeopen in apps.py. Also, ranger --copy-config doesn't exist .
Okay, you didn't tell me what version you use so I just guessed
Then just add this at the bottom of the function:
return tup("xdg-open", *c)
Sorry hut, I really feel stupid, but it doesn't seem to 'work'. I tried with ranger (wouldn't even start), so upgraded to ranger-git, after line 188 I added this:-
def app_mimeopen(self, c): if c.mode is 0: return tup("xdg-open", *c) if c.mode is 1: # Will ask user to select program # aka "Open with..." return tup("xdg-open", "--ask", *c)
Doesn't seem to work though, pressing 'Enter' still goes to command mode with :open_with
This is weird. Make sure that the configuration is at the right place ($XDG_CONFIG_HOME/ranger/apps.py or ~/.config/ranger/apps.py overrides /path/to/ranger/defaults/apps.py), test the custom application definition by typing :open_with mimeopen, remove the @depends_on('mimeopen') line above the function if it's still there (because ranger won't run it if the dependencies are not installed.)
Last edited by hut (2010-11-09 14:08:06)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
ngoonee wrote:hut wrote:Okay, you didn't tell me what version you use so I just guessed
Then just add this at the bottom of the function:
return tup("xdg-open", *c)
Sorry hut, I really feel stupid, but it doesn't seem to 'work'. I tried with ranger (wouldn't even start), so upgraded to ranger-git, after line 188 I added this:-
def app_mimeopen(self, c): if c.mode is 0: return tup("xdg-open", *c) if c.mode is 1: # Will ask user to select program # aka "Open with..." return tup("xdg-open", "--ask", *c)
Doesn't seem to work though, pressing 'Enter' still goes to command mode with :open_with
This is weird. Make sure that the configuration is at the right place ($XDG_CONFIG_HOME/ranger/apps.py or ~/.config/ranger/apps.py overrides /path/to/ranger/defaults/apps.py), test the custom application definition by typing :open_with mimeopen, remove the @depends_on('mimeopen') line above the function if it's still there (because ranger won't run it if the dependencies are not installed.)
Yes, removing that line makes things work. Thanks much . Why would it not, in the first place?
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Thats rangers way to figoure out what program to use. In app_default there are lots of self.either(...) calls which look for the first installed application in the given list. And how is ranger supposed to know if a program is installed? By passing along a list of dependencies with @depends_on()
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hi Hut, I have some new stuff for you to fix
I wanted to rename a file. The new name included a german umlaut (äöü), but ranger doesn't do this right. I think I remember that it used to work. Could you please fix that?
Fixed!
It still has problems with wide chars, like, the cursor is displayed at the wrong place, but it's usable.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hut, when i rename directories, sometimes a trailing / is appended to the folder name when i press I or A, but not always. Any idea why this is?
ᶘ ᵒᴥᵒᶅ
Offline
Hut, when i rename directories, sometimes a trailing / is appended to the folder name when i press I or A, but not always. Any idea why this is?
No idea, never seen this...
Is this effect dependent on the directory name?
What python version + ranger version?
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Army wrote:Hi Hut, I have some new stuff for you to fix
I wanted to rename a file. The new name included a german umlaut (äöü), but ranger doesn't do this right. I think I remember that it used to work. Could you please fix that?
Fixed!
It still has problems with wide chars, like, the cursor is displayed at the wrong place, but it's usable.
Okay, works It's usable, yes. The only thing that keeps me from switching to python3 is, that with python3 ranger doesn't update the terminal's title. I like that feature, I don't really need it, but ... I like it
Offline
nice fm, overall I still prefer using the shell for most things but it's very useful for copying and sorting large collections
I haven't tried it out, but would it be possible to copy in one ranger instance and pasting it in another?
Offline
thanks hut! am loving this fm, while i still use the shell for most things ranger now autostarts fullscreen on my media pc and is proving to be an excellent file manager for my needs
Offline
Hello hut,
Not sure it is normal but if I delete a file/folder in a shell and if I was at the same time on this file/folder in ranger then ranger crash with the following output :
Traceback (most recent call last):
File "/usr/lib/python3.1/site-packages/ranger/core/main.py", line 85, in main
fm.loop()
File "/usr/lib/python3.1/site-packages/ranger/core/fm.py", line 198, in loop
ui.redraw()
File "/usr/lib/python3.1/site-packages/ranger/gui/ui.py", line 213, in redraw
self.draw()
File "/usr/lib/python3.1/site-packages/ranger/gui/ui.py", line 234, in draw
DisplayableContainer.draw(self)
File "/usr/lib/python3.1/site-packages/ranger/gui/displayable.py", line 268, in draw
displayable.draw()
File "/usr/lib/python3.1/site-packages/ranger/gui/widgets/statusbar.py", line 83, in draw
ctime = self.env.cf.stat.st_ctime
AttributeError: 'NoneType' object has no attribute 'st_ctime'
Sirsurthur
Offline
litemotiv wrote:Hut, when i rename directories, sometimes a trailing / is appended to the folder name when i press I or A, but not always. Any idea why this is?
No idea, never seen this...
Is this effect dependent on the directory name?
What python version + ranger version?
I'm not sure, i can't reproduce it structurally.. It's been like this since i started using ranger, so it doesn't seem version dependent. I'll have a lookout if python3 behaves differently in this regard.
ᶘ ᵒᴥᵒᶅ
Offline
hut wrote:litemotiv wrote:Hut, when i rename directories, sometimes a trailing / is appended to the folder name when i press I or A, but not always. Any idea why this is?
No idea, never seen this...
Is this effect dependent on the directory name?
What python version + ranger version?
I'm not sure, i can't reproduce it structurally.. It's been like this since i started using ranger, so it doesn't seem ranger-version dependent. I'll have a lookout if python3 behaves differently in this regard.
Last edited by litemotiv (2010-11-16 19:05:09)
ᶘ ᵒᴥᵒᶅ
Offline
Hey,
I just wanted to share something I coded for myself.
I added custom preview to work with extended files attributes.
Atm there is :tagmode (it toogles the mode) command that changes the small preview on the right side to output extended file attributes of selected file.
There is support for tagging:
- alt-insert, tag selected file with "iLike" tag
- alt-del, delete "iLike" tag
It is mainly coded as a "proof of concept" and depends on too many internals of FM class. Nethertheless I've been using it for a month now and its working like a charm with ranger-git in AUR.
By using mocp (in deamon mode) to play music files I can use ranger as comfortable music-tagger.
Thx for writing ranger!
Last edited by groundnuty (2010-11-16 18:40:58)
Offline
nice fm, overall I still prefer using the shell for most things but it's very useful for copying and sorting large collections
I haven't tried it out, but would it be possible to copy in one ranger instance and pasting it in another?
Yep, try the commands :save_copy_buffer and :load_copy_buffer, which save/load the list of copied files, allowing to transfer it between ranger instances.
Not sure it is normal but if I delete a file/folder in a shell and if I was at the same time on this file/folder in ranger then ranger crash with the following output :
Yes, that's normal, ranger doesn't like it if you pull away the ground below its feet
Edit: Fixed
Hey,
[...]
It is mainly coded as a "proof of concept" and depends on too many internals of FM class. Nethertheless I've been using it for a month now and its working like a charm with ranger-git in AUR.
Cool. And sorry for not providing some "official" interface. It's planned. The devel version even has a plugin system, but I have no time to finish it... Also, calling fm.reset() just to reload the preview looks kind of brutal, it definitely needs an own command/function/key
Edit: The newest version has: self.fm.update_preview(self.fm.env.cf.path)
Last edited by hut (2010-11-17 19:17:40)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
vanvalium wrote:nice fm, overall I still prefer using the shell for most things but it's very useful for copying and sorting large collections
I haven't tried it out, but would it be possible to copy in one ranger instance and pasting it in another?Yep, try the commands :save_copy_buffer and :load_copy_buffer, which save/load the list of copied files, allowing to transfer it between ranger instances.
thanks, nice to know
Offline
hi hut, is it possible to paste soft symbol link in ranger? or can you add this feature?
Offline
I think I just came across a tiny bug.
Scenario: I have three open tabs. The path in tab 1 is very short, so everything can be displayed in the top bar. In tab 2 and 3 the path is longer, so the three tab names get pushed to the right side. Now if I want to select a tab by clicking on it's title, I have to click at the position it would have had when displayed in tab 1 (where everything could be displayed) and not it's shifted position in tab 2 or 3, that I currently see. So being in tab 3, I see the title of tab 1, click it, and end up in tab 2.
arch64 | awesome | screen | ranger | vim | cmus | weechat | bitlbee
Offline
hi hut, is it possible to paste soft symbol link in ranger? or can you add this feature?
type pl (absolute) or pL (relative)
I think I just came across a tiny bug.[...]
Thanks
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
We needed a wiki,
we got a wiki: http://ourproject.org/moin/projects/ranger
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
I am just finding / trying ranger. It looks great so far. Wiki is a good idea.
Offline
I got it ,thanks for your reply,hut
Offline
Before I tried ranger, I thought 'hey, a terminal based file manager? going to be very slow', yet, I liked the way how you handled it. Just the design of how you go through the different directories while not losing track of which directory you are is genius. However, will keep Pcmanfm as 'backup' till I get very comfortable with ranger.
Great job Mr.Hut. Also, I must say that it looks much better with a black background and colored foreground, but that could be me.
“There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.”-- C.A.R. Hoare
Offline
Hey -- I'm using this code in apps.py, but using the '11l' option, it only show the pictures that are on the current screen (like if 38 are visible on the screen but there are 150 in the directory) -- not all the pictures in the directory. Can anyone see what the issue is?
Thanks!
Scott
class CustomApplications(DefaultApps):
@depends_on('feh')
def app_feh(self, c):
arg = {1: '--bg-scale', 2: '--bg-tile', 3: '--bg-center'}
c.flags += 'd'
if c.mode in arg: # mode 1, 2 and 3 will set the image as the background
return tup('feh', arg[c.mode], c.file.path)
if c.mode is 11 and len(c.files) is 1: # view all files in the cwd
images = (f.basename for f in self.fm.env.cwd.files if f.image)
return tup('feh', '-F', '-d', '--start-at', c.file.basename, *images)
return tup('feh', '-F', '-d', *c)
Last edited by firecat53 (2010-11-20 17:03:18)
Offline
Hey -- I'm using this code in apps.py, but using the '11l' option, it only show the pictures that are on the current screen (like if 38 are visible on the screen but there are 150 in the directory) -- not all the pictures in the directory. Can anyone see what the issue is?
Thanks!
Scottclass CustomApplications(DefaultApps): @depends_on('feh') def app_feh(self, c): arg = {1: '--bg-scale', 2: '--bg-tile', 3: '--bg-center'} c.flags += 'd' if c.mode in arg: # mode 1, 2 and 3 will set the image as the background return tup('feh', arg[c.mode], c.file.path) if c.mode is 11 and len(c.files) is 1: # view all files in the cwd images = (f.basename for f in self.fm.env.cwd.files if f.image) return tup('feh', '-F', '-d', '--start-at', c.file.basename, *images) return tup('feh', '-F', '-d', *c)
The problem was that it only picks the file objects for which file.image is true. file.image is a lazy attribute, which means it's only determined when needed, to save processing power. But it seems that it was too lazy, you had to actually view the file on the screen for it to be determined... I fixed that in git, thanks.
I wonder why I didn't notice this, even though I frequently use this function
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline