02-12-2021, 04:48 AM
There's a text based spotify client that runs in text mode called spotify-tui, which I thought looked nice,
so I took some time to make it run on the pinephone.
Here it is running in the st terminal in sxmo
Prereqs:
You need the following packages installed (there might be some missing from this list though)
You also need to add the cargo bin dir to path, easiest way is to add this line to ~/.profile
Load the new path variable into environment with source:
After that installing spotify-tui should be easy:
Use -j4 if you want to, to speed things up a bit. Draws a lot of battery though.
And this operation might take an hour on the phone (I'm trying to figure out cross-compilation to make it faster, but openssl is giving me a hard time).
Now we need to temporarily change the default browers to firefox (or chromium), in order to open up the link to authenticate the spotify API.
You can do this in sxmo by setting the $BROWSER flag by setting
Either in ~/.profile (you must make sure it's loaded, restarting the phone should fix that)
or by just passing it in a console you're running in your phones GUI (not in a ssh shell since it might not load the web browser properly)
After that just follow this guide:
https://github.com/Rigellute/spotify-tui...otifys-api
You can now run the client with the command
in a console in the phones GUI where Wayland (or X) is running.
This will open the API authentication link in Firefox, login and confirm the authentication, and then close Firefox.
Now you can control your Spotify clients from your text interface.
But for native playback we need to have spotifyd installed and running as a daemon,
install should be as easy as installing spotify-tui:
This will also take a while, probably 1 hour, again using -j4 is optional, makes it a bit faster, but also draws a lot of power.
After the install, try running it with:
Now a new device should appear in your device list in your spotify client, e.g. Spotifyd@sxmo
Make sure that your phone is set to play from the speakers (or headphones, if you have those plugged in)
In spotify-tui you might need to set which client you want to do the playback by pressing
Notes: If the volume is too high the sound quality really deteriorates, so play at lower volumes (or use headphones)
Spotifyd has systemd scripts to turn it into a service, you can convert that script into an openrc service by using initify: https://github.com/goose121/initify and placing it in /etc/init.d/
Some extra tweaks needs to be done here to make it run properly which I haven't done yet, it crashes on boot and needs to be restarted (probably need to add network prereq in rc script)
so I took some time to make it run on the pinephone.
Here it is running in the st terminal in sxmo
Prereqs:
You need the following packages installed (there might be some missing from this list though)
- libssl-dev or openssl-dev
- cargo
- rust
- pkg-config
- libxcb-dev
- xdg-utils
- firefox-esr (or chromium), to activate the spotify API, since surf doesn't seem to load the webpage properly
You also need to add the cargo bin dir to path, easiest way is to add this line to ~/.profile
Code:
export PATH=$PATH:~/.cargo/bin
Code:
source ~/.profile
Code:
cargo install spotify-tui -j4
And this operation might take an hour on the phone (I'm trying to figure out cross-compilation to make it faster, but openssl is giving me a hard time).
Now we need to temporarily change the default browers to firefox (or chromium), in order to open up the link to authenticate the spotify API.
You can do this in sxmo by setting the $BROWSER flag by setting
Code:
export BROWSER=firefox
or by just passing it in a console you're running in your phones GUI (not in a ssh shell since it might not load the web browser properly)
After that just follow this guide:
https://github.com/Rigellute/spotify-tui...otifys-api
You can now run the client with the command
Code:
spt
This will open the API authentication link in Firefox, login and confirm the authentication, and then close Firefox.
Now you can control your Spotify clients from your text interface.
But for native playback we need to have spotifyd installed and running as a daemon,
install should be as easy as installing spotify-tui:
Code:
cargo install spotifyd -j4
After the install, try running it with:
Code:
spotifyd -u <spotify username> -p <spotify password>
Make sure that your phone is set to play from the speakers (or headphones, if you have those plugged in)
In spotify-tui you might need to set which client you want to do the playback by pressing
Code:
d
Spotifyd has systemd scripts to turn it into a service, you can convert that script into an openrc service by using initify: https://github.com/goose121/initify and placing it in /etc/init.d/
Some extra tweaks needs to be done here to make it run properly which I haven't done yet, it crashes on boot and needs to be restarted (probably need to add network prereq in rc script)