Crates.io | connectr |
lib.rs | connectr |
version | 1.1.2 |
source | src |
created_at | 2017-05-13 16:53:10.616131 |
updated_at | 2020-12-13 17:51:03.4677 |
description | A super lightweight Spotify controller. |
homepage | https://github.com/mrmekon/connectr |
repository | https://github.com/mrmekon/connectr |
max_upload_size | |
id | 14433 |
size | 1,063,643 |
Connectr is a tiny application that lets you quickly and easily see – or change – what's playing on your Spotify account.
It's compatible with anything that supports Spotify Connect: computers, mobiles, speakers, TVs, Playstations, etc.
NOTE: Spotify Premium is required to use Spotify's remote control features. Free accounts do not work.
It runs in the Mac menu bar (top right corner) or Windows system tray (bottom right corner...), and the Mac Touch Bar (the fancy touchscreen on new Macbook keyboards). It's just a little icon that pops up the controls when you need them, and hides away when you don't. Or just hover over it to see what's currently playing.
What it can do:
Most importantly, it maintains a tiny memory footprint while running. ~10MB on a Mac, compared to 300-1000MB for the Spotify desktop app. You shouldn't need to buy extra RAM just to monitor what's playing on your speakers.
The alarm clock and scrobbling features expect Connectr to run on an always-on server. If you want to run it on a headless Linux machine, you can configure it on a local machine first and then move the ~/.connectr.ini
to your server.
For developers: the API for communicating with the Spotify backend is provided as a Rust library, available as a Cargo crate. Connectr exposes the official Spotify 'Player' Web API for controlling Spotify Connect devices.
NOTE: Connectr is not an audio playback tool; it's just a remote control. Spotify has not publicly released a library for implementing audio playback with Spotify Connect support. There's a reverse engineering effort, coincidentally also in Rust, at librespot. The librespot + connectr combo gives you a full Spotify playback experience in ~15MB of RAM. It's the most resource-efficient way to listen to Spotify.
NOTE: Connectr is not developed by Spotify and has nothing to do with their company.
Binary releases are provided as a convenience. Building from source is preferred.
|
|
|
You need to download Rust to build.
$ git clone https://github.com/mrmekon/connectr.git
$ cd connectr
$ cargo run
On first launch, Connectr will open your web browser to a self-configuration page, and save its configuration to your system home directory. The configuration page will walk you through creating the necessary Spotify developer application.
On the first launch, Connectr will guide you through setting up a Spotify developer application. If you want to do it manually instead, or if something goes wrong, here are the instructions:
connectr.ini
(see below).Touch Bar shows
.x
button on the left side.connectr.ini
first.Note: connectr uses ~/.connectr.ini
if it exists. If it does not exist, connectr will fallback to trying connectr.ini
in the directory it is run from. A template is provided in connectr.ini.in
.
The config file is generated by a graphical web configuration the first time Connectr is launched, and can be reconfigured by selecting Reconfigure Connectr
from the menu. It is not necessary to write connectr.ini
yourself. The following documentation is just for reference.
connectr's configuration is read from a regular INI file with these sections:
port = 5432
client_id = ABCABCABCABC123123123
secret = DEFDEFDEFDEF456456456
One preset per line, in either format:
Where:
Preset Name
is any name you want for the presetContext URI
is the Spotify context (album, playlist, etc) to play when selectedQuick-save URI
is (optionally) a playlist to save the current track to if 'Quick-Save' is clicked while this preset is playing.Example:
Make a preset called Bakesale
that plays a Sebadoh album when selected, and saves my favorite tracks from that album to a private playlist:
Bakesale = spotify:album:70XjdLKH7HHsFVWoQipP0T,spotify:user:mrmekon:playlist:4aqg0RkXSxknWvIXARV7or
Note: This can and should be configured through the graphical web interface instead of by editing directly. Select Edit Alarms
from the Connectr menu to launch the graphical interface.
Up to five alarm clock entries, which specify a time, device, playlist to play, and which days to repeat the alarm on.
Format:
alarm<i> = <hour>:<minute>,<repeat>,<Spotify URI>,<Device ID>
<i>
- Number between 0 and 4 (inclusive)<hour>
- Hour in 24-hour time (0-23)<minute>
- Minute (0-59)<repeat>
- One of: daily
, weekdays
, weekends
<Spotify URI>
- URI of a Spotify context to play. Same format as presets.<Device ID>
- Unique ID of the device to play on. These are listed on the graphical web interface, or can be found in the ~/.connectr.log
log file.note: Connectr must be running and connected to the internet at the scheduled alarm time. The target device must also be running and logged in with your Spotify account. This means the alarm functionality is most useful when running on an always-on machine such as a home media server or a VPS. You can run Connectr on a headless server by configuring it on a desktop machine, and copying the ~/.connectr.ini
config to the server.
Optional configuration to have Connectr scrobble track plays to the Last.fm scrobbling service. This requires a free Last.fm account and free Last.fm developer API tokens.
note: This MUST be configured through the graphical web interface. The web interface requests your Last.fm username and password, and the password is swapped out for a session key before saving to the config file. It is not possible to specify a password in the config file, so you cannot enable Last.fm scrobbling without the GUI. Once enabled, a valid Last.fm configuration can be transferred to other machines.
note: Like the alarm feature, scrobbling requires Connectr to always be running. This means it should be run from an always-on computer, such as a home media server or a VPS. You can configure it on a regular machine first, and then copy the ¨/.connectr.ini
file to your always-on server.
There are options to ignore tracks played on phones/tablets or computers, in case you want to have the official Spotify clients handle scrobbling from those devices. This is beneficial, especially for mobiles, because Spotify can scrobble tracks played while offline.
note: This section is auto-generated and auto-updated at runtime. You can leave it empty if you make your own config file.
version - Version of the Connectr authentication format
access - Spotify Web API access token
refresh - Spotify Web API refresh token
expire - Expiration time (UTC) for access token
[connectr]
port=5432
[application]
secret=xxxxxyyyyyaaaaabbbbbcccccddddd
client_id=xXxXxyYyYynNnNnNmMmMmMpPpPpP
[presets]
Discover Weekly=spotify:user:spotify:playlist:37i9dQZEVXcOmDhsenkuCu
Edge Detector=spotify:user:mrmekon:playlist:4SKkpDbZwNGklpIILmEZAg
Play Today=spotify:user:mrmekon:playlist:4c8eKK6kKrcdt1HToEX7Jc
[tokens]
version=1
access=this-is-autogenerated
refresh=this-is-also-autogenerated
expire=1492766270
[lastfm]
enabled=true
key=aaaaabbbbbbccccccddddddeeeeee
secret=ffffffgggggghhhhhhhiiiiiijjjjjj
session_key=kkkkkkllllllmmmmmmnnnnnooooooppppp
username=MyGloriousUsername
ignore_phone=true
ignore_pc=false
[alarms]
alarm1=08:00,weekdays,spotify:user:mrmekon:playlist:1BayoBGuBA5HhF0ZuYw2sN,1267eba791c19740744eb5c41a5165ce6691fb9b
Feature | OS X | Windows | Linux |
---|---|---|---|
API | |||
Fetch list of devices |
|
|
|
Fetch current playback information |
|
|
|
Transfer playback to device |
|
|
|
Start new playback on device |
|
|
|
Pause/Resume |
|
|
|
Skip next/previous |
|
|
|
Seek in track |
|
|
|
Change volume |
|
|
|
Change repeat state |
|
|
|
Change shuffle state |
|
|
|
Alarm clock |
|
|
|
Last.fm Scrobbling |
|
|
|
Fetch album art |
|
|
|
UI | |||
Display current track |
|
|
|
Current track in tooltip |
|
|
|
Playback controls |
|
|
|
Device selection |
|
|
|
Volume control |
|
|
|
Presets |
|
|
|
Save current track to playlist |
|
|
|
System | |||
Persistent configuration |
|
|
|
System logging |
|
|
|
objc
.