Add right/left options to tmux script
This commit is contained in:
parent
f827420ea1
commit
f6050fc08f
|
@ -4,12 +4,22 @@
|
|||
|
||||
Run with `tmux -f tmux.conf`.
|
||||
'''
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
|
||||
from powerline.core import Powerline
|
||||
|
||||
pl = Powerline('tmux')
|
||||
print(pl.renderer.render('n').encode('utf-8'))
|
||||
parser = argparse.ArgumentParser(description='powerline outputter')
|
||||
parser.add_argument('side', nargs='?', default='all', choices=('all', 'left', 'right'))
|
||||
parser.add_argument('--ext', default='tmux')
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = parser.parse_args()
|
||||
pl = Powerline(args.ext)
|
||||
segments = pl.renderer.get_theme().get_segments()
|
||||
if args.side != 'all':
|
||||
segments = [s for s in segments if s['side'] == args.side]
|
||||
print(pl.renderer.render('n', segments=segments).encode('utf-8'))
|
||||
|
|
|
@ -2,4 +2,7 @@ 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)"
|
||||
set-option -g status-left "#(./pl.py left)"
|
||||
set-option -g status-right-length 100
|
||||
set-option -g status-right "#(./pl.py right)"
|
||||
set-option -g status-justify "centre"
|
||||
|
|
Loading…
Reference in New Issue