summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/gui/widgets/titlebar.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py
index cb6e8cdd..e1be8e97 100644
--- a/ranger/gui/widgets/titlebar.py
+++ b/ranger/gui/widgets/titlebar.py
@@ -54,20 +54,14 @@ class TitleBar(Widget):
 		self.result = bar.combine()
 
 	def _get_left_part(self, bar):
-		import socket, os, pwd
-
-		try:
-			username = pwd.getpwuid(os.geteuid()).pw_name
-		except:
-			username = "???"
-		if username == 'root':
+		if self.env.username == 'root':
 			clr = 'bad'
 		else:
 			clr = 'good'
 
-		bar.add(username, 'hostname', clr, fixedsize=True)
+		bar.add(self.env.username, 'hostname', clr, fixedsize=True)
 		bar.add('@', 'hostname', clr, fixedsize=True)
-		bar.add(socket.gethostname(), 'hostname', clr, fixedsize=True)
+		bar.add(self.env.hostname, 'hostname', clr, fixedsize=True)
 
 		for path in self.env.pathway:
 			if path.islink:
figure.ac' href='/danisanti/profani-tty/commit/.gitignore?id=cf6da8a44cd04ce3a7799f7b5e2ac8491e62fcda'>cf6da8a4 ^
30ca6cac ^



2655d9e8 ^

30ca6cac ^
376804be ^
30ca6cac ^
30ca6cac ^
28f5cdf7 ^
3134a7b6 ^
0a42be57 ^
37f91427 ^
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