293 lines
8.9 KiB
Bash
Executable File
293 lines
8.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
if [ "$(id -u)" -eq 0 ]; then
|
|
printf "Don't run this script as root!"
|
|
exit 1
|
|
else
|
|
printf "not root"
|
|
fi
|
|
|
|
GREEN="$(tput setaf 2)[OK]$(tput sgr0)"
|
|
RED="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
|
YELLOW="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
|
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
|
BOLD=$(tput bold)
|
|
NORMAL=$(tput sgr0)
|
|
clear
|
|
LOG="install.log"
|
|
HYPRMOONARCH_DIR=$PWD
|
|
|
|
set -e
|
|
|
|
function pkg_inst () {
|
|
log "Checking if $1 is installed..."
|
|
if pacman -Qs $1; then
|
|
log "Found $IS_INSTALLED ...skipping"
|
|
else
|
|
log "$1 not found. Installing..."
|
|
paru -S $1 2>&1 | tee -a $LOG
|
|
fi
|
|
}
|
|
|
|
function inst_paru {
|
|
echo "-"
|
|
echo "Installing AUR helper ${BOLD}paru${NORMAL}?"
|
|
echo "${BOLD}paru${NORMAL} is mandatory."
|
|
|
|
if command -v paru > /dev/null 2>&1; then
|
|
echo "${BOLD}paru ${NORMAL}already installed. Skipping..."
|
|
else
|
|
echo -n "${BOLD}Continue?${NORMAL} (Y/N) "
|
|
read confirm_paru 2>&1 | tee -a $LOG
|
|
if [[ $confirm_paru == "Y" ]];
|
|
then
|
|
sudo pacman -Syu --needed base-devel 2>&1 | tee -a $LOG
|
|
sudo pacman -Syu rustup 2>&1 | tee -a $LOG
|
|
rustup default stable 2>&1 | tee -a $LOG
|
|
rustup update
|
|
|
|
rm -rf $HYPRMOONARCH_DIR/.cache/paru-git
|
|
git clone https://aur.archlinux.org/paru.git $HYPRMOONARCH_DIR/.cache/paru-git
|
|
cd $HYPRMOONARCH_DIR/.cache/paru-git
|
|
makepkg -si
|
|
cd $HYPRMOONARCH_DIR
|
|
|
|
git pull
|
|
|
|
mkdir -p $HOME/.local/bin
|
|
echo 'PATH="$HOME/.local/bin:$PATH"' | sudo tee -a /etc/environment >/dev/null
|
|
|
|
else
|
|
echo "exiting"
|
|
exit 1
|
|
fi
|
|
fi
|
|
}
|
|
|
|
function inst_sddm {
|
|
echo "-"
|
|
echo "Installing SDDM - Display/Login Manager"
|
|
|
|
declare -a pkg_list=(sddm qt5-quickcontrols qt5-graphicaleffects qt6-svg qt6-declarative)
|
|
for key in "${pkg_list[@]}"
|
|
do
|
|
pkg_inst $key
|
|
done
|
|
|
|
echo "set default user image"
|
|
sudo cp -f $HYPRMOONARCH_DIR/usr/share/sddm/faces/.face /usr/share/sddm/faces/.face
|
|
cp -f $HYPRMOONARCH_DIR/usr/share/sddm/faces/.face $HOME/.face
|
|
|
|
cd $HYPRMOONARCH_DIR/.cache
|
|
# wget --unlink https://github.com/catppuccin/sddm/releases/download/v1.0.0/catppuccin-mocha.zip
|
|
# sudo unzip catppuccin-mocha.zip -d /usr/share/sddm/themes/
|
|
git clone https://gitea.moonarch.de/nevaforget/moonarch-sddm.git
|
|
cp -R moonarch-sddm /usr/share/sddm/themes/
|
|
sudo rm -rf /usr/share/sddm/themes/moonarch-sddm/.git
|
|
sudo sed -i "s/^Current=.*/Current=moonarch-sddm/g" /etc/sddm.conf
|
|
|
|
sudo systemctl disable display-manager
|
|
sudo systemctl enable sddm
|
|
|
|
cd $HYPRMOONARCH_DIR
|
|
}
|
|
|
|
function inst_pkgs {
|
|
log "-"
|
|
log "Installing ${BOLD}Arch packages.${NORMAL}"
|
|
log "This includes all neccessary dependencies. You definitely want this."
|
|
log "${BOLD}Continue?${NORMAL} (Y/N) "
|
|
read confirm_basics
|
|
log "$confirm_basics"
|
|
if [[ $confirm_basics == "Y" ]];
|
|
then
|
|
|
|
declare -a pkg_list=(jq network-manager-applet alarm-clock-applet man-db hardinfo networkmanager-openvpn udisks2 plocate vim alacritty gettext-hostname neovim lsd alsa-utils ponymix btop powertop polkit polkit-gnome timeshift timeshift-autosnap pcmanfm librewolf-bin fzf unzip wayland hyprland hypridle hyprlock hyprcursor hyprkeys hyprpicker swww waypaper xdg-desktop-portal-hyprland wdisplays waybar nwg-look cliphist wlogout swayosd hyprlock waybar-module-pacman-updates swaync ufw zsh oh-my-zsh noise-suppression-for-voice grim satty-bin slurp)
|
|
|
|
for key in "${pkg_list[@]}"
|
|
do
|
|
pkg_inst $key
|
|
done
|
|
|
|
sudo cp $HYPRMOONARCH_DIR/usr/local/bin/{*} /usr/local/bin/
|
|
|
|
paru -S informant
|
|
sudo informant read --all
|
|
fi
|
|
|
|
cd $HYPRMOONARCH_DIR
|
|
}
|
|
|
|
function inst_bluet {
|
|
echo "-"
|
|
echo "Installing ${BOLD}Bluetooth${NORMAL} Support"
|
|
echo -n "${BOLD}Continue?${NORMAL} (Y/N) "
|
|
read confirm_bluet
|
|
if [[ $confirm_bluet == "Y" ]];
|
|
then
|
|
declare -a pkg_list=(bluez bluez-utils-compat blueberry)
|
|
for key in "${pkg_list[@]}"
|
|
do
|
|
pkg_inst $key
|
|
done
|
|
|
|
sudo systemctl start bluetooth.service
|
|
sudo systemctl enable bluetooth.service
|
|
fi
|
|
|
|
cd $HYPRMOONARCH_DIR
|
|
}
|
|
|
|
function inst_davfs {
|
|
echo "-"
|
|
echo "Installing ${BOLD}WebDAV / davfs2${NORMAL} support, including pcmanfm support"
|
|
echo -n "${BOLD}Continue?${NORMAL} (Y/N) "
|
|
read confirm_davfs
|
|
if [[ $confirm_davfs == "Y" ]];
|
|
then
|
|
declare -a pkg_list=(davfs2 gvfs gvfs-dnssd)
|
|
for key in "${pkg_list[@]}"
|
|
do
|
|
pkg_inst $key
|
|
done
|
|
|
|
sudo usermod -a -G davfs2 $USER
|
|
fi
|
|
|
|
cd $HYPRMOONARCH_DIR
|
|
}
|
|
|
|
function inst_clamav {
|
|
echo "-"
|
|
echo "Installing ClamAV - Anti-Virus Scanner with freshclam and fangfrisch"
|
|
echo -n "${BOLD}Continue?${NORMAL} (Y/N) "
|
|
read confirm_clamav
|
|
if [[ $confirm_clamav == "Y" ]];
|
|
then
|
|
declare -a pkg_list=(clamav python-fangfrisch)
|
|
for key in "${pkg_list[@]}"
|
|
do
|
|
pkg_inst $key
|
|
done
|
|
|
|
sudo systemctl start clamav-daemon.service
|
|
sudo systemctl enable clamav-daemon.service
|
|
sudo freshclam
|
|
sudo -u clamav /usr/bin/fangfrisch --conf /etc/fangfrisch/fangfrisch.conf initdb
|
|
sudo systemctl enable fangfrisch.timer
|
|
|
|
if command -v nemo &> /dev/null
|
|
then
|
|
cp -Rf $HYPRMOONARCH_DIR/usr/share/nemo/actions/clamscan.nemo_action /usr/share/nemo/actions
|
|
fi
|
|
|
|
fi
|
|
|
|
cd $HYPRMOONARCH_DIR
|
|
}
|
|
|
|
function rebooter {
|
|
echo "-"
|
|
echo "I recommend to reboot at this point. But you should at least log out and in again."
|
|
echo -n "${BOLD}Continue with Reboot?${NORMAL} (Y/N) "
|
|
read confirm_rebot
|
|
if [[ $confirm_rebot == "Y" ]];
|
|
then
|
|
sudo reboot
|
|
fi
|
|
}
|
|
|
|
function setup {
|
|
# ZSH
|
|
log "Cloning ZSH Plugins..."
|
|
sudo git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
|
log "Done... zsh-autosuggestions"
|
|
sudo git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
|
log "Done... zsh-syntax-highlighting"
|
|
sudo git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
|
|
log "Done... powerlevel10k"
|
|
chsh -s /usr/bin/zsh
|
|
log "Done... Set zsh as default shell"
|
|
|
|
# GUI
|
|
log "Set up GUI Themes"
|
|
gsettings set org.gnome.desktop.interface gtk-theme "Catppuccin-Mocha-Standard-Lavender-Dark"
|
|
log "Done... Window decorations"
|
|
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
|
log "Done... Set color-scheme to prefer-dark"
|
|
gsettings set org.gnome.desktop.interface cursor-theme Sweet-cursors
|
|
log "Done... Set a sweet cursor"
|
|
|
|
hyprpm update
|
|
hyprpm add https://github.com/DreamMaoMao/hycov
|
|
hyprpm enable hycov
|
|
|
|
# Extra Font
|
|
sudo mkdir -p /usr/local/share/fonts/
|
|
sudo install -C $HYPRMOONARCH_DIR/usr/local/share/fonts/MonarchOS.ttf /usr/local/share/fonts/MonarchOS.ttf
|
|
sudo install -C $HYPRMOONARCH_DIR/usr/local/share/fonts/Icomoon-Feather.ttf /usr/local/share/fonts/Icomoon-Feather.ttf
|
|
sudo install -C $HYPRMOONARCH_DIR/etc/fonts/local.conf /etc/fonts/local.conf
|
|
fc-cache -f
|
|
|
|
# Wallpaper
|
|
WALLPAPER_DIR=$HOME/Pictures/Wallpaper
|
|
if [ ! -d "$WALLPAPER_DIR" ]; then
|
|
mkdir -p $WALLPAPER_DIR
|
|
fi
|
|
install -C $HYPRMOONARCH_DIR/home/Pictures/Wallpaper/MonarchOS.png $WALLPAPER_DIR/MonarchOS.png
|
|
|
|
# dotfiles
|
|
log "Time stow things up"
|
|
cp -R $HYPRMOONARCH_DIR/home/config/ $HOME/.hyprmoonarch-dotfiles/.config/
|
|
cp -R $HYPRMOONARCH_DIR/home/.bashrc $HOME/.hyprmoonarch-dotfiles/.bashrc
|
|
cp -R $HYPRMOONARCH_DIR/home/.zshrc $HOME/.hyprmoonarch-dotfiles/.zshrc
|
|
cp -R $HYPRMOONARCH_DIR/home/.p10k.zsh $HOME/.hyprmoonarch-dotfiles/.p10k.zsh
|
|
cd $HOME/.hyprmoonarch-dotfiles/
|
|
stow .
|
|
|
|
cd $HYPRMOONARCH_DIR
|
|
}
|
|
|
|
function init {
|
|
|
|
rm -f $LOG
|
|
|
|
mkdir $HYPRMOONARCH_DIR/.cache
|
|
mkdir $HOME/.hyprmoonarch-dotfiles
|
|
|
|
log "Installation start\n"
|
|
|
|
inst_paru
|
|
|
|
type paru >/dev/null 2>&1 || { echo >&2 "I require paru but it's not installed. Aborting."; exit 1; }
|
|
|
|
inst_sddm
|
|
inst_pkgs
|
|
|
|
setup
|
|
|
|
inst_bluet
|
|
inst_clamav
|
|
inst_davfs
|
|
|
|
rebooter
|
|
}
|
|
|
|
printf "#####################################\n"
|
|
printf "$(tput setaf 2)Welcome to MoonArch. Feel free.\n@version 1.0\n$(tput sgr0)"
|
|
printf "#####################################\n"
|
|
printf "\n"
|
|
printf "$(tput setaf 1)Don't run this script as ROOT!\n$(tput sgr0)"
|
|
printf "\n"
|
|
printf "${YELLOW} ${BOLD}This will clear and overwrite some config files\nand this can not be reverted. No Backups are created!\n "
|
|
printf "\n"
|
|
echo -n "${BOLD}Continue?${NORMAL} (Y/N) "
|
|
read confirm
|
|
|
|
if [[ $confirm == "Y" ]];
|
|
then
|
|
init
|
|
else
|
|
echo "Goodbye sweet butterfly"
|
|
exit 1
|
|
fi |