Dotfiles update 2025-12-25 16:19

This commit is contained in:
Aaron D. Lee
2025-12-25 16:19:31 -05:00
parent c349b90f4d
commit 213029a537
3 changed files with 46 additions and 29 deletions

0
.initialized Normal file
View File

1
.last-version Normal file
View File

@@ -0,0 +1 @@
1.2.4

View File

@@ -10,7 +10,8 @@
# dotfiles-tour.sh --changelog # Show recent changes # dotfiles-tour.sh --changelog # Show recent changes
# ============================================================================ # ============================================================================
set -e # Don't exit on error - interactive scripts need to handle errors gracefully
set +e
# Source bootstrap # Source bootstrap
source "${DOTFILES_HOME:-$HOME/.dotfiles}/zsh/lib/bootstrap.zsh" 2>/dev/null || { source "${DOTFILES_HOME:-$HOME/.dotfiles}/zsh/lib/bootstrap.zsh" 2>/dev/null || {
@@ -24,6 +25,7 @@ source "${DOTFILES_HOME:-$HOME/.dotfiles}/zsh/lib/bootstrap.zsh" 2>/dev/null ||
df_print_indent() { echo " $1"; } df_print_indent() { echo " $1"; }
df_print_success() { echo -e "${DF_GREEN}${DF_NC} $1"; } df_print_success() { echo -e "${DF_GREEN}${DF_NC} $1"; }
df_print_info() { echo -e "${DF_CYAN}${DF_NC} $1"; } df_print_info() { echo -e "${DF_CYAN}${DF_NC} $1"; }
df_print_step() { echo -e "${DF_BLUE}==>${DF_NC} $1"; }
} }
DOTFILES_DIR="${DOTFILES_HOME:-$HOME/.dotfiles}" DOTFILES_DIR="${DOTFILES_HOME:-$HOME/.dotfiles}"
@@ -274,8 +276,8 @@ tour_complete() {
echo "" echo ""
# Mark first run complete # Mark first run complete
touch "$FIRST_RUN_FILE" touch "$FIRST_RUN_FILE" 2>/dev/null || true
echo "$DOTFILES_VERSION" > "$LAST_VERSION_FILE" echo "$DOTFILES_VERSION" > "$LAST_VERSION_FILE" 2>/dev/null || true
} }
# ============================================================================ # ============================================================================
@@ -283,41 +285,51 @@ tour_complete() {
# ============================================================================ # ============================================================================
run_interactive_tour() { run_interactive_tour() {
local pages=( # Page functions and titles
"show_welcome:Welcome" local page_funcs=(
"tour_navigation:Navigation & Shortcuts" "show_welcome"
"tour_dotfiles_management:Dotfiles Management" "tour_navigation"
"tour_git_helpers:Git & Development" "tour_dotfiles_management"
"tour_tmux_workspaces:Tmux Workspaces" "tour_git_helpers"
"tour_system_tools:System Administration" "tour_tmux_workspaces"
"tour_productivity:Productivity Features" "tour_system_tools"
"tour_complete:Complete" "tour_productivity"
"tour_complete"
)
local page_titles=(
"Welcome"
"Navigation & Shortcuts"
"Dotfiles Management"
"Git & Development"
"Tmux Workspaces"
"System Administration"
"Productivity Features"
"Complete"
) )
local current=0 local current=0
local total=${#pages[@]} local total=${#page_funcs[@]}
local key=""
while true; do while true; do
local page_info="${pages[$current]}"
local func="${page_info%%:*}"
local title="${page_info#*:}"
# Show current page # Show current page
$func ${page_funcs[$current]}
# Navigation footer # Navigation footer
echo "" echo ""
echo -e "${DF_DIM}─────────────────────────────────────────────────────────────${DF_NC}" echo -e "${DF_DIM}─────────────────────────────────────────────────────────────${DF_NC}"
echo -e " Page $((current + 1)) of $total: ${DF_CYAN}$title${DF_NC}" echo -e " Page $((current + 1)) of $total: ${DF_CYAN}${page_titles[$current]}${DF_NC}"
echo "" echo ""
if (( current == total - 1 )); then if [[ $current -eq $((total - 1)) ]]; then
echo -e " Press ${DF_GREEN}Enter${DF_NC} to finish, ${DF_CYAN}p${DF_NC} for previous, ${DF_RED}q${DF_NC} to quit" echo -e " Press ${DF_GREEN}Enter${DF_NC} to finish, ${DF_CYAN}p${DF_NC} for previous, ${DF_RED}q${DF_NC} to quit"
else else
echo -e " Press ${DF_GREEN}Enter${DF_NC} for next, ${DF_CYAN}p${DF_NC} for previous, ${DF_RED}q${DF_NC} to quit" echo -e " Press ${DF_GREEN}Enter${DF_NC} for next, ${DF_CYAN}p${DF_NC} for previous, ${DF_RED}q${DF_NC} to quit"
fi fi
read -rsn1 key # Read single key
read -rsn1 key || true
case "$key" in case "$key" in
q|Q) q|Q)
@@ -326,15 +338,18 @@ run_interactive_tour() {
exit 0 exit 0
;; ;;
p|P) p|P)
(( current > 0 )) && ((current--)) if [[ $current -gt 0 ]]; then
current=$((current - 1))
fi
;; ;;
*) *)
if (( current == total - 1 )); then # Enter or any other key goes to next page
if [[ $current -eq $((total - 1)) ]]; then
echo "" echo ""
echo -e "${DF_GREEN}Enjoy your new shell!${DF_NC}" echo -e "${DF_GREEN}Enjoy your new shell!${DF_NC}"
exit 0 exit 0
fi fi
((current++)) current=$((current + 1))
;; ;;
esac esac
done done
@@ -388,10 +403,13 @@ show_changelog() {
df_print_header "Recent Changes" df_print_header "Recent Changes"
echo "" echo ""
cd "$DOTFILES_DIR" cd "$DOTFILES_DIR" 2>/dev/null || {
df_print_info "Could not access dotfiles directory"
return
}
local last_version="" local last_version=""
[[ -f "$LAST_VERSION_FILE" ]] && last_version=$(cat "$LAST_VERSION_FILE") [[ -f "$LAST_VERSION_FILE" ]] && last_version=$(cat "$LAST_VERSION_FILE" 2>/dev/null)
if [[ -n "$last_version" && "$last_version" != "$DOTFILES_VERSION" ]]; then if [[ -n "$last_version" && "$last_version" != "$DOTFILES_VERSION" ]]; then
echo -e "Updated from ${DF_YELLOW}$last_version${DF_NC} to ${DF_GREEN}$DOTFILES_VERSION${DF_NC}" echo -e "Updated from ${DF_YELLOW}$last_version${DF_NC} to ${DF_GREEN}$DOTFILES_VERSION${DF_NC}"
@@ -412,7 +430,7 @@ show_changelog() {
echo "" echo ""
# Update version tracking # Update version tracking
echo "$DOTFILES_VERSION" > "$LAST_VERSION_FILE" echo "$DOTFILES_VERSION" > "$LAST_VERSION_FILE" 2>/dev/null || true
} }
# ============================================================================ # ============================================================================
@@ -458,11 +476,9 @@ EOF
main() { main() {
case "${1:-}" in case "${1:-}" in
--quick|-q) --quick|-q)
df_print_header "dotfiles-tour"
show_quick_overview show_quick_overview
;; ;;
--changelog|-c) --changelog|-c)
df_print_header "dotfiles-tour"
show_changelog show_changelog
;; ;;
--check) --check)