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')
156' href='#n156'>156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278