This commit is contained in:
Terry
2022-11-18 23:59:12 -05:00
parent 12fdce2ce0
commit 078ee3259f
6 changed files with 70 additions and 33 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
lib64
lib
pyvenv.cfg
bin

19
main.py Executable file
View File

@@ -0,0 +1,19 @@
#!/home/deck/.keiran-sds/bin/python3
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
def window():
app = QApplication(sys.argv)
w = QWidget()
b = QLabel(w)
b.setText("Hello World")
w.setGeometry(100,100,200,50)
b.move(50,20)
w.setWindowTitle('PyQt5')
w.show()
sys.exit(app.exec_())
if __name__ == '__main__':
window()

View File

@@ -1,33 +0,0 @@
#!/bin/bash
# vim: ts=4:sw=4:et
if which ncdu &>/dev/null; then
zenity --info --title='Result' --no-wrap --text='ncdu is already installed'
exit 0
fi
if ! tty -s; then
# script is running non-interactively, for ex by clicking "Execute" in dolphin
zenity --password --title="Enter password for `whoami`" --timeout=10 | sudo --stdin -- \
konsole --hold -e "$0" "$@"
exit $?
elif [[ $UID -ne 0 ]]; then
# script run in konsole, but without sudo
echo "switching to root"
sudo /bin/bash "$0" "$@"
exit $?
fi
# SteamOS's wrapper for: btrfs property set -ts / ro false
steamos-readonly disable
pacman-key --init
pacman-key --populate archlinux
pacman -S ncdu
# SteamOS's wrapper for: btrfs property set -ts / ro true
steamos-readonly enable
echo 'This window is now safe to close.'
# zenity --info --title='Result' --no-wrap --text='Done'

39
ncdu.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
# vim: ts=4:sw=4:et
if which ncdu &>/dev/null; then
zenity --info --title='Result' --no-wrap --text='ncdu is already installed'
exit 0
fi
if ! tty -s; then
# script is running non-interactively, for ex by clicking "Execute" in dolphin
zenity --password --title="Enter password for `whoami`" --timeout=10 | sudo --stdin -- \
konsole -e "$0" "$@"
exit $?
elif [[ $UID -ne 0 ]]; then
# script run in konsole, but without sudo
echo "switching to root"
sudo /bin/bash "$0" "$@"
exit $?
fi
(
echo 0
echo '# setting / to read/write'
steamos-readonly disable
echo 15
echo '# setting up package manager keys'
pacman-key --init
pacman-key --populate archlinux
echo 50
echo '# installing ncdu'
pacman --quiet --noprogressbar --noconfirm --sync ncdu networkmanager-openvpn
echo 90
echo '# setting / back to read only'
steamos-readonly enable
echo 100
) | zenity --progress --no-cancel --width=400 2>/dev/null
#~deck/.local/share/steam
#/run/media/mmcblk0p1

1
requirements.txt Normal file
View File

@@ -0,0 +1 @@
PyQt5

7
setup.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
cd ~
git clone https://git.keiran.us/keiran/steamdeck-scripts.git .keiran-sds
python3 -m venv ~/.keiran-sds
cd ~/.keiran-sds
./bin/pip3 install --upgrade pip
./bin/pip3 install -r requirements.txt