This commit is contained in:
Stephan Raabe
2023-11-10 21:12:15 +00:00
parent eca6b8659a
commit ea2a6adbf0
137 changed files with 2941 additions and 4897 deletions
+46
View File
@@ -0,0 +1,46 @@
# ------------------------------------------------------
# Backup existing dotfiles
# ------------------------------------------------------
datets=$(date '+%Y%m%d%H%M%S')
if [ -d ~/dotfiles ]; then
cat <<"EOF"
____ _
| __ ) __ _ ___| | ___ _ _ __
| _ \ / _` |/ __| |/ / | | | '_ \
| |_) | (_| | (__| <| |_| | |_) |
|____/ \__,_|\___|_|\_\\__,_| .__/
|_|
EOF
echo "The script has detected an existing dotfiles folder and will try to create a backup into the folder ~/dotfiles-versions/backups/$datets"
echo ""
while true; do
read -p "Do you want to proceed? (Yy/Nn): " yn
case $yn in
[Yy]* )
echo "-> Preparing dotfiles"
if [ ! -d ~/dotfiles-versions ]; then
mkdir ~/dotfiles-versions
fi
if [ ! -d ~/dotfiles-versions/backups ]; then
mkdir ~/dotfiles-versions/backups
fi
if [ -d ~/dotfiles ]; then
cp -r ~/dotfiles ~/dotfiles-versions/backups/$datets
echo "Backup of your current dotfiles in ~/dotfiles-versions/backups/$datets created."
fi
if [ -f ~/.bashrc ]; then
cp ~/.bashrc ~/dotfiles-versions/backups/$datets/.bashrc-old
echo "Existing .bashrc file found in homefolder. .bashrc-old created"
fi
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
fi
+19
View File
@@ -0,0 +1,19 @@
# ------------------------------------------------------
# Install .bashrc
# ------------------------------------------------------
echo "-> Install .bashrc"
echo "PLEASE BACKUP YOUR .bashrc file in case you want to keep your local configuration and aliases."
while true; do
read -p "Do you want to install the .bashrc file? (Yy/Nn): " yn
case $yn in
[Yy]* )
_installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc
break;;
[Nn]* )
echo "Installation skipped."
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
+11
View File
@@ -0,0 +1,11 @@
# ------------------------------------------------------
# Create .config folder
# ------------------------------------------------------
if [ -d ~/.config ]; then
echo ".config folder already exists."
else
mkdir ~/.config
echo ".config folder created."
fi
echo ""
+34
View File
@@ -0,0 +1,34 @@
# ------------------------------------------------------
# Confirm Start
# ------------------------------------------------------
echo "IMPORTANT: Please make sure that your system and your packages are up to date."
echo "You can cancel the installation at any time with CMD + C"
echo ""
SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
if [ $SCRIPTPATH = "/home/$USER/dotfiles" ]; then
echo "IMPORTANT: You're running the installation script from the installation target directory."
echo "Please move the installation folder dotfiles e.g. to ~/Downloads/ and start the script again."
echo "Proceeding is not recommended!"
echo ""
if [ ! $mode == "dev" ]; then
exit
fi
fi
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]* )
echo "Installation canceled."
exit;
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
+40
View File
@@ -0,0 +1,40 @@
# ------------------------------------------------------
# Copy dotfiles
# ------------------------------------------------------
cat <<"EOF"
___ _ _ _ _ _ __ _ _
|_ _|_ __ ___| |_ __ _| | | __| | ___ | |_ / _(_) | ___ ___
| || '_ \/ __| __/ _` | | | / _` |/ _ \| __| |_| | |/ _ \/ __|
| || | | \__ \ || (_| | | | | (_| | (_) | |_| _| | | __/\__ \
|___|_| |_|___/\__\__,_|_|_| \__,_|\___/ \__|_| |_|_|\___||___/
EOF
echo "The script will now remove existing directories and files from ~/.config/"
echo "and copy your prepared configuration from ~/dotfiles-versions/$version to ~/dotfiles"
echo "Symbolic links will then be created from ~/dotfiles into your ~/.config/ directory."
echo "PLEASE BACKUP YOUR EXISTING CONFIGURATIONS IF NEEDED in .config"
echo ""
while true; do
read -p "Do you want to install the dotfiles now? (Yy/Nn): " yn
case $yn in
[Yy]* )
if [ ! $mode == "dev" ]; then
echo "Copy started"
if [ ! -d ~/dotfiles ]; then
mkdir ~/dotfiles
fi
cp -rf ~/dotfiles-versions/$version/. ~/dotfiles/
else
echo "Skipped: DEV MODE!"
fi
break;;
[Nn]* )
exit
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
+54
View File
@@ -0,0 +1,54 @@
# ------------------------------------------------------
# Disable display manager
# ------------------------------------------------------
disman=0
if [ -f /etc/systemd/system/display-manager.service ]; then
cat <<"EOF"
___ _ _
|_ _|_ __ ___ _ __ ___ _ __| |_ __ _ _ __ | |_
| || '_ ` _ \| '_ \ / _ \| '__| __/ _` | '_ \| __|
| || | | | | | |_) | (_) | | | || (_| | | | | |_
|___|_| |_| |_| .__/ \___/|_| \__\__,_|_| |_|\__|
|_|
EOF
echo "An active display manager has been dedected."
echo ""
if [ $profile == "Hyprland" ]; then
echo "IMPORTANT: Starting Hyprland from tty (terminal) with command Hyperland is recommended."
echo "Login with display managers could fail and could have negative side effects on some devices."
fi
if [ $profile == "Qtile" ]; then
echo "PLEASE NOTE: Qtile works with Display Managers."
echo "But if you want to use the tty based (terminal) login instead, you can disable the display manager now."
fi
if [ $profile == "All" ]; then
echo "IMPORTANT: Starting Hyprland from tty (terminal) with command Hyperland is recommended."
echo "Login with display managers could fail and could have negative side effects on some devices."
echo "PLEASE NOTE: Qtile works with Display Managers."
echo "But if you want to use the tty based (terminal) login instead, you can disable the display manager now."
fi
echo ""
while true; do
read -p "Do you want to deactive the current display manager (Yy/Nn): " yn
case $yn in
[Yy]* )
if [ -f /etc/systemd/system/display-manager.service ]; then
sudo rm /etc/systemd/system/display-manager.service
echo "Current display manager removed."
fi
disman=1
break;;
[Nn]* )
echo "Disable display manager skipped."
echo "You can run ~/dotfiles/hypr/script/disablewm.sh at a later point of time if needed."
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
else
disman=1
fi
+7
View File
@@ -0,0 +1,7 @@
# ------------------------------------------------------
# DONE
# ------------------------------------------------------
echo "DONE!"
echo "IMPORTANT: Please logout and reboot your system!"
echo ""
+23
View File
@@ -0,0 +1,23 @@
# ------------------------------------------------------
# Install dotfiles
# ------------------------------------------------------
if [ ! $mode == "dev" ]; then
_installSymLink alacritty ~/.config/alacritty ~/dotfiles/alacritty/ ~/.config
_installSymLink vim ~/.config/vim ~/dotfiles/vim/ ~/.config
_installSymLink nvim ~/.config/nvim ~/dotfiles/nvim/ ~/.config
_installSymLink starship ~/.config/starship.toml ~/dotfiles/starship/starship.toml ~/.config/starship.toml
_installSymLink rofi ~/.config/rofi ~/dotfiles/rofi/ ~/.config
_installSymLink dunst ~/.config/dunst ~/dotfiles/dunst/ ~/.config
_installSymLink hypr ~/.config/hypr ~/dotfiles/hypr/ ~/.config
_installSymLink waybar ~/.config/waybar ~/dotfiles/waybar/ ~/.config
_installSymLink swaylock ~/.config/swaylock ~/dotfiles/swaylock/ ~/.config
_installSymLink wlogout ~/.config/wlogout ~/dotfiles/wlogout/ ~/.config
_installSymLink swappy ~/.config/swappy ~/dotfiles/swappy/ ~/.config
_installSymLink .gtkrc-2.0 ~/.gtkrc-2.0 ~/dotfiles/gtk/.gtkrc-2.0 ~/.gtkrc-2.0
_installSymLink .Xresources ~/.Xresources ~/dotfiles/gtk/.Xresources ~/.Xresources
_installSymLink gtk-3.0 ~/.config/gtk-3.0 ~/dotfiles/gtk/gtk-3.0/ ~/.config/
_installSymLink gtk-4.0 ~/.config/gtk-4.0 ~/dotfiles/gtk/gtk-4.0/ ~/.config/
else
echo "Skipped: DEV MODE!"
fi
+55
View File
@@ -0,0 +1,55 @@
packagesPacman=(
"pacman-contrib"
"wget"
"unzip"
"alacritty"
"rofi"
"chromium"
"dunst"
"starship"
"neovim"
"mpv"
"freerdp"
"xfce4-power-manager"
"thunar"
"mousepad"
"ttf-font-awesome"
"ttf-fira-sans"
"ttf-fira-code"
"ttf-firacode-nerd"
"figlet"
"vlc"
"exa"
"python-pip"
"python-psutil"
"python-rich"
"python-click"
"pavucontrol"
"tumbler"
"xautolock"
"blueman"
"papirus-icon-theme"
"polkit-gnome"
"hyprland"
"xdg-desktop-portal"
"xdg-desktop-portal-wlr"
"waybar"
"grim"
"slurp"
"swayidle"
"swappy"
"cliphist"
"qalculate-gtk"
"brightnessctl"
);
packagesYay=(
"brave-bin"
"pfetch"
"bibata-cursor-theme"
"trizen"
"swww"
"swaylock-effects"
"wlogout"
"wlr-randr"
);
+9
View File
@@ -0,0 +1,9 @@
cat <<"EOF"
_ _ _ _
| | | |_ _ _ __ _ __| | __ _ _ __ __| |
| |_| | | | | '_ \| '__| |/ _` | '_ \ / _` |
| _ | |_| | |_) | | | | (_| | | | | (_| |
|_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_|
|___/|_|
EOF
+8
View File
@@ -0,0 +1,8 @@
# ------------------------------------------------------
# init pywal with default wallpaper
# ------------------------------------------------------
_installSymLink wal ~/.config/wal ~/dotfiles/wal/ ~/.config
wal -i ~/dotfiles/wallpapers/default.jpg
echo "Pywal and templates initiated!"
echo ""
+17
View File
@@ -0,0 +1,17 @@
# ------------------------------------------------------
# Install required packages
# ------------------------------------------------------
cat <<"EOF"
___ _ _ _ _
|_ _|_ __ ___| |_ __ _| | | _ __ __ _ ___| | ____ _ __ _ ___ ___
| || '_ \/ __| __/ _` | | | | '_ \ / _` |/ __| |/ / _` |/ _` |/ _ \/ __|
| || | | \__ \ || (_| | | | | |_) | (_| | (__| < (_| | (_| | __/\__ \
|___|_| |_|___/\__\__,_|_|_| | .__/ \__,_|\___|_|\_\__,_|\__, |\___||___/
|_| |___/
EOF
_installPackagesPacman "${packagesPacman[@]}";
_installPackagesYay "${packagesYay[@]}";
echo ""
+28
View File
@@ -0,0 +1,28 @@
# ------------------------------------------------------
# Install tty login and issue
# ------------------------------------------------------
if [ $disman == 1 ]; then
cat <<"EOF"
_____ _______ __ _ _
|_ _|_ _\ \ / / | | ___ __ _(_)_ __
| | | | \ V / | |/ _ \ / _` | | '_ \
| | | | | | | | (_) | (_| | | | | |
|_| |_| |_| |_|\___/ \__, |_|_| |_|
|___/
EOF
while true; do
read -p "Do you want to install the custom tty login issue (Yy/Nn): " yn
case $yn in
[Yy]* )
sudo cp login/issue /etc/issue
break;;
[Nn]* )
echo "Setup tty login skipped."
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
fi
+112
View File
@@ -0,0 +1,112 @@
#!/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 "Package 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 packags not installed:\n%s\n" "${toInstall[@]}";
yay --noconfirm -S "${toInstall[@]}";
}
# ------------------------------------------------------
# Create symbolic links
# ------------------------------------------------------
_installSymLink() {
name="$1"
symlink="$2";
linksource="$3";
linktarget="$4";
if [ -L "${symlink}" ]; then
rm ${symlink}
ln -s ${linksource} ${linktarget}
echo "Symlink ${linksource} -> ${linktarget} created."
else
if [ -d ${symlink} ]; then
rm -rf ${symlink}/
ln -s ${linksource} ${linktarget}
echo "Symlink for directory ${linksource} -> ${linktarget} created."
else
if [ -f ${symlink} ]; then
rm ${symlink}
ln -s ${linksource} ${linktarget}
echo "Symlink to file ${linksource} -> ${linktarget} created."
else
ln -s ${linksource} ${linktarget}
echo "New symlink ${linksource} -> ${linktarget} created."
fi
fi
fi
}
+68
View File
@@ -0,0 +1,68 @@
# ------------------------------------------------------
# Prepare dotfiles
# ------------------------------------------------------
cat <<"EOF"
____ _ _
| _ \ _ __ ___ _ __ __ _ _ __ __ _| |_(_) ___ _ __
| |_) | '__/ _ \ '_ \ / _` | '__/ _` | __| |/ _ \| '_ \
| __/| | | __/ |_) | (_| | | | (_| | |_| | (_) | | | |
|_| |_| \___| .__/ \__,_|_| \__,_|\__|_|\___/|_| |_|
|_|
EOF
echo "Preparing temporary folders for the installation."
echo ""
if [ ! -d ~/dotfiles-versions ]; then
mkdir ~/dotfiles-versions
echo "~/dotfiles-versions folder created."
fi
if [ ! -d ~/dotfiles-versions/$version ]; then
mkdir ~/dotfiles-versions/$version
echo "~/dotfiles-versions/$version folder created."
else
echo "The folder ~/dotfiles-versions/$version already exists."
echo "Do you want to create a clean build of version $version and "
while true; do
read -p "and replace all files? (Yy/Nn): " yn
case $yn in
[Yy]* )
rm -fr ~/dotfiles-versions/$version
mkdir ~/dotfiles-versions/$version
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
fi
cp -rf . ~/dotfiles-versions/$version/
if [ -d ~/dotfiles-versions/$version/.git ]; then
rm -rf ~/dotfiles-versions/$version/.git
fi
if [ -f ~/dotfiles-versions/$version/.gitignore ]; then
rm ~/dotfiles-versions/$version/.gitignore
fi
if [ -f ~/dotfiles-versions/$version/CHANGELOG ]; then
rm ~/dotfiles-versions/$version/CHANGELOG
fi
if [ -f ~/dotfiles-versions/$version/README.md ]; then
rm ~/dotfiles-versions/$version/README.md
fi
if [ -f ~/dotfiles-versions/$version/install.sh ]; then
rm ~/dotfiles-versions/$version/install.sh
fi
if [ -d ~/dotfiles-versions/$version/.install ]; then
rm -rf ~/dotfiles-versions/$version/.install
fi
echo "dotfiles $version successfully prepared in ~/dotfiles-versions/$version/"
echo ""
+42
View File
@@ -0,0 +1,42 @@
# ------------------------------------------------------
# Select installation profile
# ------------------------------------------------------
cat <<"EOF"
____ _ _ ____ __ _ _
| _ \ ___ ___| | _| |_ ___ _ __ | _ \ _ __ ___ / _(_) | ___
| | | |/ _ \/ __| |/ / __/ _ \| '_ \ | |_) | '__/ _ \| |_| | |/ _ \
| |_| | __/\__ \ <| || (_) | |_) | | __/| | | (_) | _| | | __/
|____/ \___||___/_|\_\\__\___/| .__/ |_| |_| \___/|_| |_|_|\___|
|_|
EOF
echo "Please select the Desktop Profile for your installation:"
echo "1 - Hyprland"
echo "2 - Qtile"
echo "3 - All"
echo "Nn - Cancel"
echo ""
while true; do
read -p "PLEASE SELECT: " yn
case $yn in
[1]* )
profile="Hyprland"
break;;
[2]* )
profile="Qtile"
break;;
[3]* )
profile="All"
break;;
[Nn]* )
echo "Installation canceled."
exit;
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
echo "Installing profile $profile ..."
sleep 2
echo ""
+21
View File
@@ -0,0 +1,21 @@
# ------------------------------------------------------
# Install pywal
# ------------------------------------------------------
cat <<"EOF"
___ _ _ _ _
|_ _|_ __ ___| |_ __ _| | | _ __ _ ___ ____ _| |
| || '_ \/ __| __/ _` | | | | '_ \| | | \ \ /\ / / _` | |
| || | | \__ \ || (_| | | | | |_) | |_| |\ V V / (_| | |
|___|_| |_|___/\__\__,_|_|_| | .__/ \__, | \_/\_/ \__,_|_|
|_| |___/
EOF
if [ -f /usr/bin/wal ]; then
echo "pywal already installed."
else
yay --noconfirm -S pywal
echo "Pywal installed."
fi
echo ""
+23
View File
@@ -0,0 +1,23 @@
# ------------------------------------------------------
# Install dotfiles
# ------------------------------------------------------
if [ ! $mode == "dev" ]; then
_installSymLink alacritty ~/.config/alacritty ~/dotfiles/alacritty/ ~/.config
_installSymLink vim ~/.config/vim ~/dotfiles/vim/ ~/.config
_installSymLink nvim ~/.config/nvim ~/dotfiles/nvim/ ~/.config
_installSymLink starship ~/.config/starship.toml ~/dotfiles/starship/starship.toml ~/.config/starship.toml
_installSymLink rofi ~/.config/rofi ~/dotfiles/rofi/ ~/.config
_installSymLink dunst ~/.config/dunst ~/dotfiles/dunst/ ~/.config
_installSymLink qtile ~/.config/qtile ~/dotfiles/qtile/ ~/.config
_installSymLink polybar ~/.config/polybar ~/dotfiles/polybar/ ~/.config
_installSymLink picom ~/.config/picom ~/dotfiles/picom/ ~/.config
_installSymLink .xinitrc ~/.xinitrc ~/dotfiles/qtile/.xinitrc ~/.xinitrc
_installSymLink swaylock ~/.config/swaylock ~/dotfiles/swaylock/ ~/.config
_installSymLink swappy ~/.config/swappy ~/dotfiles/swappy/ ~/.config
_installSymLink .gtkrc-2.0 ~/.gtkrc-2.0 ~/dotfiles/gtk/.gtkrc-2.0 ~/.gtkrc-2.0
_installSymLink .Xresources ~/.Xresources ~/dotfiles/gtk/.Xresources ~/.Xresources
_installSymLink gtk-3.0 ~/.config/gtk-3.0 ~/dotfiles/gtk/gtk-3.0/ ~/.config/
else
echo "Skipped: DEV MODE!"
fi
+57
View File
@@ -0,0 +1,57 @@
packagesPacman=(
"pacman-contrib"
"wget"
"unzip"
"alacritty"
"rofi"
"chromium"
"nitrogen"
"dunst"
"starship"
"neovim"
"mpv"
"freerdp"
"xfce4-power-manager"
"thunar"
"mousepad"
"ttf-font-awesome"
"ttf-fira-sans"
"ttf-fira-code"
"ttf-firacode-nerd"
"figlet"
"vlc"
"exa"
"python-pip"
"python-psutil"
"python-rich"
"python-click"
"xdg-desktop-portal"
"xdg-desktop-portal-gtk"
"pavucontrol"
"tumbler"
"xautolock"
"blueman"
"papirus-icon-theme"
"polkit-gnome"
"qtile"
"polybar"
"picom"
"scrot"
"slock"
"grim"
"slurp"
"swappy"
"cliphist"
"qalculate-gtk"
"brightnessctl"
);
packagesYay=(
"brave-bin"
"pfetch"
"bibata-cursor-theme"
"trizen"
"swww"
"qtile-extras"
"wlr-randr"
);
+8
View File
@@ -0,0 +1,8 @@
cat <<"EOF"
___ _ _ _
/ _ \| |_(_) | ___
| | | | __| | |/ _ \
| |_| | |_| | | __/
\__\_\\__|_|_|\___|
EOF
+112
View File
@@ -0,0 +1,112 @@
# ------------------------------------------------------
# Restore
# ------------------------------------------------------
if [ -d ~/dotfiles ]; then
cat <<"EOF"
____ _
| _ \ ___ ___| |_ ___ _ __ ___
| |_) / _ \/ __| __/ _ \| '__/ _ \
| _ < __/\__ \ || (_) | | | __/
|_| \_\___||___/\__\___/|_| \___|
EOF
echo "The script will try to restore existing configurations."
echo "PLEASE NOTE: Restoring is not possible with version < 2.5 of the dotfiles."
echo "Keyboard layout can be defined manually in the next step."
echo ""
restored=0
if [ -f ~/dotfiles/.bashrc ]; then
while true; do
read -p "Found existing ~/dotfiles/.bashrc Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/.bashrc ~/dotfiles-versions/$version/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
fi
if [ $profile == "Hyprland" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/hypr/conf/keyboard.conf ]; then
while true; do
read -p "Found existing ~/dotfiles/hypr/conf/keyboard.conf Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/hypr/conf/keyboard.conf ~/dotfiles-versions/$version/hypr/conf/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
fi
fi
if [ $profile = "Hyprland" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/hypr/conf/monitor.conf ]; then
while true; do
read -p "Found existing ~/dotfiles/hypr/conf/monitor.conf Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/hypr/conf/monitor.conf ~/dotfiles-versions/$version/hypr/conf/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
fi
fi
if [ $profile == "Hyprland" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/hypr/conf/keybindings.conf ]; then
while true; do
read -p "Found existing ~/dotfiles/hypr/conf/keybindings.conf Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/hypr/conf/keybindings.conf ~/dotfiles-versions/$version/hypr/conf/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
fi
fi
if [ $profile == "Qtile" ] || [ $profile == "All" ]; then
if [ -f ~/dotfiles/qtile/conf/keyboard.py ]; then
while true; do
read -p "Found existing ~/dotfiles/qtile/conf/keyboard.py Restore? (Yy/Nn): " yn
case $yn in
[Yy]* )
cp ~/dotfiles/qtile/conf/keyboard.py ~/dotfiles-versions/$version/qtile/conf/
echo "Restored!"
restored=1
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
fi
fi
if [ $restored == 0 ]; then
echo "Restore not possible."
fi
echo ""
fi
+35
View File
@@ -0,0 +1,35 @@
# ------------------------------------------------------
# Setup
# ------------------------------------------------------
cat <<"EOF"
____ _
/ ___| ___| |_ _ _ _ __
\___ \ / _ \ __| | | | '_ \
___) | __/ |_| |_| | |_) |
|____/ \___|\__|\__,_| .__/
|_|
EOF
echo "If you could restore your keyboard layout in the step before you can select Nn and skip."
while true; do
read -p "Do you want to start the setup (Yy/Nn): " yn
case $yn in
[Yy]* )
read -p "Enter your preferred keyboard layout (us,de,...) (default:us): " keyboard
if [ -z "$keyboard" ]; then
keyboard="us"
fi
SEARCH="kb_layout = de"
REPLACE="kb_layout = $keyboard"
sed -i "s/$SEARCH/$REPLACE/g" ~/dotfiles-versions/$version/hypr/conf/keyboard.conf
SEARCH="keyboard_layout = \"de\""
REPLACE="keyboard_layout = \"$keyboard\""
sed -i "s/$SEARCH/$REPLACE/g" ~/dotfiles-versions/$version/qtile/conf/keyboard.py
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
+46
View File
@@ -0,0 +1,46 @@
# ------------------------------------------------------
# Install wallpapers
# ------------------------------------------------------
cat <<"EOF"
__ __ _ _
\ \ / /_ _| | |_ __ __ _ _ __ ___ _ __ ___
\ \ /\ / / _` | | | '_ \ / _` | '_ \ / _ \ '__/ __|
\ V V / (_| | | | |_) | (_| | |_) | __/ | \__ \
\_/\_/ \__,_|_|_| .__/ \__,_| .__/ \___|_| |___/
|_| |_|
EOF
echo "Do you want to download the wallpapers from repository https://gitlab.com/stephan-raabe/wallpaper/ ?"
while true; do
read -p "If not, the script will install 3 default wallpapers to ~/wallpaper/ (Yy/Nn): " yn
case $yn in
[Yy]* )
wget -P ~/Downloads/ https://gitlab.com/stephan-raabe/wallpaper/-/archive/main/wallpaper-main.zip
unzip -o ~/Downloads/wallpaper-main.zip -d ~/Downloads/
if [ ! -d ~/wallpaper/ ]; then
mkdir ~/wallpaper
fi
cp ~/Downloads/wallpaper-main/* ~/wallpaper/
echo "Wallpapers installed successfully."
break;;
[Nn]* )
if [ -d ~/wallpaper/ ]; then
echo "wallpaper folder already exists."
else
mkdir ~/wallpaper
fi
cp wallpapers/* ~/wallpaper
echo "Default wallpapers installed."
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo ""
# ------------------------------------------------------
# Copy default wallpaper to .cache
# ------------------------------------------------------
cp wallpapers/default.jpg ~/.cache/current_wallpaper.jpg
echo ""
+19
View File
@@ -0,0 +1,19 @@
# ------------------------------------------------------
# Check if yay is installed
# ------------------------------------------------------
if sudo pacman -Qs yay > /dev/null ; then
echo "yay is already installed!"
else
echo "yay is not installed. Will be installed now!"
_installPackagesPacman "base-devel"
SCRIPT=$(realpath "$0")
temp_path=$(dirname "$SCRIPT")
echo $temp_path
git clone https://aur.archlinux.org/yay-git.git ~/yay-git
cd ~/yay-git
makepkg -si
cd $temp_path
echo "yay has been installed successfully."
fi
echo ""