You are not logged in.
@bslackr, the same for me.
Here is my python script to replace rifle_sxiv.sh. Obviously, you should edit the last line to make yourself comfortable.#!/usr/bin/env python3 from os import listdir from os import path from sys import argv from subprocess import Popen filename = argv[1] extensions = {'.jpg', '.jpeg', '.png', '.gif', '.tif'} images = [] basename = path.basename(filename) dirname = path.dirname(filename) for item in listdir(dirname): extension = path.splitext(item)[1] if extension.lower() in extensions: images.append(item) images.sort(key=str.lower) position = str(images.index(basename) + 1) images = [path.join(dirname, filename) for filename in images] Popen(['sxiv', '-Fqdg', '+0+12', '-n', position] + images)
Thank you for this script. Needed this in rifle.conf for it to work:
mime ^image, has sxiv, X, flag f = /path/to/rifle_sxiv.py "`realpath -- "$@"`"
Last edited by archman-cro (2013-02-23 22:22:45)
Offline
@hut, my congratulations on the ranger 1.6 release! I can hardly imagine my routine without this eye candy, so thank you very much!
@archman-cro, glad you liked it. Of course, this is some kind of 'temporary solutions' untill sxiv gets more integration with ranger's sortings and filters (I hope so).
Maybe some zsh-lovers are missing their hashes (short aliases to often used directories), so they can add this modified version of default ':cd' command to commands.py:
class cd_zsh(cd):
def execute(self):
if self.arg(1) == '-r':
import os.path
self.shift()
destination = os.path.realpath(self.rest(1))
if os.path.isfile(destination):
destination = os.path.dirname(destination)
else:
# do not interpret destination that starts with '/'
if self.rest(1).startswith('/'):
destination = self.rest(1)
else:
from subprocess import check_output, CalledProcessError, STDOUT
try:
destination = check_output(['print ~{}'.format(self.rest(1).lstrip('~'))],
shell=True,executable='/usr/bin/zsh',stderr=STDOUT).decode().strip()
except CalledProcessError:
# to walk into subdirs
destination = self.rest(1)
if not destination:
destination = '~'
if destination == '-':
self.fm.enter_bookmark('`')
else:
self.fm.cd(destination)
Now, if you have hash 'work', just run command ':cd_zsh work' (even without tilde symbol) to get the destination. Please, keep in mind that current realisation of the command evaluates hashes before subdirectories, so if you have subdirectory 'work', the hash destination will take the priority.
Offline
Gotta ask. sorry.
is RANGER 1.6.x just as compatible with freeBSD as 1.5.5 is?
Happily running the FreeBSD port. Love to know as 1.6.x is awesome.
Any issues expected?
many thanks.
Last edited by tweed (2013-02-25 10:50:57)
Offline
Hello!
Does new cool :scout command enterpret '^' and '$' even without -r flag?
1. Create two files: 'hello', 'hello^hello'.
2. Do ':scout -aet ^hello' (no action, but I expected the 'hello^hello' file to be opened).
3. Do ':scout -aet ^hello$' (have file 'hello' opened).
Last edited by loop (2013-02-25 11:53:27)
Offline
Hello!
Does new cool :scout command enterpret '^' and '$' even without -r flag?1. Create two files: 'hello', 'hello^hello'.
2. Do ':scout -aet ^hello' (no action, but I expected the 'hello^hello' file to be opened).
3. Do ':scout -aet ^hello$' (have file 'hello' opened).
Yes, that's a feature .
Gotta ask. sorry.
is RANGER 1.6.x just as compatible with freeBSD as 1.5.5 is?
Happily running the FreeBSD port. Love to know as 1.6.x is awesome.Any issues expected?
many thanks.
ranger 1.6 is even more compatible with fbsd than 1.5. The hidden dependencies to "bash", "setsid" and GNU cp/mv have been removed. BTW there is a mailing list where you can ask questions about FBSD without feeling out of place
Since the latest update Ranger keeps opening text files using nano, no matter what $EDITOR is or what apps.py/rifle.sh set. Is this a known issue ?
Works for me. Either your configs are bad, out of date or you don't set $EDITOR properly.
Last edited by hut (2013-02-25 22:17:06)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Since the latest update Ranger keeps opening text files using nano, no matter what $EDITOR is or what apps.py/rifle.sh set. Is this a known issue ?
i noticed this too, also when I uninstaled it vim would not run by default it would ask run with... here is what worked for me in /etc/bash.bashrc
export visual=vim
export editor=vim
--------------------------------------
alcoves wonder creates the wonder unto the ages; never lose that.
Offline
Yes, that's a feature .
OK, then.
export editor=vim
Try to change it like this:
export EDITOR=vim
And then before launch ranger, try to test the terminal with the command 'echo $EDITOR'.
Offline
it seems fine to me comes back as vim. I dont think it is case sensitive.
:edit:~> this is what worked for me,and thus not an issue(for me).
Last edited by dag (2013-02-26 07:04:35)
--------------------------------------
alcoves wonder creates the wonder unto the ages; never lose that.
Offline
Since the latest update Ranger keeps opening text files using nano, no matter what $EDITOR is or what apps.py/rifle.sh set. Is this a known issue ?
I have the same problem if I use my keyboard shortcut to run ranger. I've tried both
xfce4-terminal -e ranger
and
xterm -bg black -fg white -e ranger
If, however, I simply fire up a terminal and then run ranger from the prompt everything works as expected.
Offline
If, however, I simply fire up a terminal and then run ranger from the prompt everything works as expected.
From your statements, I presume you have a line
export EDITOR=placeholder
in your ~/.bashrc.
Then this file is not sourced when you run ranger with your shortcuts (this is normal behaviour).
You have plenty of possible solutions to remedy this. You can:
Move the lines export … in a file sourced ahead of where you run your programs (~/.xinitrc or some DE specific files).
Store the environment variables system-wide, by displacing the same lines in /etc/environment (keeping only the part EDITOR=foo). Some may find this ugly (personally I don't care).
Specify the environment variable in your shortcut
EDITOR=foo xfce4-terminal -e ranger # if the command is interpreted by a shell
sh -c 'EDITOR=foo xfce4-terminal -e ranger' # if it is not
Force the shell rc file to be sourced (generally by adding -i to the options passed on shell invocation)
bash -ic 'xfce4-terminal -e ranger'
Offline
I knew the issue was .bashrc not being sourced but I didn't know how to fix it, so thank you PotatoesMaster. Ranger now works as expected from the keyboard shortcut. Curiously everything worked before the upgrade to version 1.6.
Offline
With the latest update, suddenly images open differently. First with the wrong program, then opening only one instead of being able to scroll through the directory (in feh or sxiv). Obviously something changed. What do I need to change in my config to get the old behaviour back?
Offline
With the latest update, suddenly images open differently. First with the wrong program, then opening only one instead of being able to scroll through the directory (in feh or sxiv). Obviously something changed. What do I need to change in my config to get the old behaviour back?
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
ibrunton wrote:With the latest update, suddenly images open differently. First with the wrong program, then opening only one instead of being able to scroll through the directory (in feh or sxiv). Obviously something changed. What do I need to change in my config to get the old behaviour back?
Any idea how I'd rewrite that for feh instead of sxiv? Or is there a simpler method for feh?
EDIT: Never mind, I figured it out. The rewrite was simpler than I thought.
Last edited by ibrunton (2013-02-27 21:17:42)
Offline
How can you filter case insensitive? huts solution from #1236 crashes ranger now. (AttributeError: '_sre.SRE_Pattern' object has no attribute 'lower')
Offline
How can you filter case insensitive? huts solution from #1236 crashes ranger now. (AttributeError: '_sre.SRE_Pattern' object has no attribute 'lower')
With the very new ranger-git you can use :scout command which has many useful flags (case switchers are included):
""":scout [-FLAGS] <string>
Swiss army knife command for searching, traveling and filtering files.
"""
AUTO_OPEN = 'a'
OPEN_ON_ENTER = 'e'
FILTER = 'f'
SM_GLOB = 'g'
IGNORE_CASE = 'i'
KEEP_OPEN = 'k'
SM_LETTERSKIP = 'l'
MARK = 'm'
UNMARK = 'M'
PERM_FILTER = 'p'
SM_REGEX = 'r'
SMART_CASE = 's'
AS_YOU_TYPE = 't'
INVERT = 'v'
Offline
How can you filter case insensitive? huts solution from #1236 crashes ranger now. (AttributeError: '_sre.SRE_Pattern' object has no attribute 'lower')
In ranger-git, you can use ":filter -i" for case-insensitive filtering.
EDIT: By the way, many questions that are asked here are already answered in the FAQ on the website http://ranger.nongnu.org/documentation.html and on the mailing list: https://lists.nongnu.org/mailman/listinfo/ranger-users
So please, before asking, take a look at the FAQ and try searching for it in the mailing list archive first.
ALSO: Read the FAQ when ranger crashes after upgrading!!1
Last edited by hut (2013-03-01 18:24:46)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Hut, Hi I needed to find out if you can use hex values somehow with the ranger theme?
thanks
--jerry
Arch Awesome, Ranger & Vim the coding triple threat.
Offline
Nope Just the numbers that this script prints.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Ok got it thanks again
--jerry
Arch Awesome, Ranger & Vim the coding triple threat.
Offline
Hi hut, I have a problem with ranger-git. Just checked out the latest git, it's still there:
When I select a directory with :find $dirname and ranger cd's into this directory automatically, because it's the only entry with this name, I cannot get to the newest entry in this directory typing n, nothing happens. Everything's fine if I scroll to the directory and enter it manually.
Last edited by Army (2013-03-03 20:51:49)
Offline
Hi hut, I have a problem with ranger-git. Just checked out the latest git, it's still there:
When I select a directory with :find $dirname and ranger cd's into this directory automatically, because it's the only entry with this name, I cannot get to the newest entry in this directory typing n, nothing happens. Everything's fine if I scroll to the directory and enter it manually.
What the "n" key does depends on the last searching task you did. If you used ":search" or ":search_inc" or ":find" (since recently), it will find the next file that matches the pattern. If you pressed "cc", it will find the newest file. If you pressed "cs" it will find the largest file, and so on.
So just press "cc" to get back into the "find newest file" mode.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Ok, thanks! Seems like I have to learn ranger again
Offline
@hut @archman-cro Thank you very much, now sxiv is working flawlessly!
Archlinux + AwesomeWM
Offline