From 9feed43828d2960d20fa62c96728cfd3a5d27a7a Mon Sep 17 00:00:00 2001 From: Terry Date: Sat, 19 Nov 2022 21:52:25 -0500 Subject: [PATCH] setup with zenity --- setup.sh | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index f8bf37a..c543c71 100644 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,31 @@ #!/bin/bash -cd ~ -git clone https://git.keiran.us/keiran/steamdeck-scripts.git .keiran-sds +if [ -d /home/deck/.keiran-sds ]; then + if zenity --question --no-wrap --no-wrap \ + --text='Keiran Steam Deck Scripts is already installed. Re-install?'; then + rm -rf /home/deck/.keiran-sds + else + echo canceled + exit 0 + fi +fi + +coproc zenity --progress --auto-close --title='Installing' --text='Git cloning...' + +cd /home/deck +if ! git clone https://git.keiran.us/keiran/steamdeck-scripts.git .keiran-sds; then + echo 100 >&${COPROC[1]} + zenity --error --no-wrap --no-markup --text='failed to clone https://git.keiran.us/keiran/steamdeck-scripts' + exit 1 +fi + +echo 33 >&${COPROC[1]} +echo '#Setting up virtual environment...' >&${COPROC[1]} python3 -m venv ~/.keiran-sds -cd ~/.keiran-sds -./bin/pip3 install --upgrade pip -./bin/pip3 install -r requirements.txt \ No newline at end of file +/home/deck/.keiran-sds/bin/pip3 install --upgrade pip +cd /home/deck/.keiran-sds + +echo 67 >&${COPROC[1]} +echo '#Installing dependencies...' >&${COPROC[1]} +/home/deck/.keiran-sds/bin/pip3 install -r requirements.txt + +echo 100 >&${COPROC[1]} # Close Zenity \ No newline at end of file