Skip to content

Commit 07064d5

Browse files
Merge pull request #1053 from JuanPerdomo00/main
Add: View user and host in Linux :D
2 parents d2ef55d + 0bff7b9 commit 07064d5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""Shows User and Hostname in linux
2+
3+
contributed by `Jakepys <https://github.com/JuanPerdomo00>`
4+
5+
- with much love :)
6+
"""
7+
8+
import core.module
9+
import core.widget
10+
import getpass
11+
import platform
12+
13+
14+
class Module(core.module.Module):
15+
def __init__(self, config, theme):
16+
super().__init__(config, theme, core.widget.Widget(self.full_text))
17+
self.__username = getpass.getuser()
18+
self.__hostname = platform.node()
19+
20+
def full_text(self, widgets):
21+
return "{}/{}".format(self.__hostname, self.__username)

0 commit comments

Comments
 (0)