This commit is contained in:
Stephan Raabe 2023-11-12 14:16:53 +01:00
parent 339d7b8411
commit 86dff9bf64
4 changed files with 34 additions and 9 deletions

View File

@ -3,7 +3,7 @@
# ------------------------------------------------------ # ------------------------------------------------------
datets=$(date '+%Y%m%d%H%M%S') datets=$(date '+%Y%m%d%H%M%S')
if [ -d ~/dotfiles ]; then if [ -d ~/dotfiles ] || [ -f ~/.bashrc ]; then
cat <<"EOF" cat <<"EOF"
____ _ ____ _
@ -14,8 +14,12 @@ ____ _
|_| |_|
EOF EOF
if [ -d ~/dotfiles ]; then
echo "The script has detected an existing dotfiles folder and will try to create a backup into the folder ~/dotfiles-versions/backups/$datets" echo "The script has detected an existing dotfiles folder and will try to create a backup into the folder ~/dotfiles-versions/backups/$datets"
fi
if [ -f ~/.bashrc ]; then
echo "The script has detected an existing .bashrc file and will try to create a backup ~/dotfiles-versions/backups/$datets/.bashrc-old"
fi
echo "" echo ""
while true; do while true; do
read -p "Do you want to proceed? (Yy/Nn): " yn read -p "Do you want to proceed? (Yy/Nn): " yn
@ -29,6 +33,10 @@ EOF
mkdir ~/dotfiles-versions/backups mkdir ~/dotfiles-versions/backups
echo "~/dotfiles-versions/backups created" echo "~/dotfiles-versions/backups created"
fi fi
if [ ! -d ~/dotfiles-versions/backups/$datets ]; then
mkdir ~/dotfiles-versions/backups/$datets
echo "~/dotfiles-versions/backups/$datets created"
fi
if [ -d ~/dotfiles ]; then if [ -d ~/dotfiles ]; then
cp -r ~/dotfiles ~/dotfiles-versions/backups/$datets cp -r ~/dotfiles ~/dotfiles-versions/backups/$datets
echo "Backup of your current dotfiles in ~/dotfiles-versions/backups/$datets created." echo "Backup of your current dotfiles in ~/dotfiles-versions/backups/$datets created."

View File

@ -1,11 +1,28 @@
# ------------------------------------------------------ # ------------------------------------------------------
# Install .bashrc # Install .bashrc
# ------------------------------------------------------ # ------------------------------------------------------
cat <<"EOF"
_ _
| |__ __ _ ___| |__ _ __ ___
| '_ \ / _` / __| '_ \| '__/ __|
_| |_) | (_| \__ \ | | | | | (__
(_)_.__/ \__,_|___/_| |_|_| \___|
EOF
echo "-> Install .bashrc"
echo "PLEASE BACKUP YOUR .bashrc file in case you want to keep your local configuration and aliases."
while true; do while true; do
read -p "Do you want to install the .bashrc file? (Yy/Nn): " yn if [ -f ~/.bashrc ]; then
echo "The script has detected an existing .bashrc file. "
fi
if [ -f ~/dotfiles-versions/backups/$datets/.bashrc-old ]; then
echo "Backup is available here ~/dotfiles-versions/backups/$datets/.bashrc-old"
fi
if [ -f ~/.bashrc ]; then
echo "Do you want to replace your existing .bashrc file with the dotfiles .bashrc file?"
else
echo "Do you want to install the dotfiles .bashrc file now?"
fi
read -p "Please confirm (Yy/Nn): " yn
case $yn in case $yn in
[Yy]* ) [Yy]* )
_installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc _installSymLink .bashrc ~/.bashrc ~/dotfiles/.bashrc ~/.bashrc

View File

@ -17,7 +17,7 @@ EOF
echo "An active display manager has been dedected." echo "An active display manager has been dedected."
echo "" echo ""
if [ $profile == "Hyprland" ]; then if [ $profile == "Hyprland" ]; then
echo "IMPORTANT: Starting Hyprland from tty (terminal) with command Hyperland is recommended." echo "IMPORTANT: Starting Hyprland from tty (terminal) with command Hyprland is recommended."
echo "Login with display managers could fail and could have negative side effects on some devices." echo "Login with display managers could fail and could have negative side effects on some devices."
fi fi
if [ $profile == "Qtile" ]; then if [ $profile == "Qtile" ]; then
@ -25,7 +25,7 @@ EOF
echo "But if you want to use the tty based (terminal) login instead, you can disable the display manager now." echo "But if you want to use the tty based (terminal) login instead, you can disable the display manager now."
fi fi
if [ $profile == "All" ]; then if [ $profile == "All" ]; then
echo "IMPORTANT: Starting Hyprland from tty (terminal) with command Hyperland is recommended." echo "IMPORTANT: Starting Hyprland from tty (terminal) with command Hyprland is recommended."
echo "Login with display managers could fail and could have negative side effects on some devices." 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 "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." echo "But if you want to use the tty based (terminal) login instead, you can disable the display manager now."

View File

@ -69,7 +69,7 @@ if [ $profile == "All" ]; then
source .install/hyprland-dotfiles.sh source .install/hyprland-dotfiles.sh
source .install/qtile-dotfiles.sh source .install/qtile-dotfiles.sh
fi fi
source .install/bashrc.sh
echo "IMPORTANT: Please check the keyboard layout and screen resolution after the rebbot of your system." echo "IMPORTANT: Please check the keyboard layout and screen resolution after the rebbot of your system."
echo "" echo ""