Skip to content

Instantly share code, notes, and snippets.

@chrisjaure
Created January 10, 2012 20:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisjaure/1591107 to your computer and use it in GitHub Desktop.
Save chrisjaure/1591107 to your computer and use it in GitHub Desktop.
byobu statuses and tweaks
# make window name in byobu show current git branch
# git repo doesn't need to be hard-coded but overwrites custom window name
case "$TERM" in
screen*)
GIT_PS1_SHOWDIRTYSTATE=true
PROMPT_COMMAND='echo -ne "\033k$(__git_ps1)\033"'
;;
esac
# add space between left and right areas
set -g status-left '#(byobu-status tmux_left)['
set -g status-right '] #(byobu-status tmux_right)'
#!/bin/sh -e
# show current git branch and number of dirty files
cd /var/www
BRANCHNAME=`git symbolic-ref HEAD`
SHORTBRANCHNAME=`git for-each-ref --format='%(refname:short)' $BRANCHNAME`
echo "#[default]#[fg=#8F9D6A,bold]$SHORTBRANCHNAME#[default]"
DIRTYCOUNT=`git status --porcelain -uno | wc -l`
if [ $DIRTYCOUNT != "0" ]; then
echo "#[fg=#ff0000]*$DIRTYCOUNT#[default]"
fi
@dustinkirkland
Copy link

Nice :-) I just committed your whitespace changes to lp:byobu's usr/share/byobu/profiles/tmux.

@chrisjaure
Copy link
Author

Haha, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment