updated some tmux stuff
parent
a79b6a60ff
commit
6e6ddad452
|
|
@ -15,6 +15,10 @@ function printmotd(){
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function batteryPercent(){
|
||||||
|
ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{printf("%d", $10/$5 * 100)}'
|
||||||
|
}
|
||||||
|
|
||||||
function clone()
|
function clone()
|
||||||
{
|
{
|
||||||
if [ -z "$1" ]
|
if [ -z "$1" ]
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ else
|
||||||
export BOOT2DOCKER=/usr/local/Cellar/boot2docker/1.6.0/bin
|
export BOOT2DOCKER=/usr/local/Cellar/boot2docker/1.6.0/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# if there is a C:/Projects folder on this box then I'm obviously using my work computer
|
# if there is a C:/Projects folder on this box then I'm obviously using my work computer
|
||||||
if [ -d "/c/Projects" ]; then
|
if [ -d "/c/Projects" ]; then
|
||||||
export WORK="TRUE"
|
export WORK="TRUE"
|
||||||
|
|
|
||||||
30
.tmux.conf
30
.tmux.conf
|
|
@ -7,7 +7,6 @@
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
|
|
||||||
|
|
||||||
run-shell "powerline-daemon -q"
|
|
||||||
|
|
||||||
#default to bash
|
#default to bash
|
||||||
set -g default-command "/bin/bash"
|
set -g default-command "/bin/bash"
|
||||||
|
|
@ -18,12 +17,17 @@ set-option -g default-command "reattach-to-user-namespace -l bash --login"
|
||||||
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
|
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
|
||||||
bind C-v run "tmux set-buffer \"$(reattach-to-user-namespace pbpaste)\"; tmux paste-buffer"
|
bind C-v run "tmux set-buffer \"$(reattach-to-user-namespace pbpaste)\"; tmux paste-buffer"
|
||||||
|
|
||||||
set -g default-terminal screen-256color
|
#run-shell "powerline-daemon -q"
|
||||||
|
#source ~/Tools/modules/powerline/powerline/bindings/tmux/powerline.conf
|
||||||
|
|
||||||
|
set -g default-terminal "screen-256color"
|
||||||
|
|
||||||
# set esc-wait off, so vim works
|
# set esc-wait off, so vim works
|
||||||
set-option -sg escape-time 0
|
set-option -sg escape-time 0
|
||||||
|
|
||||||
#set prefix to ctrl-a
|
#set prefix to ctrl-a
|
||||||
|
unbind-key C-a
|
||||||
|
unbind-key C-b
|
||||||
set-option -g prefix C-a
|
set-option -g prefix C-a
|
||||||
bind-key C-a send-prefix
|
bind-key C-a send-prefix
|
||||||
|
|
||||||
|
|
@ -35,13 +39,19 @@ set-option -g set-titles-string ' #I-#W '
|
||||||
set-option -g repeat-time 500
|
set-option -g repeat-time 500
|
||||||
set-option -g visual-bell on
|
set-option -g visual-bell on
|
||||||
|
|
||||||
|
|
||||||
#status bar
|
#status bar
|
||||||
set-option -g status-utf8 on
|
set-option -g status-utf8 on
|
||||||
set-option -g status-keys vi
|
set-option -g status-keys vi
|
||||||
set-option -g status-interval 5
|
set-option -g status-interval 1
|
||||||
set-option -g status-justify left
|
set-option -g status-justify left
|
||||||
|
|
||||||
|
set-option -g status-left-length 65
|
||||||
|
#set-option -g status-left-bg blue
|
||||||
set-option -g status-left ' #h | Adam Veldhousen '
|
set-option -g status-left ' #h | Adam Veldhousen '
|
||||||
set-option -g status-right 'tmux is rad | %d-%m-%Y %H:%M:%ss #[default]'
|
|
||||||
|
#set-option -g status-right-bg green
|
||||||
|
set-option -g status-right ' tmux is rad | bat: #(~/utilities/battery) | %A %B %d, %Y %Ts '
|
||||||
|
|
||||||
# copy mode
|
# copy mode
|
||||||
set-option buffer-limit 10
|
set-option buffer-limit 10
|
||||||
|
|
@ -52,6 +62,12 @@ set-window-option -g clock-mode-style 24
|
||||||
set-window-option -g monitor-activity on
|
set-window-option -g monitor-activity on
|
||||||
set-window-option -g automatic-rename on
|
set-window-option -g automatic-rename on
|
||||||
set-window-option -g mode-mouse on
|
set-window-option -g mode-mouse on
|
||||||
|
set-window-option -g mode-keys vi
|
||||||
|
|
||||||
|
#pane options
|
||||||
|
set -g mouse-resize-pane on
|
||||||
|
set -g mouse-select-pane on
|
||||||
|
set -g pane-active-border-fg green
|
||||||
|
|
||||||
# Window nav
|
# Window nav
|
||||||
unbind-key 1 ; bind-key 1 select-window -t 1
|
unbind-key 1 ; bind-key 1 select-window -t 1
|
||||||
|
|
@ -95,19 +111,15 @@ unbind-key q ; bind-key q list-keys
|
||||||
unbind-key M-q ; bind-key M-q list-keys
|
unbind-key M-q ; bind-key M-q list-keys
|
||||||
|
|
||||||
# vim behavior
|
# vim behavior
|
||||||
setw -g mode-keys vi
|
|
||||||
unbind [ ; bind Escape copy-mode
|
unbind [ ; bind Escape copy-mode
|
||||||
unbind p ; bind p paste-buffer
|
unbind p ; bind p paste-buffer
|
||||||
bind -t vi-copy 'v' begin-selection
|
bind -t vi-copy 'v' begin-selection
|
||||||
bind -t vi-copy 'y' copy-selection
|
bind -t vi-copy 'y' copy-selection
|
||||||
|
|
||||||
#vim airline integration
|
|
||||||
#source ~/Tools/vim/.vimrc
|
|
||||||
|
|
||||||
#unbind-key ^A-c ; bind-key -n ^A-c copy-mode
|
#unbind-key ^A-c ; bind-key -n ^A-c copy-mode
|
||||||
#unbind-key ^A-NPage ; bind-key -n ^A-NPage copy-mode
|
#unbind-key ^A-NPage ; bind-key -n ^A-NPage copy-mode
|
||||||
#unbind-key ^A-PPage ; bind-key -n ^A-PPage copy-mode
|
#unbind-key ^A-PPage ; bind-key -n ^A-PPage copy-mode
|
||||||
#unbind-key ^A-i ; bind-key -n ^A-i paste-buffer
|
#unbind-key ^A-i ; bind-key -n ^A-i paste-buffer
|
||||||
#unbind-key ^A-P ; bind-key -n ^A-P paste-buffer
|
#unbind-key ^A-P ; bind-key -n ^A-P paste-buffer
|
||||||
|
|
||||||
source ~/Tools/modules/powerline/powerline/bindings/tmux/powerline.conf
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
percent=`ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{printf("%d", $10/$5 * 100)}'`
|
||||||
|
if (( percent > 90 )); then color='#[bright fg=green]'
|
||||||
|
elif (( percent > 80 )); then color='#[nobright fg=green]'
|
||||||
|
elif (( percent > 70 )); then color='#[bright fg=yellow]'
|
||||||
|
elif (( percent > 30 )); then color='#[bright red]'
|
||||||
|
else color='#[nobright red]'
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$color$percent%"
|
||||||
Loading…
Reference in New Issue