- add home/theme.nix as the single Silicon Volt palette and pass it to home modules via extraSpecialArgs - drive foot, hyprland, hyprlock, mako, fzf, starship, rofi and the herdr picker from that palette; raw config files use @color@ tokens substituted at build time - pass my = config.my into home-manager; add my.pi.enable, my.flakeDir - gate home/pi.nix on my.pi.enable (enabled on hades) - route zshconf/hyprconf aliases and FLAKE_CONFIG through my.flakeDir - rename the hyprland monitor option volt.monitors -> hypr.monitors - fix use_auto_tmux command-substitution bug in zsh/init.zsh - track home/nvim/config/lazy-lock.json for reproducible plugins - document theming and toggles in the README
92 lines
2.7 KiB
Bash
Executable File
92 lines
2.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Prevent nested execution if already inside Herdr, tmux, zellij, or running non-interactively
|
|
if [ -n "$HERDR" ] || [ -n "$HERDR_SESSION" ] || [ -n "$TMUX" ] || [ -n "$ZELLIJ" ] || [ ! -t 0 ]; then
|
|
exec zsh "$@"
|
|
fi
|
|
|
|
# Function to start raw shell
|
|
start_plain_shell() {
|
|
exec zsh "$@"
|
|
}
|
|
|
|
# If herdr binary is not found, launch zsh directly without producing noisy stdout
|
|
if ! command -v herdr &>/dev/null; then
|
|
start_plain_shell "$@"
|
|
fi
|
|
|
|
# Fetch active herdr sessions
|
|
active_sessions=()
|
|
raw_output=$(herdr session list 2>/dev/null)
|
|
if [ $? -eq 0 ] && [ -n "$raw_output" ]; then
|
|
while IFS= read -r line; do
|
|
# Extract first word as session name
|
|
sname=$(echo "$line" | awk '{print $1}' | tr -d '*:')
|
|
if [ -n "$sname" ] && [ "$sname" != "NAME" ] && [ "$sname" != "Sessions:" ] && [ "$sname" != "No" ]; then
|
|
active_sessions+=("$sname")
|
|
fi
|
|
done <<< "$raw_output"
|
|
fi
|
|
|
|
# Prepare menu options
|
|
menu_items=()
|
|
menu_items+=("✨ [Create New Session]")
|
|
menu_items+=("⚡ [Default Session]")
|
|
|
|
for s in "${active_sessions[@]}"; do
|
|
if [ "$s" != "default" ]; then
|
|
menu_items+=("📦 $s")
|
|
fi
|
|
done
|
|
|
|
menu_items+=("🐚 [Skip - Plain Shell]")
|
|
|
|
# Interactive session selector using fzf (Silicon Volt palette)
|
|
if command -v fzf &>/dev/null; then
|
|
selected=$(printf '%s\n' "${menu_items[@]}" | fzf \
|
|
--height=45% \
|
|
--layout=reverse \
|
|
--border=rounded \
|
|
--prompt=" Herdr Session > " \
|
|
--color=fg:@fg@,bg:@bg@,hl:@volt@,fg+:@fgBright@,bg+:@glass@,hl+:@voltLight@ \
|
|
--color=info:@muted@,prompt:@volt@,pointer:@coral@,marker:@volt@,spinner:@blue@ \
|
|
--color=border:@surface@,gutter:@bg@ \
|
|
--header="Select Herdr session to attach / create | Esc for plain shell" \
|
|
--header-first)
|
|
else
|
|
echo "=========================================="
|
|
echo " HERDR SESSION PICKER "
|
|
echo "=========================================="
|
|
PS3="Choose an option: "
|
|
select selected in "${menu_items[@]}"; do
|
|
[ -n "$selected" ] && break
|
|
done
|
|
fi
|
|
|
|
case "$selected" in
|
|
"✨ [Create New Session]")
|
|
echo ""
|
|
read -r -p "Enter session name (press Enter for auto-generated name): " s_name
|
|
if [ -z "$s_name" ]; then
|
|
s_name="workspace-$(date +%m%d-%H%M)"
|
|
fi
|
|
export HERDR_SESSION="$s_name"
|
|
exec herdr session attach "$s_name" 2>/dev/null || exec herdr session new "$s_name" 2>/dev/null || exec herdr "$s_name"
|
|
;;
|
|
"⚡ [Default Session]")
|
|
export HERDR_SESSION="default"
|
|
exec herdr
|
|
;;
|
|
"🐚 [Skip - Plain Shell]"|"")
|
|
start_plain_shell "$@"
|
|
;;
|
|
📦\ *)
|
|
s_name="${selected#📦 }"
|
|
export HERDR_SESSION="$s_name"
|
|
exec herdr session attach "$s_name" 2>/dev/null || exec herdr "$s_name"
|
|
;;
|
|
*)
|
|
start_plain_shell "$@"
|
|
;;
|
|
esac
|