homes/common/.local/bin/powerline

26 lines
722 B
Text
Raw Normal View History

2013-05-02 18:11:33 +02:00
#!/usr/bin/python
# vim:fileencoding=utf-8:noet
'''Powerline prompt and statusline script.'''
import sys
import os
try:
from powerline.shell import ShellPowerline, get_argparser
except ImportError:
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from powerline.shell import ShellPowerline, get_argparser # NOQA
if __name__ == '__main__':
args = get_argparser(description=__doc__).parse_args()
powerline = ShellPowerline(args, run_once=True)
rendered = powerline.render(
width=args.width,
side=args.side,
segment_info={'args': args, 'environ': os.environ},
)
try:
sys.stdout.write(rendered)
except UnicodeEncodeError:
sys.stdout.write(rendered.encode('utf-8'))