🔧 chore(scripts, install): add support for the new build system, improvements

This commit is contained in:
retrozinndev
2025-08-16 12:20:01 -03:00
parent 116753063c
commit b999ba4d48
3 changed files with 40 additions and 55 deletions
+30 -39
View File
@@ -1,44 +1,27 @@
#!/usr/bin/bash #!/usr/bin/bash
source ./utils.sh
set -e set -e
source ./scripts/utils.sh
trap "printf \"\nOk, quitting beacuse you entered an exit signal. (SIGINT).\n\"; exit 1" SIGINT trap "printf \"\nOk, quitting beacuse you entered an exit signal. (SIGINT).\n\"; exit 1" SIGINT
trap "printf \"\nOh noo!! Some application just killed the script!\"; exit 2" SIGTERM trap "printf \"\nOh noo!! Some application just killed the script!\"; exit 2" SIGTERM
XDG_CONFIG_HOME=$(sh -c '[[ ! -z "$XDG_CONFIG_HOME" ]] && echo "$XDG_CONFIG_HOME" || echo "$HOME/.config"') BIN_HOME=`[[ ! "$BIN_HOME" ]] && echo -n "$BIN_HOME" || echo -n "$HOME/.local/bin"`
XDG_DATA_HOME=`[[ ! "$XDG_DATA_HOME" ]] && echo -n "$XDG_DATA_HOME" || echo -n "$HOME/.local/share"`
XDG_CONFIG_HOME=`[[ ! "$XDG_CONFIG_HOME" ]] && echo -n "$XDG_CONFIG_HOME" || echo -n "$HOME/.config"`
function Apply_wallpapers() { #####
echo -n "Would you also like to apply the wallpapers folder? :3 [y/n] "
read answer
printf "\n"
if [[ $answer =~ "y" ]]; then
echo "Thanks for choosing! Please remember that I am not the author of the wallpapers!"
echo "You can see sources in the repo: https://github.com/retrozinndev/colorshell/WALLPAPERS.md"
echo "-> Copying wallpapers to ~/wallpapers"
mkdir -p $HOME/wallpapers
cp -f ./wallpapers/* $HOME/wallpapers
else
echo "Ok! The wallpaper is yours to choose!"
echo "Expect some Hyprland source and color errors, it happens because there aren't colors to source when you don't install wallpapers right away, so you have to do it yourself."
echo "Tip: create the ~/wallpapers directory, put your wallpapers there and press ´SUPER + W´ to select :3"
fi
}
#########
# Start #
#########
Print_header Print_header
echo -e "colorshell is a project made by retrozinndev. source: https://github.com/retrozinndev/colorshell\n" echo -e "Colorshell is a project made by retrozinndev.
Source: https://github.com/retrozinndev/colorshell\n"
sleep .5 sleep .5
echo "Welcome to the colorshell installation script!" echo "Welcome to the colorshell installation script!"
# Warn user of possible problems that can happen # Warn user of possible problems that can happen
echo "!!!WARNING!!! By running this script, you assume total responsability for any issues that may occur with your filesystem" Send_log warn "!! By running this script, you assume total responsability for any issues that may occur with your filesystem"
echo -n "Do you want to start the shell installation? [y/n] " echo -n "Do you want to start the shell installation? [y/n] "
[[ ! $1 == "dots" ]] && read input || printf "\n" [[ ! $1 == "dots" ]] && read input || printf "\n"
@@ -46,7 +29,8 @@ echo -n "Do you want to start the shell installation? [y/n] "
if [[ $1 == "dots" ]] || [[ $input =~ "y" ]]; then if [[ $1 == "dots" ]] || [[ $input =~ "y" ]]; then
Send_log "Starting installation...\n" Send_log "Starting installation...\n"
for dir in ${config_dirs[@]}; do Send_log "Installing default configurations"
for dir in $(ls -A -w1 ./config); do
dest=$XDG_CONFIG_HOME/$dir dest=$XDG_CONFIG_HOME/$dir
echo "-> Installing $dir in $dest" echo "-> Installing $dir in $dest"
@@ -60,26 +44,33 @@ if [[ $1 == "dots" ]] || [[ $input =~ "y" ]]; then
fi fi
done done
echo "-> Copying default user config" Send_log "Building colorshell..."
cp -rf ./hypr/user $XDG_CONFIG_HOME/hypr pnpm build:release
echo "-> Copying default hyprpaper.conf" Send_log "Installing colorshell"
cp -f ./hypr/hyprpaper.conf $XDG_CONFIG_HOME/hypr # install shell
mkdir -p $BIN_HOME
cp -f ./build/release/colorshell $BIN_HOME
# Ask if user also wants to install default wallpapers # install gresouce
Apply_wallpapers mkdir -p $XDG_DATA_HOME/colorshell
cp -f ./build/release/resources.gresource $XDG_DATA_HOME/colorshell
Send_log "Cleaning"
pnpm clean
if ! [[ $1 == "dots" ]]; then if ! [[ $1 == "dots" ]]; then
echo "Ah yes! Looks like it's installed, yay :3"; sleep .8 echo "Colorshell is installed! :D"
echo "If you find any issue, please report it in: https://github.com/retrozinndev/colorshell/issues"; sleep .5 sleep .8
echo "Thanks for using colorshell! I really appreciate that :D" echo "If you have issues, please report it!"
echo "Issue Tracker: https://github.com/retrozinndev/colorshell/issues"
sleep .5
echo "Thanks for using colorshell! I really appreciate that :P"
printf "\n" printf "\n"
exit 0 exit 0
fi fi
Send_log "colorshell is installed!" Send_log "Colorshell is installed!"
exit 0 exit 0
fi fi
+9 -1
View File
@@ -1,7 +1,15 @@
#!/usr/bin/bash #!/usr/bin/bash
source ./utils.sh source ./scripts/utils.sh
config_dirs=(
"hypr/scripts"
"hypr/shell"
"hypr/hyprlock.conf"
"hypr/hyprland.conf"
"hypr/hypridle.conf"
"kitty/kitty.conf"
)
outdir="./config" outdir="./config"
Clean_local() { Clean_local() {
-14
View File
@@ -8,20 +8,6 @@
# From: https://github.com/retrozinndev/colorshell # From: https://github.com/retrozinndev/colorshell
# -------------
# Array containing directory names to be used by
# retrozinndev/colorshell install and update
# scripts.
# -------------
config_dirs=(
"hypr/scripts"
"hypr/shell"
"hypr/hyprlock.conf"
"hypr/hyprland.conf"
"hypr/hypridle.conf"
"kitty/kitty.conf"
)
# ------------- # -------------
# Sends stdout log with type and message provided # Sends stdout log with type and message provided
# in parameters. # in parameters.