summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-05-26 22:47:27 +0200
committerhut <hut@lavabit.com>2010-05-26 22:47:27 +0200
commitd383965f431ee738a6db2da35d4092dfb108b739 (patch)
tree377f788c3f0e543462bdf00ca70a7095745770b9 /ranger
parentb4f7187f0e05495c2cf902a367f14002d5e50821 (diff)
downloadranger-d383965f431ee738a6db2da35d4092dfb108b739.tar.gz
defaults.apps: simplify code for feh
Diffstat (limited to 'ranger')
-rw-r--r--ranger/defaults/apps.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py
index 97498a3e..cd745ff8 100644
--- a/ranger/defaults/apps.py
+++ b/ranger/defaults/apps.py
@@ -137,22 +137,10 @@ class CustomApplications(Applications):
 
 		c.flags += 'd'
 
-		if c.mode in arg:
+		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:
-			if len(c.files) > 1:
-				return tup('feh', *c)
-			else:
-				from collections import deque
-
-				# Open all image files in feh
-				directory = self.fm.env.get_directory(c.file.dirname)
-				images = [f.path for f in directory.files if f.image]
-				position = images.index(c.file.path)
-				deq = deque(images)
-				deq.rotate(-position)
-
-				return tup('feh', *deq)
+		if c.mode is 11 and len(c.files) is 1: # view all files in the cwd
+			return tup('feh', self.fm.env.cwd.path, '--start-at', *c)
 		return tup('feh', *c)
 
 	@depends_on('aunpack')
ighlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
(use-package projectile
  :diminish)

(prelude-require-packages '(perspective persp-projectile))
(use-package persp-projectile
  :init (persp-mode))

(provide 'init-projectile)