SlackFM
SlackFM is a lightweight library that updates your Slack status with the song you're currently playing on Spotify.
It features:
- Zero dependencies.
- Service creation and management using systemctl.
- Various commands to use SlackFM.
- Flags and configuration file to control the program's behavior.
- Automatic token refreshing for Spotify.
Credentials
Credentials are needed to connect to the Slack workspace and get permission from the Spotify user account. Here is a quick guide on how I got them:
Slack
- Go to
https://api.slack.com/apps - Click on
Create an App->From scratch - Fill the
App NameandPick a workspace to develop your app ininputs - OAuth & Permissions
- Scopes -> User Token Scopes
- users:read
- users:write
- users.profile:read
- users.profile:write
- OAuth Tokens -> Install to [
Your workspace name]
- Click on
Allow - You can get the token back at the
OAuth Tokenssection.
Spotify
- Go to
https://developer.spotify.com/dashboard-> Accept the terms Create app
- Fill
App nameandApp description - Write
http://127.0.0.1:8888/callbackinRedirect URIs - Tick the
Web APIbox
- Accept the terms and click on
Save - The next screen will contain both the Client ID and Client Secret.
How to use
Although slackfm has no dependencies, it requires your system to be Linux
or macOS to run the following commands:
initstatusstartstopreset
This is because they require systemctl to run slackfm as a process.
play
Initializes slackfm in the current shell session.
It accepts the following flags:
album: displays the song's album title (if it's not a single)progress: displays the current progress through the songcover: temporarily sets your profile picture to the song's cover
init
Creates the following files:
-
/usr/lib/systemd/system/slackfm.service: the Slackfm service itself.
It is used through./slackfm.py startand./slackfm.py stop. Also reloads the all unit files by runningsudo systemctl daemon-reload. -
~/.config/slackfm/slackfm.conf: contains the service's configuration.
It it changes, the service has to stop so the changes are applied. The allowed values are the same as theplayflags.
album=true
progress=false
cover=true
~/.config/slackfm/slackfm.env: contains the previously mentioned credentials.
SLACK_TOKEN=your-slack-token
SPOTIFY_CLIENT_ID=your-spotify-client-id
SPOTIFY_CLIENT_SECRET=your-spotify-client-secret
status
Runs systemctl is-active slackfm.service.
start
Runs sudo systemctl start slackfm.service, which is the same as
calling ./slackfm.py play but from a service. Arguments will be read from
~/.config/slackfm/slackfm.conf.
stop
Runs sudo systemctl stop slackfm.service.
reset
Runs sudo systemctl stop slackfm.service, then sudo systemctl start slackfm.service.
Metadata
Release files for slackfm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| slackfm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for slackfm-0.1.0-py3-none-any.whl |
Release files / slackfm-0.1.0-py3-none-any.whl
| Download URL | slackfm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40eba928142891e851df819997b1542d03d08250924c52ee41276d31930effef
|
|
BLAKE2b-256 checksum How to use checksums |
edd3e904951ba4f121a5cf38c82bff030f51b1c452de5b2e3bf9f4ff44d99eca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for slackfm 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.