Skip to content

Commit

Permalink
fix: linux install
Browse files Browse the repository at this point in the history
  • Loading branch information
elibroftw committed Mar 14, 2024
1 parent 49c827e commit c8ce589
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Make sure you have Python 3.12, pip, and tkinter installed before running the co

```bash
mkdir -p ~/bin && git clone --depth 1 https://github.com/elibroftw/music-caster.git ~/bin/music-caster
~/bin/music-caster/linux_install.sh
cd ~/bin/music-caster
./linux_install.sh
```

## Demo
Expand Down
14 changes: 7 additions & 7 deletions linux_install.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -ex
cd ~/bin/music-caster
# cd ~/bin/music-caster
echo "(music-caster) Updating..."
git fetch
git reset --hard "@{u}"
PYTHON=python3.10
PYTHON=python3
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
Expand All @@ -22,23 +22,23 @@ cd -
mkdir -p ~/Downloads/music-caster-tmp

# 32x32
cp -rf ~/bin/music-caster/resources/icons/32x32.png ~/Downloads/music-caster-tmp
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 ~/bin/music-caster/resources/icons/128x128.png ~/Downloads/music-caster-tmp
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 ~/bin/music-caster/resources/icons/[email protected] ~/Downloads/music-caster-tmp
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 ~/bin/music-caster/resources/icons/icon.png ~/Downloads/music-caster-tmp
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 ~/bin/music-caster/music_caster.desktop ~/.local/share/applications
cp -rf music_caster.desktop ~/.local/share/applications

# delete old files
rm -rf ~/.icons/music_caster.png

0 comments on commit c8ce589

Please sign in to comment.