PYThing is a alternative UI for the discontinued Spotify Car Thing to be used at a desk without needing to be tied to a spotify account and phone. Designed to be modular, new apps and even new devices can be supported.
- Automatic carthing connection
- Many different clients can be used, as long as they provide chromium
- Easy setup
- Light on the client
- Very modular, all features that are not important to the core are within apps that can be removed/replaced easily
Go to releases, and download the release for your device, and run it. On linux, you may need to run chmod +x pything-linux before running. If you are using an ARM device or a mac, you will need to run from source.
You must know the basics of python development and have uv installed.
Clone this repo
Run uv run -m pything on linux/macos and uv run --python 3.12 -m pything on windows
The web UI is visible at http://127.0.0.1:5192.
All app settings can be configured from http://127.0.0.1:5192/settings.
If you have a Car Thing, it should be detected automatically on a supported firmware. Two firmwares are supported at this time:
- Thing Labs (Recommended for just PYThing)
- Boots into PYThing automatically when launched
- Everything works
- You may need to flash the
*_norndisimage if you have problems the first time
- Bridgething
- You must open the browser app and open
http://127.0.0.1:5192?device=bridgethingon every boot - Only the desktop version of Bridgething is supported
- Some buttons may not work
- Not tested as frequently
- You must open the browser app and open
Firmware can be flashed from Terbium. The Thing Labs firmware needs to be downloaded manually from the site linked above.
Important
Factory Reset to Spotify in Terbium is NOT the same as the Thing Labs firmware, you must use the local archive option.
Make sure you are running the Thing Labs/Bridgething firmware, if the device is not detected by the script, make sure the device shows up when running adb devices. You may need udev rules on linux. If it is not detected when your computer turns on, it may need to be manually unplugged and replugged.
Some AMD processors require the norndis firmware to be used instead of the regular one, if nothing else works, try that.
All apps can store data in the form of settings, you can access any visible settings from /settings
- Clock
- A basic clock app
- System
- Shows information about your computer
- RAM
- CPU
- Disk
- Network
- Shows information about your computer
- Music
- App that can take input from other apps.
- Basically, takes input from a 'provider' app, and passes that data to everything else.
- Injects code into the client to display a playbar
- Spotify
- A music provider app, takes data from spotify. Requires spotify premium.
- Because it relies on the Spotify API, song changes will take ~2-4 seconds to show up, sometimes longer.
- Local Music
- A music provider app that reads the active media session from Windows or Linux.
- Lyrics
- An app that takes the data from the music provider, and gets the lyrics for the current song.
- Uses LRCLIB and only requests lyrics when the app is open on at least one device
- Customizer
- An app that provides custom colors to the UI
- Takes broadcasts from other apps so any app can set the accent color
- Addons
- An app that adds features that shouldn't be in the core (e.g. screen locking)
device-carthing- Sets up any connected Car Things
- Prompts to download ADB if it is not already installed.
To create a custom app, you must be using the source build. Apps have a defined structure, but not all files are needed. Apps can either be in apps or customapps. customapps are excluded from git. All apps are loaded as a python module, so your init script should be in /src/pything/apps/<id>/__init__.py. The app needs to expose an app variable, of the App class from pything.app. Look around at the built in apps to see what you can do! While there are no docs yet, PYThing is made to be easy to extend, and part of the experience is making your own app! If you want to distribute your app, you can zip the contents of your app folder (with the manifest and init at the root) and have usings install it from the apps page.
Building pything with your modifications can be done by either running build.sh (linux/macos) or build.bat (windows).
[!IMPORTANT]
Windows and linux require gcc to be installed, on Windows you should use MSYS2
If you want to make hardware to be used with PYThing, there are some basic rules to follow. The hardware buttons of the Car Thing are shown below, apps may rely on these for functionality.
- Menu button (Key M)
- Required for exiting applications
- Scroll wheel (Horizontal scroll, scroll right on clockwise)
- Select (Key Enter)
- On the Car Thing, it is placed in the center of the scroll wheel
- Back key (Key Backspace)
- Button row (Numbers 1-4)
The device should boot to a chromium webview (Should be v70 or higher if possible), and when ready, load the page
http://localhost:5192/client?device=<id>, feel free to make the ID whatever you want. You may check if the server is ready by pinginghttp://localhost:5192/isready, and loading when it is.
- The client facing html is written with as little dependencies as possible to save space and load time, no frameworks are used.
- With as modular as this app is, any unneeded features can be taken away by removing the app responsible for it, even Car Thing support can be removed if only other clients are being used.
- Apps have access to an
app.should_poll()function, which returns true if any client has the app open. This allows apps to not poll a service when no clients have the app open.- This helps performance and helps prevent rate limits from being hit.
- All built in apps use a cache when, like the lyrics app, which stores in memory and wipes after a song change, and spotify, that stores until an app restart, or until manually cleared in development.
- This saves a lot of data from being re-downloaded constantly, at the cost of extra storage writes.
- The server only sends data to clients that need the data, by having the server keep track of what app is open, so when an app sends data, it only goes to clients that have the app open.
- This saves a lot of bandwidth