This commit is contained in:
Valeria Fadeeva 2025-01-07 02:46:03 +05:00
parent 64f4f82443
commit 08980c77cc
2 changed files with 26 additions and 47 deletions

View File

@ -56,11 +56,6 @@ fi
# echo "USER IS ROOT" # echo "USER IS ROOT"
# fi # fi
ref=$(kdialog --progressbar "The computer is being configured. Wait until the desktop loads" 100 --title "Waiting for the computer to complete setup")
qdbus $ref org.kde.kdialog.ProgressDialog.autoClose true
sleep 1
grep_text=$(ss -nlp | grep 9050) grep_text=$(ss -nlp | grep 9050)
if [[ "$?" == 0 ]]; then if [[ "$?" == 0 ]]; then
export http_proxy="socks5://127.0.0.1:9050" export http_proxy="socks5://127.0.0.1:9050"
@ -71,9 +66,6 @@ fi
ping -c 1 1.1.1.1 > /dev/null ping -c 1 1.1.1.1 > /dev/null
have_internet="$?" have_internet="$?"
qdbus $ref Set org.kde.kdialog.ProgressDialog value 10
sleep 1
cd "/root" cd "/root"
rm -rf /var/lib/pacman/sync/* rm -rf /var/lib/pacman/sync/*
@ -82,16 +74,10 @@ rm -rf /etc/pacman.d/gnupg/*
mkdir -p /root/.gnupg 2>/dev/null mkdir -p /root/.gnupg 2>/dev/null
chmod 700 /root/.gnupg chmod 700 /root/.gnupg
qdbus $ref Set org.kde.kdialog.ProgressDialog value 20
sleep 1
haveged -w 1024 haveged -w 1024
pacman-key --init pacman-key --init
pkill haveged pkill haveged
qdbus $ref Set org.kde.kdialog.ProgressDialog value 30
sleep 1
pacman-key --add /usr/share/pacman/keyrings/melawy-linux.gpg pacman-key --add /usr/share/pacman/keyrings/melawy-linux.gpg
pacman-key --lsign-key BC8B600E8DDA1F4CB77B10D2BA803A261A5EE6B8 pacman-key --lsign-key BC8B600E8DDA1F4CB77B10D2BA803A261A5EE6B8
pacman-key --lsign-key B175815513971572FE7B1557CEC07AC8FF64DA4B pacman-key --lsign-key B175815513971572FE7B1557CEC07AC8FF64DA4B
@ -119,22 +105,13 @@ pacman-key --lsign-key chaotic
pacman-key --add /usr/share/pacman/keyrings/endeavouros.gpg pacman-key --add /usr/share/pacman/keyrings/endeavouros.gpg
pacman-key --lsign-key endeavouros pacman-key --lsign-key endeavouros
qdbus $ref Set org.kde.kdialog.ProgressDialog value 40
sleep 1
pacman-key --populate pacman-key --populate
qdbus $ref Set org.kde.kdialog.ProgressDialog value 50
sleep 1
echo " echo "
keyserver hkp://keyserver.ubuntu.com:80" | sudo tee --append /etc/pacman.d/gnupg/gpg.conf keyserver hkp://keyserver.ubuntu.com:80" | sudo tee --append /etc/pacman.d/gnupg/gpg.conf
pacman-key --updatedb pacman-key --updatedb
qdbus $ref Set org.kde.kdialog.ProgressDialog value 60
sleep 1
# if [ "$have_internet" -eq 0 ]; then # if [ "$have_internet" -eq 0 ]; then
# pacman -Sy # pacman -Sy
# fi # fi
@ -171,10 +148,5 @@ do
fi fi
done done
qdbus $ref Set org.kde.kdialog.ProgressDialog value 100
sleep 1
qdbus $ref org.kde.kdialog.ProgressDialog.close
echo "Finish!!!" echo "Finish!!!"
sleep 5 sleep 5

View File

@ -1,16 +1,16 @@
#!/bin/bash #!/bin/bash
sleep 5
ref=$(kdialog --progressbar "The computer is being configured. Wait until the desktop loads" 100 --title "Waiting for the computer to complete setup")
qdbus $ref org.kde.kdialog.ProgressDialog.autoClose true
theme="com.github.Melawy.Melawy-round-gray.Nier-A2.desktop" theme="com.github.Melawy.Melawy-round-gray.Nier-A2.desktop"
# Force Zenity Status message box to always be on top.
(
sleep 5
echo "# Set theme"; sleep 1
plasma-apply-lookandfeel -a "$theme" --resetLayout plasma-apply-lookandfeel -a "$theme" --resetLayout
qdbus $ref Set org.kde.kdialog.ProgressDialog value 10 echo "25"
echo "# Remove unneeded link"; sleep 1
if [ "$(whoami)" != "liveuser" ]; then if [ "$(whoami)" != "liveuser" ]; then
sleep 5 sleep 5
if [ -f "$HOME/.config/autostart/reset-layout.desktop" ]; then if [ -f "$HOME/.config/autostart/reset-layout.desktop" ]; then
@ -19,24 +19,31 @@ if [ "$(whoami)" != "liveuser" ]; then
# rm "$HOME/.local/bin/reset-layout.sh" # rm "$HOME/.local/bin/reset-layout.sh"
fi fi
qdbus $ref Set org.kde.kdialog.ProgressDialog value 20 echo "50"
sleep 1 echo "# Get status of plasmashell"; sleep 2
normal_process=$(ps -eo pcpu,stat,comm | grep plasmashell | grep 'S<sl') normal_process=$(ps -eo pcpu,stat,comm | grep plasmashell | grep 'S<sl')
echo "75"
if [ -z "$normal_process" ]; then if [ -z "$normal_process" ]; then
echo "Restart plasma-plasmashell" echo "# Restart plasma-plasmashell"; sleep 1
systemctl --user restart plasma-plasmashell systemctl --user restart plasma-plasmashell
fi fi
qdbus $ref Set org.kde.kdialog.ProgressDialog value 30 echo "99"
sleep 1 echo "# All finished."; sleep 1
echo "100"
) |
zenity --progress \
--title="Waiting for the computer to complete setup. DO NOT CLOSE OR CANCEL!" \
--text="Run" \
--percentage=0 \
--auto-close \
--auto-kill
(( $? != 0 )) && zenity --error --text="Error in zenity command."
sleep 5
notify-send -t 5000 -a "Theme is" "$theme" "$(date '+%Y.%m.%d %H:%M:%S')" notify-send -t 5000 -a "Theme is" "$theme" "$(date '+%Y.%m.%d %H:%M:%S')"
qdbus $ref Set org.kde.kdialog.ProgressDialog value 100
sleep 1
qdbus $ref org.kde.kdialog.ProgressDialog.close
echo "Ready" echo "Ready"
exit 0