Skip to content

Instantly share code, notes, and snippets.

@AdoPi
Created January 30, 2017 23:15
Show Gist options
  • Save AdoPi/daf0da4e7bf3d3c6dce64bb356f5cda4 to your computer and use it in GitHub Desktop.
Save AdoPi/daf0da4e7bf3d3c6dce64bb356f5cda4 to your computer and use it in GitHub Desktop.
Tmux conf 2016 [macOs]
# Github : @AdoPi
###########################################
# OSX - Zelda battery indicator by @AdoPi #
###########################################
zmodload zsh/mathfunc
# HEART CONSTANTS
# 💙 💜 💛 💚 ♡ ♥ ❤
NB_LIVES=3
LIVES_COLOR=colour134 #134
DEAD_COLOR=colour221 #221
DEAD_ICON="♡"
LIFE_ICON="♡"
#get battery info
battery_percent=`pmset -g batt | grep -o "\d\d\?%" | sed 's/%//'`
#get number of lives left
((lives=$battery_percent/(100/NB_LIVES)))
lives=$((int(rint($lives))))
# display lives (heart)
for ((i = 0; i < $lives; i++)); echo -n "#[fg=$LIVES_COLOR]$LIFE_ICON ";
for ((i = $lives; i < $NB_LIVES; i++)); echo -n "#[fg=$DEAD_COLOR]$DEAD_ICON ";
# Github : @AdoPi
#get the current kanji day
set -A days 月 火 水 木 金 土 日
index=$(date +%u)
echo ${days[$index]}
# Github : @AdoPi
##############################
## TMUX THEME
##############################
tm_icon="#(zsh ~/.tmux/kanji_day.zsh)"
tm_color_active=colour213
tm_color_inactive=colour241
tm_color_feature=colour4
tm_color_music=colour203
# separators
tm_separator_left_bold="◀"
tm_separator_left_thin="❮"
tm_separator_right_bold="▶"
km_separator_right_thin="❯"
set -g status-left-length 32
set -g status-right-length 150
set -g status-interval 5
# default statusbar colors
# set-option -g status-bg colour0
set-option -g status-fg $tm_color_active
set-option -g status-bg default
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg $tm_color_inactive
set-window-option -g window-status-bg default
set -g window-status-format "#I #W"
# active window title colors
set-window-option -g window-status-current-fg $tm_color_active
set-window-option -g window-status-current-bg default
set-window-option -g window-status-current-format "#[bold]#I #W"
# pane border
set-option -g pane-border-fg $tm_color_inactive
set-option -g pane-active-border-fg $tm_color_active
# message text
set-option -g message-bg default
set-option -g message-fg $tm_color_active
# pane number display
set-option -g display-panes-active-colour $tm_color_active
set-option -g display-panes-colour $tm_color_inactive
# clock
set-window-option -g clock-mode-colour $tm_color_active
# get info
tm_itunes="#[fg=$tm_color_music]#(osascript ~/.applescripts/itunes.scpt)"
#tm_soundcloud="#[fg=$tm_color_music]#(osascript ~/.applescripts/soundcloud.scpt | cut -c1-40)"
#tm_youtube="#[fg=$tm_color_music]#(osascript ~/.applescripts/youtube.scpt | cut -c1-40)"
tm_battery="#[fg=$tm_color_music]#(zsh ~/.tmux/battery_indicator.sh)"
tm_date="#[fg=$tm_color_active]$tm_separator_right_thin #[fg=$tm_color_inactive]%R %d %b"
tm_host="#[fg=$tm_color_feature,bold]#h"
tm_session_name="#[fg=$tm_color_feature,bold]$tm_icon #S"
set -g status-left $tm_session_name' '
set -g status-right $tm_youtube' '$tm_itunes' '$tm_soundcloud' '$tm_battery' '$tm_date' '$tm_host
# Github: @AdoPi
############################################
## TMUX CONFIGURATION FILE ##
############################################
#########################
## General ##
#########################
# essentials
#set -g status-utf8 on
set -g default-terminal "xterm-256color-italic"
# small client not shrinking
setw -g aggressive-resize on
# start with 1
set -g base-index 1
setw -g pane-base-index 1
# increase history
set -g history-limit 20000
# escape delay
set -sg escape-time 0
##########################
## Key Binding ##
##########################
bind r source-file ~/.tmux.conf \; display "Tmux conf reloaded"
bind-key S command-prompt -p ssh: "new-window -n %1 'ssh %1'"
# pane movements
bind j select-pane -D
bind l select-pane -R
bind k select-pane -U
bind h select-pane -L
bind -r C-h select-window -t :-
bind -r C-l select-window -t :*
# Resize pane shortcuts
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
##########################
## Themes ##
##########################
source ~/.tmux/theme.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment