summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-04 23:37:52 +0200
committerhut <hut@lavabit.com>2010-04-04 23:37:52 +0200
commit0bec64f668d5f133bb6cc64f1e537272398f4b19 (patch)
tree328940a8593a1930a6e850dd3abdf14ea901e85b
parente92d708ff4151e4b3ebb5815b6801a7adcad6dac (diff)
downloadranger-0bec64f668d5f133bb6cc64f1e537272398f4b19.tar.gz
added colors for pipes and sockets
-rw-r--r--ranger/colorschemes/default.py7
-rw-r--r--ranger/gui/context.py2
-rw-r--r--ranger/gui/widgets/browsercolumn.py10
3 files changed, 15 insertions, 4 deletions
diff --git a/ranger/colorschemes/default.py b/ranger/colorschemes/default.py
index 9d07fd10..fbfaf479 100644
--- a/ranger/colorschemes/default.py
+++ b/ranger/colorschemes/default.py
@@ -43,9 +43,14 @@ class Default(ColorScheme):
 				attr |= bold
 				fg = blue
 			elif context.executable and not \
-					any((context.media, context.container)):
+					any((context.media, context.container,
+						context.fifo, context.socket)):
 				attr |= bold
 				fg = green
+			if context.socket:
+				fg = magenta
+			if context.fifo:
+				fg = yellow
 			if context.link:
 				fg = context.good and cyan or magenta
 			if context.tag_marker and not context.selected:
diff --git a/ranger/gui/context.py b/ranger/gui/context.py
index d31124ca..453eb9dc 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',
+		'executable', 'media', 'link', 'fifo', 'socket',
 		'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 44d1e579..9a7dfe9c 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -266,8 +266,14 @@ class BrowserColumn(Pager):
 			else:
 				this_color.append('file')
 
-			if drawn.stat is not None and drawn.stat.st_mode & stat.S_IXUSR:
-				this_color.append('executable')
+			if drawn.stat:
+				mode = drawn.stat.st_mode
+				if mode & stat.S_IXUSR:
+					this_color.append('executable')
+				if stat.S_ISFIFO(mode):
+					this_color.append('fifo')
+				if stat.S_ISSOCK(mode):
+					this_color.append('socket')
 
 			if drawn.islink:
 				this_color.append('link')