diff --git a/powerline/ext/terminal/segments/__init__.py b/powerline/ext/terminal/segments/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/powerline/ext/terminal/segments/core.py b/powerline/ext/terminal/segments/core.py new file mode 100644 index 00000000..c42c5faf --- /dev/null +++ b/powerline/ext/terminal/segments/core.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- + +import os + + +def user_name(): + user_name = os.environ.get('USER') + return { + 'contents': user_name, + 'highlight': 'user_name' if user_name != 'root' else ['user_name_root', 'user_name'], + } diff --git a/powerline/ext/tmux/segments/__init__.py b/powerline/ext/tmux/segments/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/powerline/ext/tmux/segments/core.py b/powerline/ext/tmux/segments/core.py new file mode 100644 index 00000000..c42c5faf --- /dev/null +++ b/powerline/ext/tmux/segments/core.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- + +import os + + +def user_name(): + user_name = os.environ.get('USER') + return { + 'contents': user_name, + 'highlight': 'user_name' if user_name != 'root' else ['user_name_root', 'user_name'], + } diff --git a/powerline/themes/terminal/default.json b/powerline/themes/terminal/default.json new file mode 100644 index 00000000..05013239 --- /dev/null +++ b/powerline/themes/terminal/default.json @@ -0,0 +1,10 @@ +{ + "name": "default", + "segments": { + "left": [ + { + "name": "user_name" + } + ] + } +} diff --git a/powerline/themes/tmux/default.json b/powerline/themes/tmux/default.json new file mode 100644 index 00000000..05013239 --- /dev/null +++ b/powerline/themes/tmux/default.json @@ -0,0 +1,10 @@ +{ + "name": "default", + "segments": { + "left": [ + { + "name": "user_name" + } + ] + } +}