Last active
March 5, 2019 14:21
-
-
Save BielStela/dc68729e57d693adb6f6cf0d75b2152b to your computer and use it in GitHub Desktop.
tmux powerline sync segment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config_files/colorschemes/default.json | |
... | |
"synchronized_panes": { "fg": "red", "bg": "gray0", "attrs": [] } | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# segments/tmux.py | |
def synchronized_panes(pl): | |
'''Return "SYNC" if the panes of the current window are synchronized | |
''' | |
synced_output = get_tmux_output(pl, 'display-message', '-p', '#{pane_synchronized}') | |
if not synced_output: | |
return None | |
synced = synced_output.rstrip().split('\n')[0] | |
return None if synced == "0" else "SYNC" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config_files/themes/tmux/default.json | |
"right": [ | |
{ | |
"function": "powerline.segments.tmux.synchronized_panes", | |
"priority": 50 | |
}, | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment