Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/funkatron/now-playing
https://github.com/funkatron/now-playing
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/funkatron/now-playing
- Owner: funkatron
- License: bsd-3-clause
- Created: 2024-02-20T01:49:23.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-22T01:01:24.000Z (8 months ago)
- Last Synced: 2024-03-22T02:23:27.762Z (8 months ago)
- Language: Shell
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Dead Agent "Now Playing" Scripts
This repository contains scripts to retrieve and display the currently playing song from various music players on MacOS.
Right now only Apple Music is supported, but I plan to add support for audio sources in the future.
# Requirements
- MacOS 10.13 or above (not tested on earlier versions)
- Python 3.9 or above
- git# Installation
1. Clone the repository using git:
```bash
git clone
```2. Create a virtual environment in the repository root using the following command:
```bash
python3 -m venv venv
```3. Activate the virtual environment using the following command:
```bash
source venv/bin/activate
```4. Install the required packages using pip:
```bash
pip install -r requirements.txt
```## Usage
1. Open a terminal and navigate to the directory where the `start-updater.sh` script is located.
2. Run the script using the following command:
```shell
./start-updater.sh
```The updater will start running in the background and will execute the `update.sh` script every 5 seconds.
When the `update.sh` script is executed, it will retrieve the currently playing song from Apple Music and write it to the `_data/current_song.txt`. The text is formatted as follows, with `\n` used for newlines:
```
""
```Any logging will be written to the `_logs/update_.log` file.
3. Point the program you want to *display* the currently playing song to the `_data/current_song.txt` file. The information in this file will be updated every time the `update.sh` script is executed.
4. To stop the updater, you can use the following command:
```shell
./stop-updater.sh
```This will send a termination signal to the updater process using the PID stored in the `updater.pid` file.
## Note
- The `updater.pid` file is used to store the PID of the updater process. Do not delete or modify this file while the updater is running.
- If you want to change the interval at which the `update.sh` script is executed, you can modify the `sleep` duration in the `start-updater.sh` function.