min-setup.sh
Raw
#!/bin/sh
mkdir -p ~/tmp ~/codes ~/soft ~/bentoml ~/notebooks ~/x ~/j \
~/.local/bin ~/.config ~/.local/dockerspace/gpu-devbox ~/.local/dockerspace/cpu-devbox
MINRC=$(cat <<EOF
# minimal rc
PATH=\$HOME/.bin.local:\$HOME/.bin:\$HOME/.local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:\$PATH
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
alias diru='du -h -d 1'
alias ca='docker exec -it -u larme cpu-devbox bash -l'
alias ga='docker exec -it -u larme gpu-devbox bash -l'
EOF
)
echo "$MINRC" > ~/.min.rc
echo ". ~/.min.rc" >> ~/.bashrc
TMUXCONF=$(cat <<EOF
unbind 1
unbind 2
unbind 3
bind 1 resize-pane -Z
bind 2 split-window
bind 3 split-window -h
set -g default-terminal "screen-256color"
set-option -g default-command 'command -v reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace -l "$SHELL" || exec "$SHELL"'
set-option -g mouse on
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
# simulate tab
set -g base-index 1 # Start numbering windows at 1, not 0.
set -g pane-base-index 1 # Start numbering panes at 1, not 0.
bind -n C-M-t new-window
bind -n C-M-s next-window
bind -n C-M-a previous-window
set -g status-style "bg=default"
set -g window-status-current-style "bg=default,reverse"
set -g window-status-separator '' # No spaces between windows in the status bar.
set -g window-status-format "#{?window_start_flag,, }#I:#W#{?window_flags,#F, } "
set -g window-status-current-format "#{?window_start_flag,, }#I:#W#{?window_flags,#F, } "
set -g status-left ''
set -g status-right ''
EOF
)
echo "$TMUXCONF" > ~/.tmux.conf
| 1 | #!/bin/sh |
| 2 | |
| 3 | mkdir -p ~/tmp ~/codes ~/soft ~/bentoml ~/notebooks ~/x ~/j \ |
| 4 | ~/.local/bin ~/.config ~/.local/dockerspace/gpu-devbox ~/.local/dockerspace/cpu-devbox |
| 5 | |
| 6 | MINRC=$(cat <<EOF |
| 7 | # minimal rc |
| 8 | |
| 9 | PATH=\$HOME/.bin.local:\$HOME/.bin:\$HOME/.local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:\$PATH |
| 10 | |
| 11 | export LC_ALL=en_US.UTF-8 |
| 12 | export LANG=en_US.UTF-8 |
| 13 | export LANGUAGE=en_US.UTF-8 |
| 14 | |
| 15 | alias diru='du -h -d 1' |
| 16 | |
| 17 | alias ca='docker exec -it -u larme cpu-devbox bash -l' |
| 18 | alias ga='docker exec -it -u larme gpu-devbox bash -l' |
| 19 | EOF |
| 20 | ) |
| 21 | echo "$MINRC" > ~/.min.rc |
| 22 | echo ". ~/.min.rc" >> ~/.bashrc |
| 23 | |
| 24 | TMUXCONF=$(cat <<EOF |
| 25 | unbind 1 |
| 26 | unbind 2 |
| 27 | unbind 3 |
| 28 | bind 1 resize-pane -Z |
| 29 | bind 2 split-window |
| 30 | bind 3 split-window -h |
| 31 | set -g default-terminal "screen-256color" |
| 32 | set-option -g default-command 'command -v reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace -l "$SHELL" || exec "$SHELL"' |
| 33 | |
| 34 | set-option -g mouse on |
| 35 | bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" |
| 36 | bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" |
| 37 | |
| 38 | # simulate tab |
| 39 | set -g base-index 1 # Start numbering windows at 1, not 0. |
| 40 | set -g pane-base-index 1 # Start numbering panes at 1, not 0. |
| 41 | bind -n C-M-t new-window |
| 42 | bind -n C-M-s next-window |
| 43 | bind -n C-M-a previous-window |
| 44 | |
| 45 | set -g status-style "bg=default" |
| 46 | set -g window-status-current-style "bg=default,reverse" |
| 47 | set -g window-status-separator '' # No spaces between windows in the status bar. |
| 48 | set -g window-status-format "#{?window_start_flag,, }#I:#W#{?window_flags,#F, } " |
| 49 | set -g window-status-current-format "#{?window_start_flag,, }#I:#W#{?window_flags,#F, } " |
| 50 | |
| 51 | set -g status-left '' |
| 52 | set -g status-right '' |
| 53 | |
| 54 | EOF |
| 55 | ) |
| 56 | echo "$TMUXCONF" > ~/.tmux.conf |