summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2014-08-26 22:43:28 +0200
committerhut <hut@lepus.uberspace.de>2014-08-26 22:58:57 +0200
commit207cafb045e8288b0f91df1528b9edb2a2c31971 (patch)
treeeb43936b88311e98c796a023f2c6aaa5117598aa /ranger
parentdc4216a55e80361177675118944a69514618f6c9 (diff)
downloadranger-207cafb045e8288b0f91df1528b9edb2a2c31971.tar.gz
container.directory: implemented random sorting
Diffstat (limited to 'ranger')
-rw-r--r--ranger/config/rc.conf3
-rw-r--r--ranger/container/directory.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index 5b274657..b2cc9307 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -147,7 +147,7 @@ set autoupdate_cumulative_size false
 # Turning this on makes sense for screen readers:
 set show_cursor false
 
-# One of: size, basename, mtime, type
+# One of: size, natural, basename, atime, ctime, mtime, type, random
 set sort natural
 
 # Additional sorting options
@@ -373,6 +373,7 @@ map <a-9>     tab_open 9
 
 # Sorting
 map or toggle_option sort_reverse
+map oz set sort=random
 map os chain set sort=size;      set sort_reverse=False
 map ob chain set sort=basename;  set sort_reverse=False
 map on chain set sort=natural;   set sort_reverse=False
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index 07b2192d..de69c467 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -2,6 +2,7 @@
 # This software is distributed under the terms of the GNU GPL version 3.
 
 import os.path
+import random
 import re
 
 from os import stat as os_stat, lstat as os_lstat
@@ -81,6 +82,7 @@ class Directory(FileSystemObject, Accumulator, Loadable):
         'mtime': lambda path: -(path.stat and path.stat.st_mtime or 1),
         'ctime': lambda path: -(path.stat and path.stat.st_ctime or 1),
         'atime': lambda path: -(path.stat and path.stat.st_atime or 1),
+        'random': lambda path: random.random(),
         'type': lambda path: path.mimetype or '',
     }
 
basic design' href='/akspecs/aerc/commit/widgets/msglist.go?h=0.4.0&id=0f8b7a1203309ebec0dc78baf3f195671eadac2d'>0f8b7a1 ^
fcdcd32 ^
0f8b7a1 ^
9570f4b ^



0f8b7a1 ^








0f8b7a1 ^
5685a17 ^
0f8b7a1 ^


e780c6e ^
0f8b7a1 ^

f1698a3 ^

9570f4b ^







0f8b7a1 ^


11f0a72 ^
0f8b7a1 ^

f81e4bd ^
0f8b7a1 ^
f81e4bd ^

f1698a3 ^
de36484 ^
0f8b7a1 ^






de36484 ^




5f651b3 ^

32f970e ^
84965d6 ^
0f8b7a1 ^
5f651b3 ^
f1698a3 ^
4465646 ^

5f651b3 ^


c610c3c ^
5f651b3 ^






de36484 ^
dc4c36a ^


fca7321 ^


da62f63 ^


fca7321 ^
0f8b7a1 ^



f81e4bd ^
9570f4b ^
8a42dfc ^

0f8b7a1 ^
f1698a3 ^
0f8b7a1 ^



0f8b7a1 ^

e780c6e ^



312a53e ^
f1698a3 ^
312a53e ^

f81e4bd ^
f1698a3 ^
f81e4bd ^
1303273 ^



f81e4bd ^

408a9e7 ^
1303273 ^

f81e4bd ^

408a9e7 ^
fa5d8d7 ^

f81e4bd ^
312a53e ^
f1698a3 ^
91a75cd ^
312a53e ^


ef6178a ^
f9251c2 ^
52a97c0 ^
52a97c0 ^
a15ea01 ^
0f8b7a1 ^

f81e4bd ^
f1698a3 ^
0f8b7a1 ^




24daef8 ^
9570f4b ^



312a53e ^
a15ea01 ^
312a53e ^

3cd0d5b ^
f1698a3 ^
f81e4bd ^
3cd0d5b ^

cce7cb4 ^
f1698a3 ^
f81e4bd ^

312a53e ^

13ba53c ^
f1698a3 ^
32f970e ^
bf02ad3 ^
13ba53c ^

32f970e ^
f1698a3 ^
a275f65 ^
f81e4bd ^
0b26241 ^

52a97c0 ^
bf02ad3 ^

52a97c0 ^
bf02ad3 ^

52a97c0 ^


24daef8 ^

9570f4b ^





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
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