From e91443e23c9023ab3f08e921972b7d2210bfe287 Mon Sep 17 00:00:00 2001 From: clsty Date: Sat, 6 Jan 2024 15:49:21 +0800 Subject: [PATCH 01/11] Remove execute permission for non-executable --- .config/hypr/execs.conf | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .config/hypr/execs.conf diff --git a/.config/hypr/execs.conf b/.config/hypr/execs.conf old mode 100755 new mode 100644 From 7853d7370ed1c64f7d9651bedaa5024659043c61 Mon Sep 17 00:00:00 2001 From: clsty Date: Sat, 6 Jan 2024 15:49:47 +0800 Subject: [PATCH 02/11] Fix and improvement on installation script. --- install.sh | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/install.sh b/install.sh index 3b80e772..61f6c768 100755 --- a/install.sh +++ b/install.sh @@ -7,6 +7,7 @@ function v() { echo -e "\e[34m[$0]: Next command to be executed:\e[0m" echo -e "\e[32m$@\e[0m" execute=true + hasfailed=false if $ask;then while true;do echo -e "\e[34mDo you want to execute the command shown above? \e[0m" @@ -25,7 +26,16 @@ function v() { done fi if $execute;then - "$@" + "$@" || hasfailed=true + fi + if $hasfailed ;then + echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed. You may need to resolve the problem manually before proceeding.\e[0m" + read -p "Ignore the error and continue this script anyway (NOT Recommended)? [y/N]" p + case $p in + [yY]) echo -e "\e[34mAlright, continue...\e[0m" ;; + *) echo -e "\e[34mOK, exiting...\e[0m" ;exit 1 ;; + esac + else echo -e "\e[34m[$0]: Command \"\e[32m$@\e[34m\" done.\e[0m" fi } ##################################################################################### @@ -80,22 +90,22 @@ v sudo usermod -aG input "$(whoami)" printf '\e[36m2. Installing AGS from git repo\e[97m\n' sleep 1 -installags (){ - v git clone --recursive https://github.com/Aylur/ags.git|| \ - if [ -d ags ];then - printf "\e[36mSeems \"./ags\" already exists.\e[97m\n" - cd ags - v git pull - else exit 1 - fi - v npm install - v meson setup build - v meson install -C build +install-ags (){ + mkdir -p $base/ags + cd $base/ags + try git init -b main + try git remote add origin https://github.com/Aylur/ags.git + git pull origin main && git submodule update --init --recursive + npm install + meson setup build + meson install -C build cd $base } -if command -v ags >/dev/null 2>&1 - then echo -e "\e[34mCommand \"ags\" already exists. Won\'t install ags.\e[0m" - else installags +if command -v ags >/dev/null 2>&1;then + echo -e "\e[34mCommand \"ags\" already exists, no need to install.\e[0m" + echo -e "\e[34mYou can reinstall ags in order to update to the latest version anyway.\e[0m" + if $ask;then v install-ags;fi +else v install-ags fi ##################################################################################### @@ -116,6 +126,8 @@ do fi done +test -f ~/.config/hypr/colors.conf || cp ~/.config/hypr/colors_default.conf ~/.config/hypr/colors.conf + # some foldes (eg. .local/bin) should be processed seperately to avoid `--delete' for rsync, # since the files here come from different places, not only about one program. v rsync -av ".local/bin/" "$HOME/.local/bin/" From ecf3ff281f8933e536e22b6662f6b836f56594ec Mon Sep 17 00:00:00 2001 From: clsty Date: Sat, 6 Jan 2024 17:58:43 +0800 Subject: [PATCH 03/11] Show function's definition. --- install.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 61f6c768..8eda8e54 100755 --- a/install.sh +++ b/install.sh @@ -38,6 +38,12 @@ function v() { else echo -e "\e[34m[$0]: Command \"\e[32m$@\e[34m\" done.\e[0m" fi } +function showfun() { + echo -e "\e[34mThe definition of function \"$1\" is as follows:\e[0m" + printf "\e[32m" + type -a $1 + printf "\e[97m" +} ##################################################################################### startask (){ printf "\e[34m[$0]: Hi there!\n" @@ -104,10 +110,10 @@ install-ags (){ if command -v ags >/dev/null 2>&1;then echo -e "\e[34mCommand \"ags\" already exists, no need to install.\e[0m" echo -e "\e[34mYou can reinstall ags in order to update to the latest version anyway.\e[0m" - if $ask;then v install-ags;fi -else v install-ags + askags=$ask +else askags=true fi - +if $askags;then showfun install-ags;v install-ags;fi ##################################################################################### printf '\e[36m3. Copying\e[97m\n' From d2dd37adf42b1085362f3cce0eae8d9d356d1df6 Mon Sep 17 00:00:00 2001 From: clsty Date: Sat, 6 Jan 2024 18:46:58 +0800 Subject: [PATCH 04/11] Add option to repeat failed command. --- install.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 8eda8e54..95a6f119 100755 --- a/install.sh +++ b/install.sh @@ -8,6 +8,7 @@ function v() { echo -e "\e[32m$@\e[0m" execute=true hasfailed=false + cmdstatus=0 # 0=normal; 1=failed; 2=failed but ignored if $ask;then while true;do echo -e "\e[34mDo you want to execute the command shown above? \e[0m" @@ -15,7 +16,7 @@ function v() { echo " e = Exit now" echo " s = Skip this command; NOT recommended (may break functions needed by the dotfiles!)" echo " yesforall = yes and don't ask again; NOT recommended unless you really sure" - read -p "Enter here [y/e/s/yesforall]:" p + read -p "Enter here [y/e/s/yesforall]: " p case $p in [yY]) echo -e "\e[34mOK, executing...\e[0m" ;break ;; [eE]) echo -e "\e[34mExiting...\e[0m" ;exit ;break ;; @@ -26,17 +27,28 @@ function v() { done fi if $execute;then - "$@" || hasfailed=true + "$@" || cmdstatus=1 fi - if $hasfailed ;then + while [ $cmdstatus == 1 ] ;do echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed. You may need to resolve the problem manually before proceeding.\e[0m" - read -p "Ignore the error and continue this script anyway (NOT Recommended)? [y/N]" p + echo -e "\e[31mWhich one would you like to do? \e[0m" + echo " r = Repeat this command (DEFAULT)" + echo " e = Exit now" + echo " i = Ignore the error and continue this script anyway (may break functions needed by the dotfiles!)" + read -p "Enter here [R/e/i]: " p case $p in - [yY]) echo -e "\e[34mAlright, continue...\e[0m" ;; - *) echo -e "\e[34mOK, exiting...\e[0m" ;exit 1 ;; + [iI]) echo -e "\e[34mAlright, ignore and continue...\e[0m";cmdstatus=2;; + [eE]) echo -e "\e[34mAlright, will exit.\e[0m";break;; + *) echo -e "\e[34mOK, repeating...\e[0m" + "$@" && cmdstatus=0 + ;; esac - else echo -e "\e[34m[$0]: Command \"\e[32m$@\e[34m\" done.\e[0m" - fi + done + case $cmdstatus in + 0) echo -e "\e[34m[$0]: Command \"\e[32m$@\e[34m\" finished.\e[0m";; + 1) echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed. Exiting...\e[0m";exit 1;; + 2) echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed but ignored by user.\e[0m";; + esac } function showfun() { echo -e "\e[34mThe definition of function \"$1\" is as follows:\e[0m" From f21006e57b2151bb3c9c10709d621c188228d848 Mon Sep 17 00:00:00 2001 From: clsty Date: Sat, 6 Jan 2024 19:10:32 +0800 Subject: [PATCH 05/11] Minor fixes; add 3 as cmdstatus for skipped. --- install.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 95a6f119..8d33817d 100755 --- a/install.sh +++ b/install.sh @@ -8,7 +8,7 @@ function v() { echo -e "\e[32m$@\e[0m" execute=true hasfailed=false - cmdstatus=0 # 0=normal; 1=failed; 2=failed but ignored + cmdstatus=0 # 0=normal; 1=failed; 2=failed but ignored; 3=skipped if $ask;then while true;do echo -e "\e[34mDo you want to execute the command shown above? \e[0m" @@ -20,7 +20,7 @@ function v() { case $p in [yY]) echo -e "\e[34mOK, executing...\e[0m" ;break ;; [eE]) echo -e "\e[34mExiting...\e[0m" ;exit ;break ;; - [sS]) echo -e "\e[34mAlright, skipping this one...\e[0m" ;export execute=false ;break ;; + [sS]) echo -e "\e[34mAlright, skipping this one...\e[0m" ;export execute=false;cmdstatus=3 ;break ;; "yesforall") echo -e "\e[34mAlright, won't ask again. Executing...\e[0m"; export ask=false ;break ;; *) echo -e "\e[31mPlease enter one of [y/e/s/yesforall].\e[0m";; esac @@ -48,6 +48,7 @@ function v() { 0) echo -e "\e[34m[$0]: Command \"\e[32m$@\e[34m\" finished.\e[0m";; 1) echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed. Exiting...\e[0m";exit 1;; 2) echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed but ignored by user.\e[0m";; + 3) echo -e "\e[33m[$0]: Command \"\e[32m$@\e[33m\" has been skipped by user.\e[0m";; esac } function showfun() { @@ -144,7 +145,10 @@ do fi done -test -f ~/.config/hypr/colors.conf || cp ~/.config/hypr/colors_default.conf ~/.config/hypr/colors.conf +target="$HOME/.config/hypr/colors.conf" +test -f $target || { \ + echo -e "\e[34mFile \"$target\" not found.\e[0m" && \ + v cp "$HOME/.config/hypr/colors_default.conf" $target ; } # some foldes (eg. .local/bin) should be processed seperately to avoid `--delete' for rsync, # since the files here come from different places, not only about one program. From 651875dfc5a727c7a37b78295283d5c07f2a5308 Mon Sep 17 00:00:00 2001 From: clsty Date: Sat, 6 Jan 2024 19:11:56 +0800 Subject: [PATCH 06/11] Remove unused line. --- install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install.sh b/install.sh index 8d33817d..e30508b6 100755 --- a/install.sh +++ b/install.sh @@ -7,7 +7,6 @@ function v() { echo -e "\e[34m[$0]: Next command to be executed:\e[0m" echo -e "\e[32m$@\e[0m" execute=true - hasfailed=false cmdstatus=0 # 0=normal; 1=failed; 2=failed but ignored; 3=skipped if $ask;then while true;do From 1e6709b68484f360fd33c86a088430ce74cbde95 Mon Sep 17 00:00:00 2001 From: clsty Date: Sat, 6 Jan 2024 19:26:45 +0800 Subject: [PATCH 07/11] Better informing --- install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index e30508b6..e8ab6249 100755 --- a/install.sh +++ b/install.sh @@ -29,8 +29,8 @@ function v() { "$@" || cmdstatus=1 fi while [ $cmdstatus == 1 ] ;do - echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed. You may need to resolve the problem manually before proceeding.\e[0m" - echo -e "\e[31mWhich one would you like to do? \e[0m" + echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed." + echo -e "You may need to resolve the problem manually BEFORE repeating this command.\e[0m" echo " r = Repeat this command (DEFAULT)" echo " e = Exit now" echo " i = Ignore the error and continue this script anyway (may break functions needed by the dotfiles!)" @@ -57,6 +57,13 @@ function showfun() { printf "\e[97m" } ##################################################################################### +# For debugging +# ask=false +# mkdir -p /tmp/test1 +# v mkdir /tmp/test1 +# +# echo "debug part fin";exit +##################################################################################### startask (){ printf "\e[34m[$0]: Hi there!\n" printf 'This script 1. only works for ArchLinux and Arch-based distros.\n' From 87faa51c080165c42695e5c345d1672b0471bfcd Mon Sep 17 00:00:00 2001 From: clsty Date: Sat, 6 Jan 2024 20:12:51 +0800 Subject: [PATCH 08/11] Add install-rubik for Rubik font --- .gitignore | 1 + dependencies.txt | 2 +- install.sh | 30 ++++++++++++++++++++++++++---- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 080a2b5e..a7d968cf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .config/ags/scss/_material.scss .config/hypr/colors.conf /ags +/rubik diff --git a/dependencies.txt b/dependencies.txt index fc1cf021..75468dbe 100644 --- a/dependencies.txt +++ b/dependencies.txt @@ -10,5 +10,5 @@ blueberry networkmanager brightnessctl wlsunset-git gnome-bluetooth-3.0 wayland-idle-inhibitor-git swayidle swaylock-effects-git wlogout wl-clipboard hyprpicker-git grim tesseract slurp adw-gtk3-git gradience-git swww -lexend-fonts-git ttf-jetbrains-mono-nerd ttf-material-symbols-variable-git ttf-space-mono-nerd +fontconfig lexend-fonts-git ttf-jetbrains-mono-nerd ttf-material-symbols-variable-git ttf-space-mono-nerd fish foot starship diff --git a/install.sh b/install.sh index e8ab6249..f60498b8 100755 --- a/install.sh +++ b/install.sh @@ -112,7 +112,7 @@ v sudo usermod -aG video "$(whoami)" v sudo usermod -aG input "$(whoami)" ##################################################################################### -printf '\e[36m2. Installing AGS from git repo\e[97m\n' +printf '\e[36m2. Installing AGS and rubik from git repo\e[97m\n' sleep 1 install-ags (){ @@ -126,13 +126,35 @@ install-ags (){ meson install -C build cd $base } +install-rubik (){ + mkdir -p $base/rubik + cd $base/rubik + try git init -b main + try git remote add origin https://github.com/googlefonts/rubik.git + git pull origin main && git submodule update --init --recursive + sudo mkdir -p /usr/local/share/fonts/TTF/ + sudo cp fonts/variable/Rubik*.ttf /usr/local/share/fonts/TTF/ + sudo mkdir -p /usr/local/share/licenses/ttf-rubik/ + sudo cp OFL.txt /usr/local/share/licenses/ttf-rubik/LICENSE + fc-cache -fv + cd $base +} + if command -v ags >/dev/null 2>&1;then echo -e "\e[34mCommand \"ags\" already exists, no need to install.\e[0m" echo -e "\e[34mYou can reinstall ags in order to update to the latest version anyway.\e[0m" - askags=$ask -else askags=true + ask_ags=$ask +else ask_ags=true fi -if $askags;then showfun install-ags;v install-ags;fi +if $(fc-list|grep -q Rubik); then + echo -e "\e[34mFont \"Rubik\" already exists, no need to install.\e[0m" + echo -e "\e[34mYou can reinstall Rubik in order to update to the latest version anyway.\e[0m" + ask_rubik=$ask +else ask_rubik=true +fi + +if $ask_ags;then showfun install-ags;v install-ags;fi +if $ask_rubik;then showfun install-rubik;v install-rubik;fi ##################################################################################### printf '\e[36m3. Copying\e[97m\n' From ebe4191b6f23d76b521c7d0b6281e3aac764bbab Mon Sep 17 00:00:00 2001 From: clsty Date: Sun, 7 Jan 2024 08:49:13 +0800 Subject: [PATCH 09/11] Several fix (err catch inside fun; install-yay...) --- install.sh | 138 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 90 insertions(+), 48 deletions(-) diff --git a/install.sh b/install.sh index f60498b8..87ebcb61 100755 --- a/install.sh +++ b/install.sh @@ -7,7 +7,6 @@ function v() { echo -e "\e[34m[$0]: Next command to be executed:\e[0m" echo -e "\e[32m$@\e[0m" execute=true - cmdstatus=0 # 0=normal; 1=failed; 2=failed but ignored; 3=skipped if $ask;then while true;do echo -e "\e[34mDo you want to execute the command shown above? \e[0m" @@ -19,27 +18,31 @@ function v() { case $p in [yY]) echo -e "\e[34mOK, executing...\e[0m" ;break ;; [eE]) echo -e "\e[34mExiting...\e[0m" ;exit ;break ;; - [sS]) echo -e "\e[34mAlright, skipping this one...\e[0m" ;export execute=false;cmdstatus=3 ;break ;; - "yesforall") echo -e "\e[34mAlright, won't ask again. Executing...\e[0m"; export ask=false ;break ;; + [sS]) echo -e "\e[34mAlright, skipping this one...\e[0m" ;execute=false ;break ;; + "yesforall") echo -e "\e[34mAlright, won't ask again. Executing...\e[0m"; ask=false ;break ;; *) echo -e "\e[31mPlease enter one of [y/e/s/yesforall].\e[0m";; esac done fi - if $execute;then - "$@" || cmdstatus=1 + if $execute;then x "$@";else + echo -e "\e[33m[$0]: Command \"\e[32m$@\e[33m\" has been skipped by user.\e[0m" fi +} +# When use v() for a defined function, use x() INSIDE its definition to catch errors. +function x() { + if "$@";then cmdstatus=0;else cmdstatus=1;fi # 0=normal; 1=failed; 2=failed but ignored while [ $cmdstatus == 1 ] ;do echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed." echo -e "You may need to resolve the problem manually BEFORE repeating this command.\e[0m" echo " r = Repeat this command (DEFAULT)" echo " e = Exit now" - echo " i = Ignore the error and continue this script anyway (may break functions needed by the dotfiles!)" + echo " i = Ignore this error and continue (your setup might not work correctly)" read -p "Enter here [R/e/i]: " p case $p in [iI]) echo -e "\e[34mAlright, ignore and continue...\e[0m";cmdstatus=2;; [eE]) echo -e "\e[34mAlright, will exit.\e[0m";break;; *) echo -e "\e[34mOK, repeating...\e[0m" - "$@" && cmdstatus=0 + if "$@";then cmdstatus=0;else cmdstatus=1;fi ;; esac done @@ -47,11 +50,10 @@ function v() { 0) echo -e "\e[34m[$0]: Command \"\e[32m$@\e[34m\" finished.\e[0m";; 1) echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed. Exiting...\e[0m";exit 1;; 2) echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed but ignored by user.\e[0m";; - 3) echo -e "\e[33m[$0]: Command \"\e[32m$@\e[33m\" has been skipped by user.\e[0m";; esac } function showfun() { - echo -e "\e[34mThe definition of function \"$1\" is as follows:\e[0m" + echo -e "\e[34m[$0]: The definition of function \"$1\" is as follows:\e[0m" printf "\e[32m" type -a $1 printf "\e[97m" @@ -64,6 +66,7 @@ function showfun() { # # echo "debug part fin";exit ##################################################################################### +if ! command -v pacman >/dev/null 2>&1;then printf "\e[31m[$0]: pacman not found, it seems that the system is not ArchLinux or Arch-based distros. Aborting...\e[0m\n";exit 1;fi startask (){ printf "\e[34m[$0]: Hi there!\n" printf 'This script 1. only works for ArchLinux and Arch-based distros.\n' @@ -71,35 +74,53 @@ printf ' 2. has not been fully tested, use at your own risk.\n' printf "\e[31m" printf "Please CONFIRM that you HAVE ALREADY BACKED UP \"$HOME/.config/\" and \"$HOME/.local/\" folders!\n" printf "\e[97m" -printf "Enter capital \"YES\" (without quotes) to continue: " +printf "Enter capital \"YES\" (without quotes) to continue:" read -p " " p case $p in "YES")sleep 0;; *)exit;;esac printf '\n' printf 'Do you want to confirm everytime before a command executes?\n' -printf ' y = Yes, ask me before executing each of them. (RECOMMENDED)\n' -printf ' n = No, just execute them automatically.\n' -printf ' a = Abort. (DEFAULT)\n' +printf ' y = Yes, ask me before executing each of them. (RECOMMENDED)\n' +printf ' n = No, just execute them automatically.\n' +printf ' a = Abort. (DEFAULT)\n' read -p "Enter [y/n/A]: " p case $p in - y)export ask=true;; - n)export ask=false;; + y)ask=true;; + n)ask=false;; *)exit;; esac } case $1 in - "-f")export ask=false;; + "-f")ask=false;; *)startask ;; esac set -e ##################################################################################### -printf '\e[36m1. Get packages and add user to video/input groups\n\e[97m' +printf "\e[36m[$0]: 1. Get packages and add user to video/input groups\n\e[97m" # Each line as an element of the array $pkglist readarray -t pkglist < dependencies.txt # NOTE: wayland-idle-inhibitor-git is for providing `wayland-idle-inhibitor.py' used by the `Keep system awake' button in `.config/ags/widgets/sideright/quicktoggles.js'. +# yay will be installed as AUR package and upgrade there, no need to build here in cache/yay . +install-yay() { + x sudo pacman -Sy --needed --noconfirm base-devel + try git clone https://aur.archlinux.org/yay-bin.git /tmp/buildyay + cd /tmp/buildyay + x makepkg -o + x makepkg -se + x makepkg -i --noconfirm + cd $base + rm -rf /tmp/buildyay +} + +if ! command -v yay >/dev/null 2>&1;then + echo -e "\e[33m[$0]: \"yay\" not found.\e[0m" + showfun install-yay + v install-yay +fi + if $ask;then # execute per element of the array $pkglist for i in "${pkglist[@]}";do v yay -S --needed $i;done @@ -112,51 +133,72 @@ v sudo usermod -aG video "$(whoami)" v sudo usermod -aG input "$(whoami)" ##################################################################################### -printf '\e[36m2. Installing AGS and rubik from git repo\e[97m\n' +printf "\e[36m[$0]: 2. Installing AGS and fonts from git repo\e[97m\n" sleep 1 install-ags (){ - mkdir -p $base/ags - cd $base/ags + x mkdir -p $base/cache/ags + x cd $base/cache/ags try git init -b main try git remote add origin https://github.com/Aylur/ags.git - git pull origin main && git submodule update --init --recursive - npm install - meson setup build - meson install -C build - cd $base + x git pull origin main && git submodule update --init --recursive + x npm install + x meson setup build + x meson install -C build + x cd $base } -install-rubik (){ - mkdir -p $base/rubik - cd $base/rubik +install-Rubik (){ + x mkdir -p $base/cache/Rubik + x cd $base/cache/Rubik try git init -b main try git remote add origin https://github.com/googlefonts/rubik.git - git pull origin main && git submodule update --init --recursive - sudo mkdir -p /usr/local/share/fonts/TTF/ - sudo cp fonts/variable/Rubik*.ttf /usr/local/share/fonts/TTF/ - sudo mkdir -p /usr/local/share/licenses/ttf-rubik/ - sudo cp OFL.txt /usr/local/share/licenses/ttf-rubik/LICENSE - fc-cache -fv - cd $base + x git pull origin main && git submodule update --init --recursive + x sudo mkdir -p /usr/local/share/fonts/TTF/ + x sudo cp fonts/variable/Rubik*.ttf /usr/local/share/fonts/TTF/ + x sudo mkdir -p /usr/local/share/licenses/ttf-rubik/ + x sudo cp OFL.txt /usr/local/share/licenses/ttf-rubik/LICENSE + x fc-cache -fv + x cd $base +} +install-Gabarito (){ + x mkdir -p $base/cache/Gabarito + x cd $base/cache/Gabarito + try git init -b main + try git remote add origin https://github.com/naipefoundry/gabarito.git + x git pull origin main && git submodule update --init --recursive + x sudo mkdir -p /usr/local/share/fonts/TTF/ + x sudo cp fonts/ttf/Gabarito*.ttf /usr/local/share/fonts/TTF/ + x sudo mkdir -p /usr/local/share/licenses/ttf-gabarito/ + x sudo cp OFL.txt /usr/local/share/licenses/ttf-gabarito/LICENSE + x fc-cache -fv + x cd $base } if command -v ags >/dev/null 2>&1;then - echo -e "\e[34mCommand \"ags\" already exists, no need to install.\e[0m" - echo -e "\e[34mYou can reinstall ags in order to update to the latest version anyway.\e[0m" + echo -e "\e[33m[$0]: Command \"ags\" already exists, no need to install.\e[0m" + echo -e "\e[34mYou can reinstall it in order to update to the latest version anyway.\e[0m" ask_ags=$ask else ask_ags=true fi -if $(fc-list|grep -q Rubik); then - echo -e "\e[34mFont \"Rubik\" already exists, no need to install.\e[0m" - echo -e "\e[34mYou can reinstall Rubik in order to update to the latest version anyway.\e[0m" - ask_rubik=$ask -else ask_rubik=true -fi - if $ask_ags;then showfun install-ags;v install-ags;fi -if $ask_rubik;then showfun install-rubik;v install-rubik;fi + +if $(fc-list|grep -q Rubik); then + echo -e "\e[33m[$0]: Font \"Rubik\" already exists, no need to install.\e[0m" + echo -e "\e[34mYou can reinstall it in order to update to the latest version anyway.\e[0m" + ask_Rubik=$ask +else ask_Rubik=true +fi +if $ask_Rubik;then showfun install-Rubik;v install-Rubik;fi + +if $(fc-list|grep -q Gabarito); then + echo -e "\e[33m[$0]: Font \"Gabarito\" already exists, no need to install.\e[0m" + echo -e "\e[34mYou can reinstall it in order to update to the latest version anyway.\e[0m" + ask_Gabarito=$ask +else ask_Gabarito=true +fi +if $ask_Gabarito;then showfun install-Gabarito;v install-Gabarito;fi ##################################################################################### -printf '\e[36m3. Copying\e[97m\n' +printf "\e[36m[$0]: 3. Copying\e[97m\n" # In case ~/.local/bin does not exists v mkdir -p "$HOME/.local/bin" "$HOME/.local/share" @@ -167,7 +209,7 @@ v mkdir -p "$HOME/.local/bin" "$HOME/.local/share" for i in .config/* do - echo "Found target: $i" + echo "[$0]: Found target: $i" if [ -d "$i" ];then v rsync -av --delete "$i/" "$HOME/$i/" elif [ -f "$i" ];then v rsync -av "$i" "$HOME/$i" fi @@ -175,7 +217,7 @@ done target="$HOME/.config/hypr/colors.conf" test -f $target || { \ - echo -e "\e[34mFile \"$target\" not found.\e[0m" && \ + echo -e "\e[34m[$0]: File \"$target\" not found.\e[0m" && \ v cp "$HOME/.config/hypr/colors_default.conf" $target ; } # some foldes (eg. .local/bin) should be processed seperately to avoid `--delete' for rsync, From 57eb436948875711c32ab83fa343ee1b91d3b402 Mon Sep 17 00:00:00 2001 From: clsty Date: Sun, 7 Jan 2024 09:12:49 +0800 Subject: [PATCH 10/11] Add cache/ to gitignore --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a7d968cf..69150b66 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,4 @@ .config/ags/style.css .config/ags/scss/_material.scss .config/hypr/colors.conf -/ags -/rubik +/cache From 2538429fb8af475e778573c4d7afaf017d4abc0e Mon Sep 17 00:00:00 2001 From: clsty Date: Sun, 7 Jan 2024 09:55:36 +0800 Subject: [PATCH 11/11] minor fix for install-yay. --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 87ebcb61..d144e424 100755 --- a/install.sh +++ b/install.sh @@ -106,12 +106,12 @@ readarray -t pkglist < dependencies.txt # yay will be installed as AUR package and upgrade there, no need to build here in cache/yay . install-yay() { x sudo pacman -Sy --needed --noconfirm base-devel - try git clone https://aur.archlinux.org/yay-bin.git /tmp/buildyay - cd /tmp/buildyay + x git clone https://aur.archlinux.org/yay-bin.git /tmp/buildyay + x cd /tmp/buildyay x makepkg -o x makepkg -se x makepkg -i --noconfirm - cd $base + x cd $base rm -rf /tmp/buildyay }