Add hook.sh

This commit is contained in:
Stephan Raabe
2023-12-07 21:32:32 +01:00
parent 140dc369ed
commit 38106f68d4
8 changed files with 133 additions and 31 deletions
+18
View File
@@ -0,0 +1,18 @@
# ------------------------------------------------------
# Copy dotfiles
# ------------------------------------------------------
if [ -f ~/dotfiles-versions/hook.sh ]; then
cat <<"EOF"
_ _ _
| | | | ___ ___ | | __
| |_| |/ _ \ / _ \| |/ /
| _ | (_) | (_) | <
|_| |_|\___/ \___/|_|\_\
EOF
echo "The script has detected a hook.sh script."
if gum confirm "Do you want to run the script now?"; then
source ~/dotfiles-versions/hook.sh
echo "hook.sh executed!"
fi
fi
+45 -15
View File
@@ -3,21 +3,51 @@
# ------------------------------------------------------
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/
if [ -d ~/dotfiles-versions/$version/alacritty ]; then
_installSymLink alacritty ~/.config/alacritty ~/dotfiles/alacritty/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/vim ]; then
_installSymLink vim ~/.config/vim ~/dotfiles/vim/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/nvim ]; then
_installSymLink nvim ~/.config/nvim ~/dotfiles/nvim/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/starship ]; then
_installSymLink starship ~/.config/starship.toml ~/dotfiles/starship/starship.toml ~/.config/starship.toml
fi
if [ -d ~/dotfiles-versions/$version/rofi ]; then
_installSymLink rofi ~/.config/rofi ~/dotfiles/rofi/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/dunst ]; then
_installSymLink dunst ~/.config/dunst ~/dotfiles/dunst/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/hypr ]; then
_installSymLink hypr ~/.config/hypr ~/dotfiles/hypr/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/waybar ]; then
_installSymLink waybar ~/.config/waybar ~/dotfiles/waybar/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/swaylock ]; then
_installSymLink swaylock ~/.config/swaylock ~/dotfiles/swaylock/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/wlogout ]; then
_installSymLink wlogout ~/.config/wlogout ~/dotfiles/wlogout/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/swappy ]; then
_installSymLink swappy ~/.config/swappy ~/dotfiles/swappy/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/gtk ]; then
_installSymLink .gtkrc-2.0 ~/.gtkrc-2.0 ~/dotfiles/gtk/.gtkrc-2.0 ~/.gtkrc-2.0
fi
if [ -d ~/dotfiles-versions/$version/gtk ]; then
_installSymLink .Xresources ~/.Xresources ~/dotfiles/gtk/.Xresources ~/.Xresources
fi
if [ -d ~/dotfiles-versions/$version/gtk ]; then
_installSymLink gtk-3.0 ~/.config/gtk-3.0 ~/dotfiles/gtk/gtk-3.0/ ~/.config/
fi
if [ -d ~/dotfiles-versions/$version/gtk ]; then
_installSymLink gtk-4.0 ~/.config/gtk-4.0 ~/dotfiles/gtk/gtk-4.0/ ~/.config/
fi
else
echo "Skipped: DEV MODE!"
fi
-1
View File
@@ -10,7 +10,6 @@ cat <<"EOF"
| . \ __/ |_| | |_) | (_) | (_| | | | (_| |
|_|\_\___|\__, |_.__/ \___/ \__,_|_| \__,_|
|___/
EOF
echo -e "${NONE}"
+3
View File
@@ -33,5 +33,8 @@ if [[ $(_isFolderEmpty ~/dotfiles-versions/$version/) == 0 ]] ;then
echo "Execution of rsync -a -I --exclude-from=.install/excludes.txt . ~/dotfiles-versions/$version/ is required."
exit
fi
if [ ! -f ~/dotfiles-versions/hook.sh ]; then
# cp .install/templates/hook.sh ~/dotfiles-versions/
fi
echo "dotfiles $version successfully prepared in ~/dotfiles-versions/$version/"
echo ""
+45 -15
View File
@@ -3,21 +3,51 @@
# ------------------------------------------------------
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/
if [ -d ~/dotfiles-versions/$version/alacritty ]; then
_installSymLink alacritty ~/.config/alacritty ~/dotfiles/alacritty/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/vim ]; then
_installSymLink vim ~/.config/vim ~/dotfiles/vim/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/nvim ]; then
_installSymLink nvim ~/.config/nvim ~/dotfiles/nvim/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/starship ]; then
_installSymLink starship ~/.config/starship.toml ~/dotfiles/starship/starship.toml ~/.config/starship.toml
fi
if [ -d ~/dotfiles-versions/$version/rofi ]; then
_installSymLink rofi ~/.config/rofi ~/dotfiles/rofi/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/dunst ]; then
_installSymLink dunst ~/.config/dunst ~/dotfiles/dunst/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/qtile ]; then
_installSymLink qtile ~/.config/qtile ~/dotfiles/qtile/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/polybar ]; then
_installSymLink polybar ~/.config/polybar ~/dotfiles/polybar/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/picom ]; then
_installSymLink picom ~/.config/picom ~/dotfiles/picom/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/qtile ]; then
_installSymLink .xinitrc ~/.xinitrc ~/dotfiles/qtile/.xinitrc ~/.xinitrc
fi
if [ -d ~/dotfiles-versions/$version/swaylock ]; then
_installSymLink swaylock ~/.config/swaylock ~/dotfiles/swaylock/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/swappy ]; then
_installSymLink swappy ~/.config/swappy ~/dotfiles/swappy/ ~/.config
fi
if [ -d ~/dotfiles-versions/$version/gtk ]; then
_installSymLink .gtkrc-2.0 ~/.gtkrc-2.0 ~/dotfiles/gtk/.gtkrc-2.0 ~/.gtkrc-2.0
fi
if [ -d ~/dotfiles-versions/$version/gtk ]; then
_installSymLink .Xresources ~/.Xresources ~/dotfiles/gtk/.Xresources ~/.Xresources
fi
if [ -d ~/dotfiles-versions/$version/gtk ]; then
_installSymLink gtk-3.0 ~/.config/gtk-3.0 ~/dotfiles/gtk/gtk-3.0/ ~/.config/
fi
else
echo "Skipped: DEV MODE!"
fi
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
rm -rf ~/dotfiles-versions/$version/vim/
rm -rf ~/dotfiles-versions/$version/nvim/