-
Notifications
You must be signed in to change notification settings - Fork 17
/
linux_install.sh
executable file
·51 lines (42 loc) · 1.74 KB
/
linux_install.sh
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
#!/usr/bin/env bash
set -ex
echo "(music-caster) Updating..."
# git fetch
# git reset --hard "@{u}"
PYTHON=python3.12
./scripts/pre-req.sh $PYTHON
echo "(music-caster) Creating $PYTHON virtual environment"
# if .venv DNE or has wrong Python version, delete old .venv and install new .venv
if [ ! -d .venv ] || [ "$(.venv/bin/python -V)" != "$($PYTHON -V)" ]; then
rm -rf .venv src/.venv src/venv venv
$PYTHON -m venv .venv
fi
. .venv/bin/activate
echo "(music-caster) Installing dependencies"
python -m pip install --upgrade -r requirements.txt
# restore
cd ~/bin/music-caster
# copy icons
mkdir -p ~/Downloads/music-caster-tmp
mkdir -p ~/.local/share/icons/hicolor/32x32/apps
mkdir -p ~/.local/share/icons/hicolor/128x128/apps
mkdir -p ~/.local/share/icons/hicolor/256x256/apps
mkdir -p ~/.local/share/icons/hicolor/512x512/apps
# 32x32
cp -rf resources/icons/32x32.png ~/Downloads/music-caster-tmp
mv -f ~/Downloads/music-caster-tmp/32x32.png ~/.local/share/icons/hicolor/32x32/apps/music_caster.png
# 128x128
cp -rf resources/icons/128x128.png ~/Downloads/music-caster-tmp
mv -f ~/Downloads/music-caster-tmp/128x128.png ~/.local/share/icons/hicolor/128x128/apps/music_caster.png
# 256x256
cp -rf resources/icons/[email protected] ~/Downloads/music-caster-tmp
mv -f ~/Downloads/music-caster-tmp/[email protected] ~/.local/share/icons/hicolor/256x256/apps/music_caster.png
# 512x512
cp -rf resources/icons/icon.png ~/Downloads/music-caster-tmp
mv -f ~/Downloads/music-caster-tmp/icon.png ~/.local/share/icons/hicolor/512x512/apps/music_caster.png
rm -rf ~/Downloads/music-caster-tmp
# install .desktop file
echo "(music-caster) Registering as desktop application"
cp -rf music_caster.desktop ~/.local/share/applications
# delete old files
rm -rf ~/.icons/music_caster.png