Added chaotic AUR install script and terminal customization script

This commit is contained in:
2026-07-12 02:37:04 -04:00
parent 8025d77f27
commit 449f5f2565
4 changed files with 462 additions and 0 deletions
+139
View File
@@ -0,0 +1,139 @@
# set prefix key to Ctrl-a
set -g prefix C-a
# enable mouse mode
set -g mouse on
# set default terminal to xterm-256color
set -g default-terminal "tmux-256color"
# bind keys for pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# bind key for closing panes
bind x kill-pane
bind q confirm-before kill-session
# bind key for switching between windows
bind n next-window
bind p previous-window
# cheatsheet & reload
bind ? display-popup -h 27 -w 46 -E "echo -e '╔══════════════════════════════════════════╗\n║  Tmux Cheatsheet ║\n╠══════════════════════════════════════════╣\n║ Press Ctrl+A (prefix) then: ║\n╠══════════════════════════════════════════╣\n║ PANES ║\n║ h/j/k/l Navigate pane ║\n║ | Split horizontally ║\n║ - Split vertically ║\n║ x Kill pane ║\n║ Ctrl+S Swap pane layout ║\n╠══════════════════════════════════════════╣\n║ WINDOWS ║\n║ n Next window ║\n║ p Previous window ║\n║ q Kill session ║\n║ c New window ║\n║ , Rename window ║\n╠══════════════════════════════════════════╣\n║ GENERAL ║\n║ r Reload config ║\n║ ? This cheatsheet ║\n╚══════════════════════════════════════════╝\nPress any key to close.' && read -n 1 -s"
bind r source-file ~/.config/tmux/tmux.conf
# disable terminal flow control (so C-s doesn't freeze)
# set -g flow-control off # option not available in this tmux build
# bind key for toggling between horizontal and vertical split
bind C-s swap-pane -s .-1
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-cpu'
# GitHub Dark color palette
set -g @thm_bg "#0d1117"
set -g @thm_surface_0 "#161b22"
set -g @thm_overlay_0 "#30363d"
set -g @thm_red "#f85149"
set -g @thm_green "#3fb950"
set -g @thm_yellow "#d29922"
set -g @thm_blue "#58a6ff"
set -g @thm_mauve "#bc8cff"
set -g @thm_pink "#f778ba"
set -g @thm_peach "#f0883e"
set -g @thm_maroon "#ff7b72"
set -g @thm_rosewater "#c9d1d9"
# Configure Online
set -g @online_icon "ok"
set -g @offline_icon "nok"
# status left look and feel
set -g status-left-length 100
set -g status-left ""
set -ga status-left "#{?client_prefix,#{#[bg=#{@thm_red},fg=#{@thm_bg},bold]  #S },#{#[bg=#{@thm_bg},fg=#{@thm_green}]  #S }}"
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]│"
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_maroon}]  #{pane_current_command} "
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]│"
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_blue}]  #{=/-32/...:#{s|$USER|~|:#{b:pane_current_path}}} "
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]#{?window_zoomed_flag,│,}"
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_yellow}]#{?window_zoomed_flag,  zoom ,}"
# status right look and feel
set -g status-right-length 100
set -g status-right ""
set -ga status-right "#{?#{e|>=:10,#{battery_percentage}},#{#[bg=#{@thm_red},fg=#{@thm_bg}]},#{#[bg=#{@thm_bg},fg=#{@thm_pink}]}} #{battery_icon} #{battery_percentage} "
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_overlay_0}, none]│"
set -ga status-right "#[bg=#{@thm_bg}]#{?#{==:#{online_status},ok},#[fg=#{@thm_mauve}] 󰖩 on ,#[fg=#{@thm_red},bold]#[reverse] 󰖪 off }"
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_overlay_0}, none]│"
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_blue}] 󰭦 %a, %m-%d-%Y 󰅐 %I:%M %p "
# start indexing at 1 (not 0)
set -g base-index 1
setw -g pane-base-index 1
# misc quality-of-life
set -sg escape-time 0
set -g status-interval 5
set -g renumber-windows on
set -g focus-events on
setw -g aggressive-resize on
set -g set-clipboard on
# bootstrap tpm
if "test ! -d ~/.config/tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins'"
# auto-install a Nerd Font if missing (for icons)
run 'if ! fc-list :lang=en 2>/dev/null | grep -qi "nerd\\|jetbrainsmono\\|firacode\\|hack\\|iosevka\\|meslo"; then
mkdir -p ~/.local/share/fonts
if command -v curl >/dev/null 2>&1; then
curl -sL "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/JetBrainsMono.zip" -o /tmp/jetbrains-nerd.zip
elif command -v wget >/dev/null 2>&1; then
wget -q "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/JetBrainsMono.zip" -O /tmp/jetbrains-nerd.zip
fi
if [ -f /tmp/jetbrains-nerd.zip ]; then
unzip -qo /tmp/jetbrains-nerd.zip -d ~/.local/share/fonts/ 2>/dev/null
rm -f /tmp/jetbrains-nerd.zip
fc-cache -f ~/.local/share/fonts/ 2>/dev/null
fi
fi'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm'
# Configure Tmux
set -g status-position bottom
set -g status-style "bg=#{@thm_bg}"
set -g status-justify "absolute-centre"
# pane border look and feel
setw -g pane-border-status bottom
setw -g pane-border-format ""
setw -g pane-active-border-style "bg=#{@thm_bg},fg=#{@thm_overlay_0}"
setw -g pane-border-style "bg=#{@thm_bg},fg=#{@thm_surface_0}"
setw -g pane-border-lines single
# window look and feel
set -wg automatic-rename on
set -g automatic-rename-format "#{pane_current_command}"
set -g window-status-format " #I#{?#{!=:#{window_name},Window},: #W,} "
set -g window-status-style "bg=#{@thm_bg},fg=#{@thm_rosewater}"
set -g window-status-last-style "bg=#{@thm_bg},fg=#{@thm_peach}"
set -g window-status-activity-style "bg=#{@thm_red},fg=#{@thm_bg}"
set -g window-status-bell-style "bg=#{@thm_red},fg=#{@thm_bg},bold"
set -gF window-status-separator "#[bg=#{@thm_bg},fg=#{@thm_overlay_0}]│"
set -g window-status-current-format " #I#{?#{!=:#{window_name},Window},: #W,} "
set -g window-status-current-style "bg=#{@thm_peach},fg=#{@thm_bg},bold"
+139
View File
@@ -0,0 +1,139 @@
export ZSH_CONFIG=$HOME/.config/zsh
export OHMYZSH=$ZSH_CONFIG/oh-my-zsh
export OHMYZSH_CUSTOM=$OHMYZSH/custom
export ZSHRC_URL="https://jeremy-web.space/scripts/zshrc"
export ZSHRC_BOOTSTRAP_URL="https://jeremy-web.space/scripts/zshrc-bootstrap.zsh"
export ZSHRC_BOOTSTRAP_VERSION="2"
export ZSHRC_BOOTSTRAP="$ZSH_CONFIG/.bootstrapped"
[[ -d "$HOME/Scripts" ]] && path+=("$HOME/Scripts")
[[ -d "$HOME/.local/bin" ]] && path+=("$HOME/.local/bin")
[[ -d "$HOME/AppImages" ]] && path+=("$HOME/AppImages")
update_zshrc(){
local tmp=/tmp/.zshrc.$$
curl -sSL --connect-timeout 5 "$ZSHRC_URL" -o "$tmp" 2>/dev/null || return
if ! cmp -s "$tmp" "$HOME/.zshrc" 2>/dev/null; then
echo "Updating zshrc..."
mv "$tmp" "$HOME/.zshrc" && echo "Updated. Reloading..." && exec zsh
fi
rm -f "$tmp"
}
fix_btopbg(){
sed -i 's/theme_background = true/theme_background = false/' ~/.config/btop/btop.conf
}
# Bootstrap: download and run once per bootstrap version
if [[ ! -f "$ZSHRC_BOOTSTRAP" || "$(cat "$ZSHRC_BOOTSTRAP" 2>/dev/null)" != "$ZSHRC_BOOTSTRAP_VERSION" || "$BOOTSTRAP" == "true" ]]; then
tmp=/tmp/.zshrc_bootstrap.$$
curl -sSL --connect-timeout 5 -o "$tmp" "$ZSHRC_BOOTSTRAP_URL" 2>/dev/null
if [[ -f "$tmp" ]]; then
zsh "$tmp" 2>/dev/null
echo "$ZSHRC_BOOTSTRAP_VERSION" > "$ZSHRC_BOOTSTRAP"
rm -f "$tmp"
fi
fi
TMUXCONF="$HOME/.config/tmux"
BYOBUCONF="$HOME/.config/byobu"
TMUXREMOTE="https://jeremy-web.space/scripts/tmux.conf"
if [ ! -f "$TMUXCONF" ]; then
# Create a secure temporary file
TEMP_TMUXCONF=$(mktemp)
# Download to temp file.
# The '&&' ensures the 'mv' only runs if curl succeeds (exit code 0).
if curl -sSL --connect-timeout 5 -o "$TEMP_TMUXCONF" "$TMUXREMOTE"; then
mkdir -p "$TMUXCONF" "$BYOBUCONF"
cp "$TEMP_TMUXCONF" "$TMUXCONF/tmux.conf"
mv "$TEMP_TMUXCONF" "$BYOBUCONF/.tmux.conf"
else
# Optional: Clean up temp file if download failed
rm -f "$TEMP_TMUXCONF"
echo "Error: Failed to download tmux config from $TMUXREMOTE" >&2
fi
fi
export HISTFILE="$ZSH_CONFIG/history"
export ZSH_COMPDUMP="$ZSH_CONFIG/zcompdump-${HOST}-${ZSH_VERSION}"
export HISTSIZE=10000
export SAVEHIST=10000
setopt SHARE_HISTORY
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_FCNTL_LOCK
setopt AUTO_CD
setopt AUTO_LIST
setopt INTERACTIVE_COMMENTS
ZSH_THEME=""
ENABLE_CORRECTION="false"
HIST_STAMPS="mm/dd/yyyy"
plugins=(
git
sudo
extract
eza
history
kitty
docker
docker-compose
archlinux
encode64
universalarchive
zsh-autosuggestions
fast-syntax-highlighting
fzf
fzf-tab
systemd
vscode
rsync
starship
)
zstyle ':omz:update' 'mode' auto
zstyle ':omz:plugins:eza' 'dirs-first' yes
zstyle ':omz:plugins:eza' 'git-status' yes
zstyle ':omz:plugins:eza' 'header' yes
zstyle ':omz:plugins:eza' 'show-group' yes
zstyle ':omz:plugins:eza' 'icons' yes
zstyle ':omz:plugins:eza' 'color-scale' all
zstyle ':omz:plugins:eza' 'color-scale-mode' fixed
zstyle ':omz:plugins:eza' 'size-prefix' si
zstyle ':omz:plugins:eza' 'hyperlink' yes
zstyle ':completion:*' menu select
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' special-dirs true
source $OHMYZSH/oh-my-zsh.sh
alias c='clear'
alias q="exit"
alias nbstat=$'netbird status --json | jq -r \'.peers.details[]? | [(.hostname // .fqdn), .netbirdIp, .status] | @tsv\' | column -t -s $\'\\t\''
alias open-ports="ss -tulpn | grep LISTEN"
alias yeet='yay -Rcs'
# Auto-update: check every shell start, silently fail if server unreachable
if [[ -o interactive ]]; then
tmp=/tmp/.zshrc.$$
curl -sSL --connect-timeout 3 "$ZSHRC_URL" -o "$tmp" 2>/dev/null
if [[ -f "$tmp" ]] && ! cmp -s "$tmp" "$HOME/.zshrc" 2>/dev/null; then
echo "Updating zshrc..."
mv "$tmp" "$HOME/.zshrc" && exec zsh
fi
rm -f "$tmp"
fi
[[ -f $HOME/.zshrc.local ]] || touch $HOME/.zshrc.local
source $HOME/.zshrc.local
if [[ $FFENABLED != "false" && ( -o interactive || $(tty) == *"pts"* ) ]] && command -v fastfetch >/dev/null; then
fastfetch --config examples/13
fi
+83
View File
@@ -0,0 +1,83 @@
export ZSH_CONFIG=$HOME/.config/zsh
export OHMYZSH=$ZSH_CONFIG/oh-my-zsh
export OHMYZSH_CUSTOM=$OHMYZSH/custom
touch ~/.hushlogin
mkdir -p "$HOME/.local/bin"
mkdir -p "$ZSH_CONFIG"
path+=("$HOME/.local/bin")
for p in git starship fzf eza rsync lazydocker fastfetch tmux; do
command -v $p >/dev/null && continue
if command -v brew >/dev/null; then
echo "Installing $p using brew" && brew install $p && continue
fi
if command -v apt >/dev/null && apt-cache show $p >/dev/null 2>&1; then
echo "Installing $p using Apt" && sudo apt install $p -y && continue
fi
if command -v dnf >/dev/null && dnf list available -y $p >/dev/null 2>&1; then
echo "Installing $p using dnf" && sudo dnf install $p -y && continue
fi
if command -v pacman >/dev/null && pacman -Si $p >/dev/null 2>&1; then
echo "Installing $p using pacman" && sudo pacman -Sy --noconfirm $p && continue
fi
if command -v cargo >/dev/null; then
echo "Installing $p using cargo" && cargo install $p --locked && continue
fi
done
if ! command -v starship >/dev/null; then
echo "Installing starship binary..." && \
curl -sSL https://starship.rs/install.sh | sh -s -- -b ~/.local/bin -y >/dev/null 2>&1
fi
if ! command -v lazydocker >/dev/null; then
echo "Installing lazydocker binary..." && \
curl -sSL https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | \
DIR=$HOME/.local/bin bash >/dev/null 2>&1
fi
arch=$(uname -m)
case "$arch" in
x86_64) target_fast="linux-amd64" && target_eza="x86_64-unknown-linux-gnu" ;;
aarch64|arm64) target_fast="linux-aarch64" && target_eza="aarch64-unknown-linux-gnu" ;;
armv7l) target_fast="linux-armv7l" && target_eza="armv7-unknown-linux-gnueabihf" ;;
esac
if [[ -n $target_fast && -n $target_eza ]]; then
if ! command -v fastfetch >/dev/null; then
curl -sSL -o /tmp/fastfetch.tar.gz "https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-${target_fast}.tar.gz"
tar -xzf /tmp/fastfetch.tar.gz -C /tmp
ffdir=$(find /tmp -maxdepth 1 -type d -name 'fastfetch*' | head -1)
cp "$ffdir/usr/bin/fastfetch" "$HOME/.local/bin/"
chmod +x "$HOME/.local/bin/fastfetch"
mkdir -p "$HOME/.local/share/fastfetch"
cp -r "$ffdir/usr/share/fastfetch/"* "$HOME/.local/share/fastfetch/"
rm -rf "$ffdir" /tmp/fastfetch.tar.gz
fi
if ! command -v eza >/dev/null; then
curl -sSL -o /tmp/eza.tar.gz "https://github.com/eza-community/eza/releases/latest/download/eza_${target_eza}.tar.gz"
tar -xzf /tmp/eza.tar.gz -C "$HOME/.local/bin/"
chmod +x "$HOME/.local/bin/eza"
rm -f /tmp/eza.tar.gz
fi
fi
mkdir -p "$HOME/.config/zsh"
[ ! -d $OHMYZSH ] && git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh.git $OHMYZSH
for plug in \
"zsh-autosuggestions|https://github.com/zsh-users/zsh-autosuggestions" \
"fast-syntax-highlighting|https://github.com/zdharma-continuum/fast-syntax-highlighting" \
"fzf-tab|https://github.com/Aloxaf/fzf-tab"
do
name="${plug%%|*}"
url="${plug##*|}"
dir="$OHMYZSH_CUSTOM/plugins/$name"
[[ ! -d "$dir" ]] && git clone "$url" "$dir" 2>/dev/null
done
# Cleanup
[[ -d $HOME/.config/oh-my-zsh ]] && rm -rf "$HOME/.config/oh-my-zsh"