-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·55 lines (47 loc) · 1.58 KB
/
install
File metadata and controls
executable file
·55 lines (47 loc) · 1.58 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
# Create the virtual environment
PYS_BASE="$HOME/.local/pysplit"
PYS_NEWBASE=""
echo "Choose a directory to create the Python virtual environment in. Enter nothing to use $PYS_BASE"
read PYS_NEWBASE
if [ -n "$PYS_NEWBASE" ]; then
PYS_BASE=$PYS_NEWBASE
fi
python3 -m venv $PYS_BASE/venv
$PYS_BASE/venv/bin/pip3 install -r requirements.txt
# Install all the binaries
BASE="$HOME/.local/bin"
NEWBASE=""
echo "Choose a directory to install in. Enter nothing to use $BASE"
read NEWBASE
if [ -n "$NEWBASE" ]; then
BASE=$NEWBASE
fi
echo -e "#!/usr/bin/bash cd $PWD\n$PYS_BASE/venv/bin/python3 $PWD/runTimer.py" > "$BASE/pysplit"
echo -e "#!/usr/bin/bash cd $PWD\n$PYS_BASE/venv/bin/python3 $PWD/practice.py" > "$BASE/practiceTimer"
echo -e "#!/usr/bin/bash cd $PWD\n$PYS_BASE/venv/bin/python3 $PWD/variance.py" > "$BASE/timeVariance"
echo -e "#!/usr/bin/bash cd $PWD\n$PYS_BASE/venv/bin/python3 -m hotkeys.globalHotkeys" > "$BASE/pysplitHotkeys"
chmod +x $BASE/pysplit
chmod +x $BASE/practiceTimer
chmod +x $BASE/timeVariance
chmod +x $BASE/pysplitHotkeys
# Default the base save directory to the directory with the venv
cat > config/global.json << EOF
{
"baseDir": "$PYS_BASE/splits",
"logFile": "$PYS_BASE/log",
"installDirectory": "$BASE"
}
EOF
# Create the desktop app
cp $PWD/icon.png $PYS_BASE/icon.png
cat > $HOME/.local/share/applications/pysplit.desktop << EOF
[Desktop Entry]
Name=PySplit
Comment=Segmented Timer Written in Python
Exec=$BASE/pysplit
Icon=$PYS_BASE/icon.png
Terminal=false
Type=Application
Categories=Utility;
EOF
update-desktop-database $HOME/.local/share/applications