Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
xtask = "run --frozen --package xtask --"
192 changes: 192 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ authors = [ "jasger9000 | jasger_" ]
license = "MIT"
repository = "https://github.com/jasger9000/mpdris"

[workspace]
members = [ "xtask" ]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ __Table of Contents:__
To install this application, you can either...
- [Use the AUR package (Arch Linux only)](#use-the-aur-package)
- [Build the application yourself](#build-the-application-yourself)
- [Install the application from a release binary](#install-using-release-binary)
- [Install the application from a release binary](#install-using-release-binarytarball)

### Use the AUR package
> [!IMPORTANT]
Expand Down Expand Up @@ -80,23 +80,24 @@ You can either build the AUR-package yourself, as detailed below, or use your fa
```bash
cargo build --release
```
3. Copy the resulting file from `target/release/mpdris` to `/usr/local/bin`
4. Copy `resources/mpdris.service` to `/usr/local/lib/systemd/user` (You might have to create that directory first)
3. Move the resulting file from `target/release/mpdris` to `/usr/local/bin`
4. Copy `resources/mpdris.service.local` to `/usr/local/lib/systemd/user` (You might have to create that directory first) and rename it to `mpdris.service`
5. Enable the service to start it with MPD
```bash
systemctl --user enable mpdris.service
```

### Install using release binary
2. Download the correct binary for your architecture
### Install using release binary/tarball
1. Go to the [release tab](https://github.com/jasger9000/mpdris/releases)
2. Download the correct tarball or binary for your architecture
- If you don't know what your architecture is, you can find out by running `lscpu`
3. Copy the file to `/usr/local/bin` and rename it to `mpdris`
3. Move the binary to `/usr/local/bin` and rename it to `mpdris` if needed
4. Add the execute permission to the file with
```bash
chmod +x /usr/local/bin/mpdris
```
5. Download and move [mpdris.service](https://github.com/jasger9000/mpdris/blob/main/resources/mpdris.service) to `/usr/local/lib/systemd/user` (You might have to create that directory first)
5. Move `mpdris.service.local` to `/usr/local/lib/systemd/user` (You might have to create that directory first) and rename it to `mpdris.service`
- mpdris.service.local can be found in the release tarball or downloaded [here](https://github.com/jasger9000/mpdris/blob/main/resources/mpdris.service.local)
6. Enable the service to start it with MPD
```bash
systemctl --user enable mpdris.service
Expand Down Expand Up @@ -156,6 +157,13 @@ Contributions are always welcome!
If you feel there's something missing/wrong/something that could be improved please open an [issue](https://github.com/jasger9000/mpdris/issues).<br />
Or if you want to add something yourself, just [open a pull request](https://github.com/jasger9000/mpdris/pulls) and I will have a look at it as soon as I can.

## Packaging
If you want to create a package of this application yourself, you can use the xtask cargo subcommand.<br />
Simply use `cargo xtask build [<path>] [--arch <arch>]` to build the project.<br />
To create an install from that build, use `cargo xtask install <path> [--arch <arch>]`. Note that you have to run the build command first though.<br />
You can also just create the manpage structure using `cargo xtask man <dir>`.<br />
To create release assets (tarballs, binaries, SHA256sums) for x86_64, i686 and aarch64 with `cargo xtask make-release-assets`.


## Licence
The Project is Licensed under the [MIT Licence](https://github.com/jasger9000/mpdris/?tab=MIT-1-ov-file)
Expand Down
2 changes: 1 addition & 1 deletion resources/mpdris.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ After=mpd.service
Type=notify-reload
NotifyAccess=main
Restart=on-failure
ExecStart=/usr/local/bin/mpdris --service
ExecStart=/usr/bin/mpdris --service

[Install]
WantedBy=mpd.service
13 changes: 13 additions & 0 deletions resources/mpdris.service.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Music Player Daemon MPRIS bridge
BindsTo=mpd.service
After=mpd.service

[Service]
Type=notify-reload
NotifyAccess=main
Restart=on-failure
ExecStart=/usr/local/bin/mpdris --service

[Install]
WantedBy=mpd.service
Loading