diff --git a/scripts/vars.sh b/scripts/vars.sh index c8ba8bf..52a6a21 100644 --- a/scripts/vars.sh +++ b/scripts/vars.sh @@ -9,11 +9,21 @@ function ProgressBar { printf "[${_fill// /▇}${_empty// / }] ${_progress}%% Done" } +os=$(grep ^ID= /etc/os-release | cut -d "=" -f 2 | tr -d \") + +case $os in +silverblue|kinoite) +homedir=/var/home +;; +*) +homedir=/ +;; +esac bar_length=2 #Number between 1 and 10 today=$(date +%s) -install_date=$(stat -c %W /) -install_date_day=$(stat -c %W / | awk '{print strftime("%e/%m/%Y",$1)}' | awk '{$1=$1};1') +install_date=$(stat -c %W $homedir) +install_date_day=$(stat -c %W $homedir | awk '{print strftime("%e/%m/%Y",$1)}' | awk '{$1=$1};1') install_time=$(( ($today - $install_date) / 86400 )) end_challenge=30 percentage=$(( $install_time / $end_challenge * 100 ))