diff --git a/examples/tmux/pl.py b/powerline/ext/tmux/powerline_status.py similarity index 59% rename from examples/tmux/pl.py rename to powerline/ext/tmux/powerline_status.py index d816f76d..687a1cbd 100755 --- a/examples/tmux/pl.py +++ b/powerline/ext/tmux/powerline_status.py @@ -1,18 +1,17 @@ #!/usr/bin/env python2 # -*- coding: utf-8 -*- -'''Powerline tmux statusline example. - -Run with `tmux -f tmux.conf`. -''' +'''Powerline tmux statusline.''' import argparse -import os -import sys -sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +try: + from powerline.core import Powerline +except ImportError: + import os + import sys + sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))) + from powerline.core import Powerline -from powerline.core import Powerline - -parser = argparse.ArgumentParser(description='powerline outputter') +parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('side', nargs='?', default='all', choices=('all', 'left', 'right')) parser.add_argument('--ext', default='tmux') diff --git a/examples/tmux/tmux.conf b/powerline/ext/tmux/tmux.conf similarity index 69% rename from examples/tmux/tmux.conf rename to powerline/ext/tmux/tmux.conf index 78ebb3fa..8267536d 100644 --- a/examples/tmux/tmux.conf +++ b/powerline/ext/tmux/tmux.conf @@ -2,9 +2,9 @@ set-option -g status on set-option -g status-interval 2 set-option -g status-utf8 on set-option -g status-left-length 100 -set-option -g status-left "#(./pl.py left)" +set-option -g status-left "#(./powerline_status.py left)" set-option -g status-right-length 100 -set-option -g status-right "#(./pl.py right)" +set-option -g status-right "#(./powerline_status.py right)" set-option -g status-justify "centre" set-option -g status-bg "colour235" set-option -g status-fg "colour249"