commit ac46dfab1c499784cae1f3262b8deaf7664ecc88
parent f027d4af3f9e7bdea466da152446da1bcbead6e0
Author: Anders Damsgaard <andersd@riseup.net>
Date: Fri, 6 Oct 2017 12:49:00 -0400
automatically rescale status fields when opening a new tmux window
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/links/.tmux.conf b/links/.tmux.conf
@@ -116,7 +116,8 @@ set -g status-fg cyan
#set -g status-right "#[fg=green]#H"
set -g status-left-length 40
set -g status-left "#[fg=red]#(hostname|sed \"s/\\\\..*$//\") #[fg=green]s:#S #[fg=yellow]w:#I #[fg=cyan]p:#P"
-set -g status-right-length 60
+#set -g status-right-length 60
+set -g status-right-length "#(echo $COLUMNS/2|bc)"
if-shell 'uname | grep -qi Darwin' "set -g status-right \"#[fg=#81a2be]#(/usr/local/bin/mpc | head -n 1 | sed 's/volume.*$//' | cut -c 1-22) #[fg=cyan]#(~/bin/battery-osx) #(~/bin/mailstatus.sh) #[fg=yellow]#(uptime|sed 's/.* //') #[fg=green]%Y-%m-%d %R\""
if-shell 'uname | grep -qi Linux' "set -g status-right \"#[fg=cyan]#(acpi|sed 's/Battery//; s/0://; s/Discharging//; s/Full, //; s/remaining//; s/ , //; s/Charging, /+/; s/ until charged/ /; s/, / /; s/Unknown //; s/ $//;') #(~/bin/mailstatus.sh) #[fg=yellow]#(cat /proc/loadavg|awk '{print $1;}') #[fg=green]%Y-%m-%d %R\""
@@ -197,5 +198,7 @@ bind-key '%' split-window -h -c "#{pane_current_path}"
# Show weather information in new window
bind-key W new-window -n weather "curl 'wttr.in/?m'; echo -e '\nPress <enter> to quit'; read -n 1 -s"
-
-bind-key h send-keys "echo hello, world" C-m
+bind-key M new-window -n mutt "mutt"
+bind-key V new-window -n vim "vim"
+bind-key P new-window -n vimpc "vimpc"
+bind-key Enter new-window "tmux set status-right-length `echo $(tput cols)/3|bc|tr -d '\n'`; tmux set status-left-length `echo $(tput cols)/3|bc|tr -d '\n'`; zsh"