Tetrax-10 / Nord-Spotify

Nord Themed Spotify
https://tetrax-10.github.io/Nord-Spotify/
MIT License
331 stars 20 forks source link

Linux install script: Choose between online and offline version #29

Closed FancyChaos closed 1 year ago

FancyChaos commented 1 year ago

Hello there. Here is the PR to provide the user the option to install the online or offline version of Nord Spotify on Linux.

The install command in the README had to be changed so user input can be read. We can not read the user input from stdin anymore when executed with sh after the pipe (|).

An automatic install of the online or offline version is still possible by providing yes 1 or yes 2 to the install command (1=online, 2=offline):

yes 1 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/Tetrax-10/Nord-Spotify/master/install-scripts/install.sh)" yes 2 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/Tetrax-10/Nord-Spotify/master/install-scripts/install.sh)"

Example of how the install process now looks:

-> sh -c "$(curl -fsSL https://raw.githubusercontent.com/FancyChaos/Nord-Spotify/linux_install_offline_option/install-scripts/install.sh)"

Nord Spotify can be installed with auto updates included (online version) or with auto updates excluded (offline version):
1: Auto Update - Theme requires internet access. Updates the Theme automatically when there is a new update available
2: Offline     - Works without internet and thus gives better performance. Re-running this shell script installs the latest update

Please choose a version: 1

Installing Nord Spotify (Auto Update Version)
Fetching Theme from GitHub

Changing configuration
warning Config "extensions" unchanged: nord.js is not on the list.
success Config changed: current_theme = Nord-Spotify
info Run "spicetify apply" to apply new config
success Config changed: color_scheme = Spotify
info Run "spicetify apply" to apply new config
warning Config "extensions" unchanged: injectNord.js is already in the list.
success Config changed: inject_css = 1
info Run "spicetify apply" to apply new config
success Config changed: replace_colors = 1
info Run "spicetify apply" to apply new config
success Config changed: overwrite_assets = 1
info Run "spicetify apply" to apply new config
Applying Theme
spicetify v2.16.2
Overwriting themed assets:
OK
Transferring user.css:
OK
Applying additional modifications:
OK
Transferring extensions:
OK
success Spotify is spiced up!

Nord Spotify installed successfully

I tried to keep this script as close as possible to the power shell one. Spotify will also be backed up by spicetify if not already done.

BIG DISCLAIMER Unfortunately I do now own any MacOS device and can therefore not test if all changes work for it! But given that the install script is POSIX sh it should work, but I can not guarantee it.

Tetrax-10 commented 1 year ago

Thanks, @FancyChaos, for the PR. It works like a charm on Linux, but I'm not sure if it works for macOS. I've asked some people to check it, so after that, I will merge this PR. Thanks again for this awesome feature and your time.

Tetrax-10 commented 1 year ago

Just now found a script that has a choice option with curl

curl -fsSL https://raw.githubusercontent.com/NYRI4/Comfy-spicetify/main/uninstall.sh | sh

image

I don't want to use sh -c as it seems to not work with macOS. You can refer to that script for choice options. If I have time, I will edit and request changes, else feel free to edit it✌️.

FancyChaos commented 1 year ago

Just now found a script that has a choice option with curl

curl -fsSL https://raw.githubusercontent.com/NYRI4/Comfy-spicetify/main/uninstall.sh | sh

image

I don't want to use sh -c as it seems to not work with macOS. You can refer to that script for choice options. If I have time, I will edit and request changes, else feel free to edit itv.

Fixed it. Haven't realized that it is possible to just read input from the current terminal with </dev/tty. Do not know why I did not pickup that the uninstall script already does exactly that lol. Thanks for pointing it out.

Tetrax-10 commented 1 year ago

lol am so dumb with these scripts, no idea what that </dev/tty means 😂

FancyChaos commented 1 year ago

lol am so dumb with these scripts, no idea what that </dev/tty means joy

But you however know how to create great themes :D I'm using this one for a bit over a week now and could not be happier :)