Skip to content

Commit

Permalink
docs: integrate remaining docs pages into new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
eladyn committed Feb 24, 2025
1 parent 96400e0 commit bb78af0
Show file tree
Hide file tree
Showing 20 changed files with 74 additions and 614 deletions.
6 changes: 4 additions & 2 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
[Introduction](./Introduction.md)

- [Installation](./installation/README.md)
- [Running as a service](./installation/service.md)
- [Installing on RaspberryPi OS 64-bit](./installation/raspberrypi64.md)
- [Building from source](./installation/source.md)
- [Cross-Compile using Docker](./installation/cross-compile-using-docker.md)
- [Configuration](./configuration/README.md)
- [Authentication](./configuration/auth.md)
- [Audio](./configuration/audio.md)
Expand All @@ -14,5 +16,5 @@
- [Running as launchd service](./advanced/launchd.md)
- [Using D-Bus to control `spotifyd`](./advanced/dbus.md)
- [MPRIS on headless systems](./advanced/mpris.md)
- [Extending spotifyd with hooks]()
- [Troubleshooting]()
- [Extending spotifyd with hooks](./advanced/hooks.md)
- [Troubleshooting](./troubleshooting.md)
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# User supplied Scripts

If you want to create custom behaviour around `spotifyd`, one option is to look into the [D-Bus functionality](./dbus.md). But on headless systems or smaller projects, we also offer a hook API. On certain events, a hook can be executed with event details given as environment variables.

To point `spotifyd` to such a script, use the `--onevent /path/to/script` cli arg / `on_song_change_hook = "/path/to/script"` configuration value.

In order to learn about the available events and the available details, you can either create simple scripts which log the given environment variables or look at the output of `spotifyd`, which logs whenever the script is executed.

The following scripts are intended to serve as inspiration for your own scripts. If you have written own scripts which you think might be useful to others, please create a PR adding them here!

## Dunst Notifications (Using Spotify API)

This script will show a dunst notification when you play/change/stop Spotify (and when the music change). It is using spotify APIs to get music details.
Expand Down Expand Up @@ -48,19 +56,5 @@ This script will show a dunst notification when you play/change/stop Spotify (an
fi
```

* Make this script executable (```chmod +x ntification_script.sh```)
* Add the line ```onevent = "bash /home/YOU_USER/bin/spotifyNotifications.sh"``` to your ```spotifyd.conf```

## Dunst Notifications (Using Playerctl metadata)

This script is a modification of the script supplied above, however instead of calling the Spotify API for track information, the metadata of the current track is used instead, leading to a more performant script.

### Dependencies

* [Playerctl](https://github.com/altdesktop/playerctl)

### How to Use:

* Download this [gist](https://gist.github.com/ohhskar/efe71e82337ed54b9aa704d3df28d2ae)
* Make the script executable (```chmod +x notifications.sh```)
* Add the line ```onevent = "/path/to/file/spotifyNotifications.sh"``` to your ```spotifyd.conf```
* Make this script executable (`chmod +x notification_script.sh`)
* Add the line `onevent = "bash /home/YOU_USER/bin/spotifyNotifications.sh"` to your `spotifyd.conf`
7 changes: 0 additions & 7 deletions docs/src/config/Cli.md

This file was deleted.

183 changes: 0 additions & 183 deletions docs/src/config/File.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/config/README.md

This file was deleted.

47 changes: 0 additions & 47 deletions docs/src/config/services/MacOS.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/config/services/README.md

This file was deleted.

41 changes: 0 additions & 41 deletions docs/src/config/services/Systemd.md

This file was deleted.

36 changes: 0 additions & 36 deletions docs/src/installation/Cross-Compiling-on-Ubuntu.md

This file was deleted.

Loading

0 comments on commit bb78af0

Please sign in to comment.