Skip to content

Instantly share code, notes, and snippets.

@BielStela
Last active March 5, 2019 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BielStela/dc68729e57d693adb6f6cf0d75b2152b to your computer and use it in GitHub Desktop.
Save BielStela/dc68729e57d693adb6f6cf0d75b2152b to your computer and use it in GitHub Desktop.
tmux powerline sync segment
# config_files/colorschemes/default.json
...
"synchronized_panes": { "fg": "red", "bg": "gray0", "attrs": [] }
...
# 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"
# 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