-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_linux.sh
More file actions
executable file
·62 lines (56 loc) · 1.91 KB
/
Copy pathinstall_linux.sh
File metadata and controls
executable file
·62 lines (56 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
echo "Shattered Pixel Dungeon Trainer - Linux Installer"
echo "================================================="
# Check if Python 3 is installed
if ! command -v python3 &> /dev/null; then
echo "Python 3 is not installed. Installing..."
if command -v apt &> /dev/null; then
sudo apt update
sudo apt install -y python3 python3-pip
elif command -v dnf &> /dev/null; then
sudo dnf install -y python3 python3-pip
elif command -v pacman &> /dev/null; then
sudo pacman -S python python-pip
else
echo "Please install Python 3 manually and run this script again."
exit 1
fi
else
echo "Python 3 is already installed."
fi
# Check if pip is installed
if ! command -v pip3 &> /dev/null && ! python3 -m pip --version &> /dev/null; then
echo "pip is not installed. Installing..."
if command -v apt &> /dev/null; then
sudo apt install -y python3-pip
elif command -v dnf &> /dev/null; then
sudo dnf install -y python3-pip
elif command -v pacman &> /dev/null; then
sudo pacman -S python-pip
fi
fi
# Install required Python packages
echo "Installing required Python packages..."
python3 -m pip install --user pynput
# Check if tkinter is available
echo "Checking for tkinter..."
python3 -c "import tkinter; print('tkinter is available')" 2>/dev/null
if [ $? -ne 0 ]; then
echo "tkinter not found. Installing tkinter..."
if command -v apt &> /dev/null; then
sudo apt install -y python3-tk
elif command -v dnf &> /dev/null; then
sudo dnf install -y python3-tkinter
elif command -v pacman &> /dev/null; then
sudo pacman -S tk
else
echo "Please install tkinter manually."
fi
fi
echo ""
echo "Installation complete!"
echo ""
echo "To run the trainer:"
echo " python3 gui_trainer.py"
echo ""
echo "The trainer will run in the background. Press \` (backtick) to open the interface."