aboutsummaryrefslogtreecommitdiff
path: root/install.sh
blob: 4fe87f48beaf098cec322dd61bf09b477663b27f (plain)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#!/bin/env bash

pkg_utils=(
    "fd"
    "ffmpegthumbnailer"
    "foot"
    "fuzzel"
    "fzf"
    "gammastep"
    "ghostscript"
    "gobject-introspection"
    "gparted"
    "grub"
    "gvfs"
    "gvfs-mtp"
    "imagemagick"
    "imlib2"
    "jq"
    "kanshi"
    "lf"
    "libnotify"
    "libreoffice-fresh"
    "lua"
    "lvm2"
    "man-db"
    "meson"
    "mpc"
    "mpd"
    "mpd-mpris"
    "mpv"
    "ncdu"
    "ncmpcpp"
    "ntfs-3g"
    "nwg-look"
    "pacman-contrib"
    "pamixer"
    "pavucontrol"
    "pcmanfm"
    "pipewire"
    "pipewire-pulse"
    "progress"
    "python-gobject"
    "python-pip"
    "python-virtualenv"
    "qpdf"
    "reflector"
    "ripgrep"
    "rsync"
    "sshfs"
    "stow"
    "tesseract"
    "torbrowser-launcher"
    "transmission-cli"
    "noto-fonts"
    "noto-fonts-cjk"
    "noto-fonts-emoji"
    "ttf-jetbrains-mono-nerd"
    "tree"
    "unzip"
    "waybar"
    "wget"
    "woff2-font-awesome"
    "wtype"
    "xarchiver"
    "xdg-user-dirs"
    "yt-dlp"
    "zathura"
    "zathura-pdf-mupdf"
    "zip"
    "zola"
    "zsh"
    "zsh-autosuggestions"
)

pkg_dev_tools=(
    "git"
    "neovim"
    "platformio-core"
    "tmux"
    "nodejs"
    "lazygit"
)

pkg_optional=(
    "keepassxc"
    "obsidian"
    "syncthing"
    "newsboat"
    "obs-studio"
    "telegram-desktop"
)

pkg_nvidia=(
    "nvidia"
    "nvidia-utils"
)

pkg_desktop=(
    "hypridle"
    "hyprland"
    "hyprlock"
    "hyprpaper"
    "hyprpicker"
    "hyprpolkitagent"
    "hyprshot"
    "xdg-desktop-portal-hyprland"
    "swaync"
    "waybar"
)

pkg_aur=(
    "envycontrol"
    "htop-vim"
    "jmtpfs"
    "keepmenu"
    "keyd-git"
    "librewolf-bin"
    "python-pywal16"
    "tokyonight-gtk-theme-git"
    "zsh-fast-syntax-highlighting-git"
)


# Install necessary desktop packages
sudo pacman -S --needed "${pkg_desktop[@]}" "${pkg_utils[@]}"

# Install dev tools
read -rp "Do you wish to development tools? [y/n]" install_dev_tools
if [[ $install_dev_tools == y ]]; then
    sudo pacman -S --needed "${pkg_dev_tools[@]}"
fi

# Install optional packages
read -rp "Do you wish to install optional packages? [y/n]" install_optional_pkg
if [[ $install_optional_pkg == y ]]; then
    sudo pacman -S --needed "${pkg_optional[@]}"
fi

# Install nvidia drivers
read -rp "Do you wish to install Nvidia drivers? [y/n]" install_nvidia_drivers
if [[ $install_nvidia_drivers == y ]]; then
    sudo pacman -S --needed "${pkg_nvidia[@]}"
fi


# Install aur packages
read -rp "Do you wish to aur packages? [y/n]" install_aur_pkg
# Install paru if it isn't already installed
if [[ $install_aur_pkg == y ]]; then
    if ! command -v paru >/dev/null 2>&1; then
        echo "Installing paru..."
        git clone https://aur.archlinux.org/paru-bin.git
        cd paru-bin
        makepkg -sri
        cd ..
        rm -rf paru-bin
    else
        echo "Skipping paru (already in PATH)"
    fi
# Install aur packages
paru -S --needed  "${pkg_aur[@]}"
fi


# Setup dotfiles
echo "⚠️  WARNING: This will DELETE any conflicting files and replace them with symlinks from this repo."
echo "   Make sure your dotfiles repo is the source of truth / already backed up."
read -rp "Continue with stow (y/N): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
    echo "Detecting conflicts..."
    conflicts=$(stow . --no-folding -nv 2>&1 | \
        sed -n 's/.*existing target \(.*\) since neither.*/\1/p')

    if [[ -z "$conflicts" ]]; then
        echo "No conflicts. Running stow normally..."
        stow . --no-folding
        echo "✅ Done."
    else
        echo "These paths conflict and will be removed:"
        printf '  %s\n' $conflicts
        read -rp "Proceed with deleting these files? (y/N): " ok
        if [[ ! "$ok" =~ ^[Yy]$ ]]; then
            echo "Aborted."
        fi

    # Remove conflicts relative to $HOME
    for path in $conflicts; do
        echo "Removing $HOME/$path"
        rm -rf "$HOME/$path"
    done

    echo "Running stow..."
    stow . --no-folding
    echo "✅ Dotfiles stowed with overwrite."
    fi
else
    echo "Aborted"
fi