This commit is contained in:
Stephan Raabe 2023-08-17 20:56:53 +02:00
parent d304b57617
commit ac0c3b3f79
4 changed files with 252 additions and 95 deletions

View File

@ -10,6 +10,12 @@
# Install Script for dotfiles and configuration
# yay must be installed
# ------------------------------------------------------
# ------------------------------------------------------
# Load Library
# ------------------------------------------------------
source $(dirname "$0")/scripts/library.sh
clear
echo " _ _ __ _ _ "
echo " __| | ___ | |_ / _(_) | ___ ___ "
@ -21,7 +27,7 @@ echo "by Stephan Raabe (2023)"
echo "-------------------------------------"
echo ""
echo "The script will not remove any folders or files."
echo "Symbolic links will be created instead if the folder or files doesn't exists."
echo "Symbolic links will be created instead when the folder or files doesn't exists."
echo "If you want to overwrite your configuration please remove the correspondig folder in your .config first."
echo "(For example ~/.config/qtile, etc.)"
echo ""
@ -61,81 +67,11 @@ done
echo ""
echo "-> Install main packages"
packagesPacman=("alacritty" "scrot" "nitrogen" "picom" "starship" "slock" "neovim" "rofi" "dunst" "mpv" "freerdp" "xfce4-power-manager" "thunar" "mousepad" "ttf-font-awesome" "ttf-fira-sans" "ttf-fira-code" "ttf-firacode-nerd" "figlet" "lxappearance" "polybar" "breeze" "breeze-gtk" "rofi-calc" "vlc" "exa" "python-pip" "python-psutil" "python-rich" "python-click");
packagesPacman=("alacritty" "chromium" "scrot" "nitrogen" "starship" "slock" "neovim" "mpv" "freerdp" "xfce4-power-manager" "thunar" "mousepad" "ttf-font-awesome" "ttf-fira-sans" "ttf-fira-code" "ttf-firacode-nerd" "figlet" "lxappearance" "breeze" "breeze-gtk" "vlc" "exa" "python-pip" "python-psutil" "python-rich" "python-click");
packagesYay=("brave-bin" "pfetch" "bibata-cursor-theme");
# pywal installation below
# ------------------------------------------------------
# Function: Is package installed
# ------------------------------------------------------
_isInstalledPacman() {
package="$1";
check="$(sudo pacman -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
_isInstalledYay() {
package="$1";
check="$(yay -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
# ------------------------------------------------------
# Function Install all package if not installed
# ------------------------------------------------------
_installPackagesPacman() {
toInstall=();
for pkg; do
if [[ $(_isInstalledPacman "${pkg}") == 0 ]]; then
echo "${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All pacman packages are already installed.";
return;
fi;
printf "Packages not installed:\n%s\n" "${toInstall[@]}";
sudo pacman --noconfirm -S "${toInstall[@]}";
}
_installPackagesYay() {
toInstall=();
for pkg; do
if [[ $(_isInstalledYay "${pkg}") == 0 ]]; then
echo "${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All packages are already installed.";
return;
fi;
printf "AUR ackages not installed:\n%s\n" "${toInstall[@]}";
yay --noconfirm -S "${toInstall[@]}";
}
# ------------------------------------------------------
# Install required packages
# ------------------------------------------------------
@ -168,28 +104,6 @@ fi
echo ""
echo "-> Install symbolic links"
_installSymLink() {
symlink="$1";
linksource="$2";
linktarget="$3";
if [ -L "${symlink}" ]; then
echo "Link ${symlink} exists already."
else
if [ -d ${symlink} ]; then
echo "Directory ${symlink}/ exists."
ln -s ${linksource} ${linktarget}
else
if [ -f ${symlink} ]; then
echo "File ${symlink} exists."
ln -s ${linksource} ${linktarget}
else
ln -s ${linksource} ${linktarget}
echo "Link ${linksource} -> ${linktarget} created."
fi
fi
fi
}
_installSymLink ~/.config/alacritty ~/dotfiles/alacritty/ ~/.config
_installSymLink ~/.config/picom ~/dotfiles/picom/ ~/.config
_installSymLink ~/.config/rofi ~/dotfiles/rofi/ ~/.config
@ -236,6 +150,7 @@ while true; do
esac
done
_installSymLink ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc
# ------------------------------------------------------
# Install Theme, Icons and Cursor
# ------------------------------------------------------

View File

@ -41,7 +41,89 @@ echo ""
# ------------------------------------------------------
# Install required packages
# ------------------------------------------------------
sudo pacman -S --noconfirm qtile
echo ""
echo "-> Install main packages"
packagesPacman=("qtile" "picom" "rofi" "dunst" "polybar" "rofi-calc");
# packagesYay=("brave-bin" "pfetch" "bibata-cursor-theme");
# pywal installation below
# ------------------------------------------------------
# Function: Is package installed
# ------------------------------------------------------
_isInstalledPacman() {
package="$1";
check="$(sudo pacman -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
_isInstalledYay() {
package="$1";
check="$(yay -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
# ------------------------------------------------------
# Function Install all package if not installed
# ------------------------------------------------------
_installPackagesPacman() {
toInstall=();
for pkg; do
if [[ $(_isInstalledPacman "${pkg}") == 0 ]]; then
echo "${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All pacman packages are already installed.";
return;
fi;
printf "Packages not installed:\n%s\n" "${toInstall[@]}";
sudo pacman --noconfirm -S "${toInstall[@]}";
}
_installPackagesYay() {
toInstall=();
for pkg; do
if [[ $(_isInstalledYay "${pkg}") == 0 ]]; then
echo "${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All packages are already installed.";
return;
fi;
printf "AUR ackages not installed:\n%s\n" "${toInstall[@]}";
yay --noconfirm -S "${toInstall[@]}";
}
# ------------------------------------------------------
# Install required packages
# ------------------------------------------------------
_installPackagesPacman "${packagesPacman[@]}";
# _installPackagesYay "${packagesYay[@]}";
# ------------------------------------------------------
# Create symbolic links

54
3-hyprland.conf Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
# _ _ _ _
# | | | |_ _ _ __ _ __| | __ _ _ __ __| |
# | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` |
# | _ | |_| | |_) | | | | (_| | | | | (_| |
# |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_|
# |___/|_|
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
# Install Script for Hyprland
# ------------------------------------------------------
# ------------------------------------------------------
# Confirm Start
# ------------------------------------------------------
clear
echo " ___ _____ ___ _ _____ "
echo " / _ \_ _|_ _| | | ____| "
echo "| | | || | | || | | _| "
echo "| |_| || | | || |___| |___ "
echo " \__\_\|_| |___|_____|_____| "
echo " "
echo "by Stephan Raabe (2023)"
echo "------------------------------------------------------"
echo ""
while true; do
read -p "DO YOU WANT TO START THE INSTALLATION NOW? (Yy/Nn): " yn
case $yn in
[Yy]* )
echo "Installation started."
break;;
[Nn]* )
exit;
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
# ------------------------------------------------------
# Install required packages
# ------------------------------------------------------
sudo pacman -S --noconfirm qtile
# ------------------------------------------------------
# Create symbolic links
# ------------------------------------------------------
echo "-> Create symbolic link for startx"
rm ~/.xinitrc
ln -s ~/dotfiles/qtile/.xinitrc ~/.xinitrc
echo "DONE!"

106
scripts/library.sh Executable file
View File

@ -0,0 +1,106 @@
#!/bin/bash
# _ _ _
# | | (_) |__ _ __ __ _ _ __ _ _
# | | | | '_ \| '__/ _` | '__| | | |
# | |___| | |_) | | | (_| | | | |_| |
# |_____|_|_.__/|_| \__,_|_| \__, |
# |___/
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
# ------------------------------------------------------
# Function: Is package installed
# ------------------------------------------------------
_isInstalledPacman() {
package="$1";
check="$(sudo pacman -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
_isInstalledYay() {
package="$1";
check="$(yay -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
# ------------------------------------------------------
# Function Install all package if not installed
# ------------------------------------------------------
_installPackagesPacman() {
toInstall=();
for pkg; do
if [[ $(_isInstalledPacman "${pkg}") == 0 ]]; then
echo "${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All pacman packages are already installed.";
return;
fi;
printf "Packages not installed:\n%s\n" "${toInstall[@]}";
sudo pacman --noconfirm -S "${toInstall[@]}";
}
_installPackagesYay() {
toInstall=();
for pkg; do
if [[ $(_isInstalledYay "${pkg}") == 0 ]]; then
echo "${pkg} is already installed.";
continue;
fi;
toInstall+=("${pkg}");
done;
if [[ "${toInstall[@]}" == "" ]] ; then
# echo "All packages are already installed.";
return;
fi;
printf "AUR ackages not installed:\n%s\n" "${toInstall[@]}";
yay --noconfirm -S "${toInstall[@]}";
}
# ------------------------------------------------------
# Create symbolic links
# ------------------------------------------------------
_installSymLink() {
symlink="$1";
linksource="$2";
linktarget="$3";
if [ -L "${symlink}" ]; then
echo "Link ${symlink} exists already."
else
if [ -d ${symlink} ]; then
echo "Directory ${symlink}/ exists."
ln -s ${linksource} ${linktarget}
else
if [ -f ${symlink} ]; then
echo "File ${symlink} exists."
ln -s ${linksource} ${linktarget}
else
ln -s ${linksource} ${linktarget}
echo "Link ${linksource} -> ${linktarget} created."
fi
fi
fi
}