Compare commits

...

4 commits

6 changed files with 63 additions and 29 deletions

View file

@ -2,7 +2,7 @@
format = "[$user]($style) on " format = "[$user]($style) on "
[character] [character]
success_symbol = "[λ](bold fg:#f5e0dc)[ 🠊](bold cyan)" success_symbol = "[λ](bold fg:#f5e0dc)[ ](bold cyan)"
error_symbol = "[λ](bold fg:red)[ !](bold red)" error_symbol = "[λ](bold fg:red)[ !](bold red)"
[gcloud] [gcloud]

View file

@ -1,12 +1,12 @@
set -g status-keys vi set -g status-keys vi
setw -g mode-keys vi setw -g mode-keys vi
set -g prefix C-a
unbind C-b
set -g mouse on set -g mouse on
# keybindings
# smart pane switching with awareness of vim splits # smart pane switching with awareness of vim splits
set -g prefix C-a
unbind C-b
bind h select-pane -L bind h select-pane -L
bind j select-pane -D bind j select-pane -D
bind k select-pane -U bind k select-pane -U
@ -22,7 +22,6 @@ unbind %
set -g default-terminal "xterm-256color" set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc" set-option -ga terminal-overrides ",xterm-256color:Tc"
# --------catppuccin mocha # --------catppuccin mocha
# --> Catppuccin (Mocha) # --> Catppuccin (Mocha)
thm_bg="#1e1e2e" thm_bg="#1e1e2e"
@ -39,40 +38,31 @@ thm_blue="#89b4fa"
thm_orange="#fab387" thm_orange="#fab387"
thm_black4="#585b70" thm_black4="#585b70"
# status
set -g status "on" set -g status "on"
set -g status-bg "${thm_bg}" set -g status-bg "${thm_bg}"
set -g status-justify "left" set -g status-style "fg=${thm_magenta}"
set -g status-left-length "100" set-option -g status on
set -g status-right-length "100" set-option -g status-interval 2
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 60
set -g status-right '[#S]'
set-option -g window-status-current-style "fg=${thm_orange}"
set-option -g window-status-last-style "fg=${thm_yellow}"
# messages # messages
set -g message-style "fg=${thm_cyan},bg=${thm_gray},align=centre" set -g message-style "fg=${thm_orange},bg=${thm_gray},align=centre"
set -g message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre" set -g message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre"
# panes # panes
set -g pane-border-style "fg=${thm_gray}" set -g pane-border-style "fg=${thm_gray}"
set -g pane-active-border-style "fg=${thm_blue}" set -g pane-active-border-style "fg=${thm_pink}"
# windows # windows
setw -g window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none" setw -g window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none"
setw -g window-status-separator "" setw -g window-status-separator " | "
setw -g window-status-style "fg=${thm_fg},bg=${thm_bg},none" setw -g window-status-style "fg=${thm_fg},bg=${thm_bg},none"
# --------=== Statusline
#
set -g status-style "fg=${thm_cyan}"
# set -g status-left ""
# set -g status-right "#[fg=$thm_pink,bg=$thm_bg,nobold,nounderscore,noitalics]#[fg=$thm_bg,bg=$thm_pink,nobold,nounderscore,noitalics] #[fg=$thm_fg,bg=$thm_gray] #W #{?client_prefix,#[fg=$thm_red],#[fg=$thm_green]}#[bg=$thm_gray]#{?client_prefix,#[bg=$thm_red],#[bg=$thm_green]}#[fg=$thm_bg] #[fg=$thm_fg,bg=$thm_gray] #S
# #
# # current_dir
# # setw -g window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #{b:pane_current_path} "
# # setw -g window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} "
# #
# # # parent_dir/current_dir
# setw -g window-status-format "#[fg=$thm_bg,bg=$thm_blue] #I #[fg=$thm_fg,bg=$thm_gray] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) "
# setw -g window-status-current-format "#[fg=$thm_bg,bg=$thm_orange] #I #[fg=$thm_fg,bg=$thm_bg] #(echo '#{pane_current_path}' | rev | cut -d'/' -f-2 | rev) "
# --------=== Modes
setw -g clock-mode-colour "${thm_blue}" setw -g clock-mode-colour "${thm_blue}"
setw -g mode-style "fg=${thm_pink} bg=${thm_black4} bold" setw -g mode-style "fg=${thm_pink} bg=${thm_black4} bold"

View file

@ -74,3 +74,6 @@ alias g="git"
is-executable gum && alias plz="gum input --prompt='🔒' --password | sudo -nS" is-executable gum && alias plz="gum input --prompt='🔒' --password | sudo -nS"
alias dockdots='docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/home/$USER/data" dots' alias dockdots='docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/home/$USER/data" dots'
alias tmux-labbook="$DOTFILES_DIR/tmux/labbook.sh"

View file

@ -26,9 +26,7 @@ unsetopt autocd
# export VIMINIT='source $MYVIMRC' # export VIMINIT='source $MYVIMRC'
# export MYVIMRC='$DOTFILES_DIR/lib/.vimrc' # export MYVIMRC='$DOTFILES_DIR/lib/.vimrc'
if is-executable lvim; then if is-executable nvim; then
export EDITOR=lvim
elif is-executable nvim; then
export EDITOR=nvim export EDITOR=nvim
else else
export EDITOR=vim export EDITOR=vim

34
tmux/labbook.sh Executable file
View file

@ -0,0 +1,34 @@
#!/usr/bin/env bash
CURDIR="$(dirname "$(readlink -f "$0")")"
source "$CURDIR/tmux-functions.sh"
# Set Session Name
SESSION="labbook"
WORK_DIR="$HOME/$SESSION"
if ! [[ -d "$WORK_DIR" ]]; then
echo "expected to find $WORK_DIR but didn't"
exit 1
fi
# Only create tmux session if it doesn't already exist
if ! tmux list-sessions | grep $SESSION; then
# Start New Session with our name
tmux new-session -d -s $SESSION -c "$HOME/labbook"
# Name first Pane and start zsh
tmux rename-window -t $SESSION:0 'Main'
tmux send-keys -t 'Main'
# Create and setup pane for sphinx
tnw -t $SESSION:1 -n 'sphinx'
tsk -t 'sphinx' 'source ./.venv/bin/activate' Enter
tsk -t 'sphinx' 'make live' Enter
# setup writing window
tnw -t $SESSION:2 -n 'writing'
tsk -t 'writing' "nvim ./now.md" Enter
fi
# Attach Session, on the Main window
tmux attach-session -t $SESSION:0

9
tmux/tmux-functions.sh Normal file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Custom tmux new window to apply $WORK_DIR for all commands
tnw() {
tmux new-window -c "$WORK_DIR" "$@"
}
tsk() {
tmux send-keys "$@"
}