-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathdotsSetup.sh
More file actions
executable file
·131 lines (107 loc) · 4.94 KB
/
dotsSetup.sh
File metadata and controls
executable file
·131 lines (107 loc) · 4.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/bash
# ============================================================
# dotsSetup.sh — HyprFlux dotfiles setup orchestrator
# ============================================================
# Sources shared libraries, defines config variables, then
# iterates through modules/[0-9]*.sh in sorted order.
#
# Modules are sourced (not subprocesses) so they share all
# variables and functions. Each module can be skipped via
# SKIP_MODULES env var (comma-separated).
#
# Example: SKIP_MODULES="plymouth,grub" bash dotsSetup.sh
# ============================================================
set -e
# ====== Resolve paths ======
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# ====== Source shared libraries ======
source "$SCRIPT_DIR/lib/common.sh"
source "$SCRIPT_DIR/lib/packages.sh"
source "$SCRIPT_DIR/lib/git.sh"
# ====== Logging ======
# BUG FIX: removed dead mkdir + LOG_FILE assignment that wrote to
# $HOME/installer_log. Single tee via setup_logging — no more
# double tee (exec tee + per-command tee).
setup_logging "$HOME/hyprflux_log/dotsSetup.log"
# ====== Sudo ======
setup_sudo
# ============================================================
# Config variables — all overridable via environment
# ============================================================
# Repos
REPO_URL="${REPO_URL:-https://github.com/ahmad9059/HyprFlux.git}"
REPO_URL_NVIM="${REPO_URL_NVIM:-https://github.com/ahmad9059/nvim}"
TMUXIFIER_REPO="${TMUXIFIER_REPO:-https://github.com/jimeh/tmuxifier.git}"
# Paths
# BUG FIX: use $REPO_DIR everywhere instead of mixing $HOME/HyprFlux
REPO_DIR="${REPO_DIR:-$HOME/HyprFlux}"
BACKUP_DIR="${BACKUP_DIR:-$HOME/dotfiles_backup}"
# Waybar
WAYBAR_STYLE_TARGET="${WAYBAR_STYLE_TARGET:-$HOME/.config/waybar/style.css}"
WAYBAR_LAYOUT_TARGET="${WAYBAR_LAYOUT_TARGET:-$HOME/.config/waybar/config}"
CUSTOM_WAYBAR_STYLE="${CUSTOM_WAYBAR_STYLE:-$HOME/.config/waybar/style/Catppuccin Mocha Custom.css}"
CUSTOM_WAYBAR_LAYOUT="${CUSTOM_WAYBAR_LAYOUT:-$HOME/.config/waybar/configs/[TOP] Default Laptop}"
# Neovim
NVIM_CONFIG_DIR="${NVIM_CONFIG_DIR:-$HOME/.config/nvim}"
# SDDM
SDDM_THEME_NAME="${SDDM_THEME_NAME:-HyprFlux-sddm-theme}"
SDDM_THEME_SOURCE="${SDDM_THEME_SOURCE:-$REPO_DIR/utilities/$SDDM_THEME_NAME}"
SDDM_THEME_DEST="${SDDM_THEME_DEST:-/usr/share/sddm/themes/$SDDM_THEME_NAME}"
SDDM_CONF="${SDDM_CONF:-/etc/sddm.conf}"
# GRUB theme
GRUB_THEME_ARCHIVE="${GRUB_THEME_ARCHIVE:-$REPO_DIR/utilities/HyprFlux-1080p.tar.xz}"
GRUB_THEME_DIR="${GRUB_THEME_DIR:-/tmp/hyprflux-grub}"
# Web apps
DESKTOP_DIR="${DESKTOP_DIR:-$HOME/.local/share/applications}"
ICON_DIR="${ICON_DIR:-$HOME/.local/share/icons/apps}"
BROWSER="${BROWSER:-chromium}"
WEBAPPS_CONF="${WEBAPPS_CONF:-$SCRIPT_DIR/config/webapps.conf}"
# AI tools
AI_TOOLS_AUR_PACKAGES="${AI_TOOLS_AUR_PACKAGES:-claude-code opencode-bin openai-codex-bin gemini-cli}"
# Wallpapers
WALLPAPER_REPO="${WALLPAPER_REPO:-https://github.com/ahmad9059/wallpapers-bank}"
WALLPAPER_DIR="${WALLPAPER_DIR:-$HOME/Pictures/wallpapers}"
# Plymouth
PLYMOUTH_THEME_ARCHIVE="${PLYMOUTH_THEME_ARCHIVE:-$REPO_DIR/utilities/hyprflux-plymouth.tar.xz}"
PLYMOUTH_THEME_DIR="${PLYMOUTH_THEME_DIR:-/tmp/hyprflux-plymouth}"
PLYMOUTH_THEME_NAME="${PLYMOUTH_THEME_NAME:-hyprflux}"
# Bibata cursor
# BUG FIX: cursor size unified to 24 (was 20 in sed update path, 24 in create path)
CURSOR_SIZE="${CURSOR_SIZE:-24}"
BIBATA_CURSOR_URL="${BIBATA_CURSOR_URL:-https://github.com/LOSEARDES77/Bibata-Cursor-hyprcursor/releases/download/1.0/hypr_Bibata-Modern-Classic.tar.gz}"
# GTK
GTK_THEME="${GTK_THEME:-HyprFlux-Compact}"
ICON_THEME="${ICON_THEME:-Papirus-Dark}"
CURSOR_THEME="${CURSOR_THEME:-Future-black Cursors}"
FONT_NAME="${FONT_NAME:-Adwaita Sans 11}"
# ============================================================
# Run modules in order
# ============================================================
_module_count=0
_module_failed=0
for _module_file in "$SCRIPT_DIR"/modules/[0-9]*.sh; do
if [[ ! -f "$_module_file" ]]; then
continue
fi
_module_basename="$(basename "$_module_file")"
log_info "────────────────────────────────────────"
log_info "Running module: $_module_basename"
log_info "────────────────────────────────────────"
if source "$_module_file"; then
_module_count=$((_module_count + 1))
else
log_error "Module $_module_basename failed!"
_module_failed=$((_module_failed + 1))
fi
done
# ============================================================
# Summary
# ============================================================
echo -e "\n"
if [[ $_module_failed -eq 0 ]]; then
log_ok "!!======= Dotfiles setup complete! ($_module_count modules ran) =========!!"
else
log_warn "Dotfiles setup finished with $_module_failed failure(s) out of $((_module_count + _module_failed)) modules."
fi
echo -e "\n"
unset _module_count _module_failed _module_file _module_basename