Switch from catppuccin to ayu mirage for various tools, switch from p10k to starship, self made tmux and sway statusbar update

This commit is contained in:
Martin Larsson 2025-01-09 17:22:50 +01:00
parent 886818cd1f
commit 93e41aef46
11 changed files with 412 additions and 1874 deletions

View file

@ -0,0 +1,44 @@
#!/bin/zsh
# program blacklist
# program=$(
# ps -o comm= -t "$(tmux display-message -p '#{pane_tty}')" 2>/dev/null \
# | grep -v '^ps$' \
# | grep -v 'tmux-rename-window' \
# | grep -v 'tail' \
# | grep -v 'head' \
# | grep -v 'grep' \
# | grep -v 'find' \
# | grep -v 'rg' \
# | grep -v 'jq' \
# | grep -v 'perl' \
# | grep -v 'fzf' \
# | grep -v 'bat' \
# | grep -v 'cat' \
# | grep -v 'tldr' \
# | grep -v 'man' \
# | tail -n1
# )
# Fallback if empty:
# [[ -z "$program" ]] && program="zsh"
# Get the current working directory
cwd=$(tmux display-message -p '#{pane_current_path}')
# If the program is zsh (or bash, etc.), show dir name
# if [[ "$program" == "zsh" || "$program" == "bash" || "$program" == "sh" ]]; then
[[ "$cwd" == "$HOME" ]] && dirname="~" || dirname=$(basename "$cwd")
name="$dirname/"
# else
# name="$program"
# fi
# Now do your truncation/padding
MAX_WIDTH=15
if [ "${#name}" -gt "$MAX_WIDTH" ]; then
truncated="${name:0:$(($MAX_WIDTH-2))}…/"
echo "$truncated"
else
echo "$name"
fi

View file

@ -0,0 +1,15 @@
format_for_tmux() {
fg="#1F2430"
bg="#73D0FF"
text_col="#CCCAC2"
echo $1 | awk -v bg="$bg" -v fg="$fg" -v text_col="$text_col" '{printf("#[default]#[fg="bg"]#[default]#[bg="bg", fg="fg"]%s#[default]#[fg="bg"]#[default]#[fg="text_col"] %s", substr($0, 1, 1), substr($0, 2))}'
}
battery_result=$($HOME/.config/confutils/get-battery.sh)
space=" "
session=$(format_for_tmux "#S")
battery=$(format_for_tmux "$battery_result")
calendar=$(format_for_tmux "$(date +"%a %b %d")")
echo $session$space$battery$space$calendar