summary refs log tree commit diff stats
path: root/ranger/gui/wtitlebar.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/gui/wtitlebar.py')
-rw-r--r--ranger/gui/wtitlebar.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/ranger/gui/wtitlebar.py b/ranger/gui/wtitlebar.py
index 2ac8ae65..b95311dd 100644
--- a/ranger/gui/wtitlebar.py
+++ b/ranger/gui/wtitlebar.py
@@ -1,12 +1,33 @@
-import curses
+import curses, socket
 from ranger.gui.widget import Widget as SuperClass
 
+
 class WTitleBar(SuperClass):
 	def feed_env(self, env):
 		self.pathway = env.pathway
+		self.cf = env.cf
 
 	def draw(self):
 		self.win.move(self.y, self.x)
+
+		try:
+			self.color('in_titlebar', 'hostname')
+			self.win.addnstr(socket.gethostname(), self.wid)
+		except:
+			pass
+
 		for path in self.pathway:
 			currentx = self.win.getyx()[1]
-			self.win.addnstr(path.basename + ' / ', (self.wid - currentx))
+
+			if path.islink:
+				self.color('in_titlebar', 'link')
+			else:
+				self.color('in_titlebar', 'directory')
+
+			self.win.addnstr(path.basename + '/', max(self.wid - currentx, 0))
+		if self.cf is not None:
+			currentx = self.win.getyx()[1]
+			self.color('in_titlebar', 'file')
+			self.win.addnstr(self.cf.basename, max(self.wid - currentx, 0))
+		self.color_reset()
+