summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/colorschemes/default.py4
-rw-r--r--ranger/fsobject/fsobject.py5
-rw-r--r--ranger/gui/context.py2
-rw-r--r--ranger/gui/widgets/browsercolumn.py3
4 files changed, 11 insertions, 3 deletions
diff --git a/ranger/colorschemes/default.py b/ranger/colorschemes/default.py
index 03173a33..335fdf53 100644
--- a/ranger/colorschemes/default.py
+++ b/ranger/colorschemes/default.py
@@ -50,8 +50,10 @@ class Default(ColorScheme):
 			if context.socket:
 				fg = magenta
 				attr |= bold
-			if context.fifo:
+			if context.fifo or context.device:
 				fg = yellow
+				if context.device:
+					attr |= bold
 			if context.link:
 				fg = context.good and cyan or magenta
 			if context.tag_marker and not context.selected:
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index 1ab3addd..5dbad537 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -41,6 +41,7 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 	loaded = False
 	runnable = False
 	islink = False
+	is_device = False
 	readlink = None
 	stat = None
 	infostring = None
@@ -168,7 +169,9 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 			self.islink = False
 			self.accessible = False
 		else:
-			self.islink = stat.S_ISLNK(self.stat.st_mode)
+			mode = self.stat.st_mode
+			self.islink = stat.S_ISLNK(mode)
+			self.is_device = bool(stat.S_ISCHR(mode) or stat.S_ISBLK(mode))
 			self.accessible = True
 
 		if self.accessible and os.access(self.path, os.F_OK):
diff --git a/ranger/gui/context.py b/ranger/gui/context.py
index d4c1c94d..585dd674 100644
--- a/ranger/gui/context.py
+++ b/ranger/gui/context.py
@@ -17,7 +17,7 @@ CONTEXT_KEYS = ['reset', 'error',
 		'in_browser', 'in_statusbar', 'in_titlebar', 'in_console',
 		'in_pager', 'in_taskview',
 		'directory', 'file', 'hostname',
-		'executable', 'media', 'link', 'fifo', 'socket',
+		'executable', 'media', 'link', 'fifo', 'socket', 'device',
 		'video', 'audio', 'image', 'media', 'document', 'container',
 		'selected', 'empty', 'main_column', 'message', 'background',
 		'good', 'bad',
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index 8301d26a..63bee33d 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -173,6 +173,7 @@ class BrowserColumn(Pager):
 				and target.is_file \
 				and target.accessible \
 				and target.stat \
+				and not target.is_device \
 				and not target.stat.st_mode & stat.S_IFIFO):
 			return False
 
@@ -280,6 +281,8 @@ class BrowserColumn(Pager):
 					this_color.append('fifo')
 				if stat.S_ISSOCK(mode):
 					this_color.append('socket')
+				if drawn.is_device:
+					this_color.append('device')
 
 			if self.env.copy and drawn in self.env.copy:
 				this_color.append('cut' if self.env.cut else 'copied')
rtik.com> 2020-07-25 15:35:43 -0700 committer Kartik Agaram <vc@akkartik.com> 2020-07-25 15:35:43 -0700 6674' href='/akkartik/mu/commit/stats.txt?h=hlt&id=de0e57d3ced985040cf31919a23d79fd7276f1f9'>de0e57d3 ^
426fcd3e ^
11b4bd3e ^
d496dd0b ^
fd4d7b38 ^
63a4fd03 ^
be8799b7 ^
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




                                                              






                                        

                                        
                                        
 




                                                                        








                                        
                                        
 




                                                    








                                         
                                         

                          












                                                                                                                          
                                            
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
                                                                                                   
 
              
541eca84ea654bcdea5bca004bbf'>^
839dc88d ^




46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^



4557b073 ^
839dc88d ^




46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^



4557b073 ^
839dc88d ^




46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^



4557b073 ^
839dc88d ^




46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^



4557b073 ^
839dc88d ^




46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^




4557b073 ^
839dc88d ^





46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^



4557b073 ^
c25d9aa4 ^


839dc88d ^
29ab4397 ^
46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^
4557b073 ^
29ab4397 ^
a8adfff3 ^

839dc88d ^
46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^





4557b073 ^
839dc88d ^

15ae0717 ^
c25d9aa4 ^
839dc88d ^


46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^



4557b073 ^
d373c008 ^

839dc88d ^

33fdc60b ^
46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^



4557b073 ^
33fdc60b ^



294a1520 ^
46bb1d31 ^
b6c7f481 ^
5bd6dc8e ^




4557b073 ^
294a1520 ^




a8adfff3 ^

fd91f7f6 ^













4fe73d47 ^
a8adfff3 ^

fd91f7f6 ^


e97b446a ^
fd91f7f6 ^
e97b446a ^
915aaa21 ^



a8adfff3 ^
e97b446a ^
a8adfff3 ^


099f0d5d ^
fd91f7f6 ^
6ecddbaa ^
099f0d5d ^
915aaa21 ^



099f0d5d ^




6ecddbaa ^
fd91f7f6 ^
6ecddbaa ^

915aaa21 ^



6ecddbaa ^




6ecddbaa ^
fd91f7f6 ^
5030d67c ^
dac83357 ^




46bb1d31 ^
dac83357 ^

04a5722e ^
51a20da6 ^
04a5722e ^
dac83357 ^


46bb1d31 ^
dac83357 ^

c086f1be ^
51a20da6 ^
29ec821c ^
fd91f7f6 ^
dac83357 ^

fd91f7f6 ^
dac83357 ^

dbb380b8 ^
ddb8334f ^

4d20c9ee ^
ddb8334f ^




839dc88d ^
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
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324