diff options
author | Cody Hiar <codyfh@gmail.com> | 2017-04-20 19:37:10 -0600 |
---|---|---|
committer | Cody Hiar <codyfh@gmail.com> | 2017-04-20 19:37:10 -0600 |
commit | 2dd809781527976307b47a598887062047e202c9 (patch) | |
tree | 8b29daba2c1ef072f380ef530b7e7d9256e43eb3 /powerline.sh | |
parent | baeb698bb006193559fc5aa1901180a3ccc73b7a (diff) |
Making tmux configuration much easier to manage
Diffstat (limited to 'powerline.sh')
-rwxr-xr-x | powerline.sh | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/powerline.sh b/powerline.sh index 92c0414..8baf3f2 100755 --- a/powerline.sh +++ b/powerline.sh @@ -1,22 +1,17 @@ #!/usr/bin/env bash +RS="" +LS="" -export TMUX_POWERLINE_DIR_HOME="$(dirname $0)" - -source "${TMUX_POWERLINE_DIR_HOME}/config/helpers.sh" -source "${TMUX_POWERLINE_DIR_HOME}/config/paths.sh" -source "${TMUX_POWERLINE_DIR_HOME}/config/shell.sh" -source "${TMUX_POWERLINE_DIR_HOME}/config/defaults.sh" - -source "${TMUX_POWERLINE_DIR_LIB}/arg_processing.sh" -source "${TMUX_POWERLINE_DIR_LIB}/formatting.sh" -source "${TMUX_POWERLINE_DIR_LIB}/muting.sh" -source "${TMUX_POWERLINE_DIR_LIB}/powerline.sh" -source "${TMUX_POWERLINE_DIR_LIB}/rcfile.sh" - -if ! powerline_muted "$1"; then - process_settings - check_arg_side "$1" - print_powerline "$1" +if [[ "$1" == "left" ]]; then + echo -n "#[fg=colour235, bg=colour142] $(tmux display-message -p '#S') #[fg=colour142, bg=colour241]$LS#[default]" + echo -n "#[fg=colour223, bg=colour241] $(hostname) #[fg=colour241, bg=colour235]$LS#[default]" fi -exit 0 +if [[ "$1" == "right" ]]; then + IP_ADDRESS=$(ip addr show | grep "inet[^6]" | grep -v "\(127.0.0.1\|docker\)" | tr -s ' ' | cut -d ' ' -f3 | cut -d '/' -f1) + echo -n "#[fg=colour235, bg=colour241]$RS#[fg=colour223, bg=colour241] ⓛ $IP_ADDRESS" + WAN_IP=$(curl --max-time 2 -s http://whatismyip.akamai.com/) + echo -n " ⓦ $WAN_IP #[default]" + DATE=$(date +"%b %d, %H:%M") + echo -n "#[fg=colour241, bg=colour142]$RS#[fg=colour235] $DATE #[default]" +fi |