update install script

This commit is contained in:
sankalp committed 2025-03-01 04:00:40 +05:45
1 parent 2c79e08d38
commit 7322e33028
1 file changed
+33 -19
+33 -19
View File
@@ -35,11 +35,15 @@ PACKAGES=(
brightnessctl brightnessctl
wlinhibit wlinhibit
power-profile-daemon power-profile-daemon
ttf-font-awesome
otf-font-awesome
ttf-material-symbols-variable-git
ttf-google-sans ttf-google-sans
ttf-opensans ttf-opensans
ttf-tabler-icons ttf-robot
) )
# Ensure running on Arch Linux
if ! grep -q "arch" /etc/os-release; then if ! grep -q "arch" /etc/os-release; then
echo "This script is designed to run on Arch Linux." echo "This script is designed to run on Arch Linux."
exit 1 exit 1
@@ -51,13 +55,12 @@ if [ "$(id -u)" -eq 0 ]; then
exit 1 exit 1
fi fi
# Check for AUR helper (yay or paru)
aur_helper="" aur_helper=""
if command -v yay &>/dev/null; then if command -v yay &>/dev/null; then
aur_helper="yay" aur_helper="yay"
echo $aur_helper
elif command -v paru &>/dev/null; then elif command -v paru &>/dev/null; then
aur_helper="paru" aur_helper="paru"
echo $aur_helper
else else
echo "Installing paru..." echo "Installing paru..."
tmpdir=$(mktemp -d) tmpdir=$(mktemp -d)
@@ -66,9 +69,10 @@ else
makepkg -si --noconfirm makepkg -si --noconfirm
cd - >/dev/null cd - >/dev/null
rm -rf "$tmpdir" rm -rf "$tmpdir"
aur_helper="paru"
fi fi
# Clone or update the repository # Clone or update the Modus repository
if [ -d "$INSTALL_DIR" ]; then if [ -d "$INSTALL_DIR" ]; then
echo "Updating Modus..." echo "Updating Modus..."
git -C "$INSTALL_DIR" pull git -C "$INSTALL_DIR" pull
@@ -77,14 +81,13 @@ else
git clone "$REPO_URL" "$INSTALL_DIR" git clone "$REPO_URL" "$INSTALL_DIR"
fi fi
# Install required packages using $aur_helper (only if missing # Install required packages using the AUR helper
echo "Installing required packages..." echo "Installing required packages..."
$aur_helper -Syy --needed --noconfirm "${PACKAGES[@]}" || true $aur_helper -Syy --needed --noconfirm "${PACKAGES[@]}" || true
# Update outdated packages from the list # Update outdated packages
echo "Updating outdated required packages..." echo "Checking for outdated packages..."
# Get a list of outdated packages outdated=$($aur_helper -Qu | awk '{print $1}' || true)
outdated=$($aur_helper -Qu | awk '{print $1}')
to_update=() to_update=()
for pkg in "${PACKAGES[@]}"; do for pkg in "${PACKAGES[@]}"; do
if echo "$outdated" | grep -q "^$pkg\$"; then if echo "$outdated" | grep -q "^$pkg\$"; then
@@ -93,29 +96,40 @@ for pkg in "${PACKAGES[@]}"; do
done done
if [ ${#to_update[@]} -gt 0 ]; then if [ ${#to_update[@]} -gt 0 ]; then
echo "Updating outdated packages..."
$aur_helper -S --noconfirm "${to_update[@]}" || true $aur_helper -S --noconfirm "${to_update[@]}" || true
else else
echo "All required packages are up-to-date." echo "All required packages are up-to-date."
fi fi
# Backup and replace GTK configs # Backup and replace GTK configurations
echo "Updating GTK configurations..." echo "Updating GTK configurations..."
mkdir -p "$HOME/.config" mkdir -p "$HOME/.config"
[[ -d "$HOME/.config/gtk-3.0" ]] && mv "$HOME/.config/gtk-3.0" "$HOME/.config/gtk-3.0-bk" [[ -d "$HOME/.config/gtk-3.0" ]] && mv "$HOME/.config/gtk-3.0" "$HOME/.config/gtk-3.0-bk-$(date +%s)"
[[ -d "$HOME/.config/gtk-4.0" ]] && mv "$HOME/.config/gtk-4.0" "$HOME/.config/gtk-4.0-bk" [[ -d "$HOME/.config/gtk-4.0" ]] && mv "$HOME/.config/gtk-4.0" "$HOME/.config/gtk-4.0-bk-$(date +%s)"
cp -r "$INSTALL_DIR/assets/gtk-3.0" "$HOME/.config/" cp -r "$INSTALL_DIR/assets/gtk-3.0" "$HOME/.config/" || true
cp -r "$INSTALL_DIR/assets/gtk-4.0" "$HOME/.config/" cp -r "$INSTALL_DIR/assets/gtk-4.0" "$HOME/.config/" || true
# Install Icon # Install Icon Theme
echo "Installing icon theme..." echo "Installing Tela icon theme..."
tmpdir=$(mktemp -d) tmpdir=$(mktemp -d)
cd /tmp/install git clone https://github.com/vinceliuice/Tela-icon-theme "$tmpdir/Tela-icon-theme"
git clone https://github.com/vinceliuice/Tela-icon-theme
cd "$tmpdir/Tela-icon-theme" cd "$tmpdir/Tela-icon-theme"
./install.sh nord ./install.sh nord
rm -rf "$tmpdir"
# Launch Modus without terminal output # Install Vencord
echo "Installing Vencord..."
if command -v curl &>/dev/null; then
sh -c "$(curl -sS https://raw.githubusercontent.com/Vendicated/VencordInstaller/main/install.sh)" || true
mkdir -p "$HOME/.config/Vencord/settings/"
ln -sf "$HOME/.cache/material/material-discord.css" "$HOME/.config/Vencord/settings/quickCss.css"
else
echo "Skipping Vencord installation (curl not found)."
fi
# Launch Modus
echo "Starting Modus..." echo "Starting Modus..."
killall modus 2>/dev/null || true killall modus 2>/dev/null || true
python "$INSTALL_DIR/main.py" >/dev/null 2>&1 & python "$INSTALL_DIR/main.py" >/dev/null 2>&1 &