Compare commits
34 Commits
6ed1eb428f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
485ec0ec0a
|
|||
|
39f84a94ac
|
|||
|
4b71fa248a
|
|||
|
c26c13e984
|
|||
|
174d243f15
|
|||
|
6cab493189
|
|||
|
69be0dcf8a
|
|||
|
22ad0e29cb
|
|||
|
8340ef1f20
|
|||
|
fe851278f4
|
|||
|
49b3212c48
|
|||
|
ea4f47a1b1
|
|||
|
51c7a983a0
|
|||
|
3aec82c40c
|
|||
|
a2164b0173
|
|||
|
c235dd60dd
|
|||
|
16465c44a2
|
|||
|
7a55b6d605
|
|||
|
40f813ddc3
|
|||
|
7a3b3d5216
|
|||
|
750317a0d7
|
|||
|
648f56f1d0
|
|||
|
2c3c989480
|
|||
|
bda0879199
|
|||
|
937769e2f7
|
|||
|
233b5dd1ca
|
|||
|
bcd2a83dd9
|
|||
|
af0af02059
|
|||
|
9b02fc2851
|
|||
|
a84ae6bd5b
|
|||
|
78ce37db9f
|
|||
|
b97a950582
|
|||
|
018e3ce34e
|
|||
|
8343e713fe
|
36
.drone.yml
Normal file
36
.drone.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: waybar-mpris
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: golang:latest
|
||||||
|
volumes:
|
||||||
|
- name: ssh_key
|
||||||
|
path: /id_rsa
|
||||||
|
commands:
|
||||||
|
- apt update -y
|
||||||
|
- apt install -y python3-pip curl
|
||||||
|
- go mod download
|
||||||
|
- curl -sL https://git.io/goreleaser > goreleaser.sh
|
||||||
|
- chmod +x goreleaser.sh
|
||||||
|
- ./version.sh ./goreleaser.sh --snapshot --skip-publish --rm-dist
|
||||||
|
- wget https://builds.hrfee.pw/upload.py
|
||||||
|
- pip3 install requests
|
||||||
|
- bash -c 'python3 upload.py https://builds2.hrfee.pw hrfee waybar-mpris --upload ./dist/*.tar.gz ./dist/*.rpm'
|
||||||
|
- bash -c 'sftp -P 2022 -i /id_rsa -o StrictHostKeyChecking=no root@161.97.102.153:/repo/incoming <<< $"put dist/*.deb"'
|
||||||
|
- bash -c 'ssh -i /id_rsa root@161.97.102.153 -p 2022 "repo-process-deb trusty-unstable"'
|
||||||
|
environment:
|
||||||
|
BUILDRONE_KEY:
|
||||||
|
from_secret: BUILDRONE_KEY
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: ssh_key
|
||||||
|
host:
|
||||||
|
path: /root/.ssh/id_rsa_packaging
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
|||||||
./main
|
./main
|
||||||
|
waybar-mpris
|
||||||
|
dist/*
|
||||||
|
|||||||
55
.goreleaser.yml
Normal file
55
.goreleaser.yml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
project_name: waybar-mpris
|
||||||
|
release:
|
||||||
|
gitea:
|
||||||
|
owner: hrfee
|
||||||
|
name: waybar-mpris
|
||||||
|
name_template: "v{{.Version}}"
|
||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod download
|
||||||
|
builds:
|
||||||
|
- id: main
|
||||||
|
dir: ./
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
archives:
|
||||||
|
- id: main
|
||||||
|
builds:
|
||||||
|
- main
|
||||||
|
replacements:
|
||||||
|
linux: Linux
|
||||||
|
amd64: x86_64
|
||||||
|
checksum:
|
||||||
|
name_template: 'checksums.txt'
|
||||||
|
snapshot:
|
||||||
|
name_template: "0.0.0-{{.Env.NFPM_EPOCH}}"
|
||||||
|
changelog:
|
||||||
|
sort: asc
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- '^docs:'
|
||||||
|
- '^test:'
|
||||||
|
nfpms:
|
||||||
|
- id: main
|
||||||
|
file_name_template: '{{ .ProjectName }}-git-{{ .ShortCommit }}_{{ .Arch }}'
|
||||||
|
package_name: waybar-mpris
|
||||||
|
homepage: https://git.hrfee.pw/hrfee/waybar-mpris
|
||||||
|
description: MPRIS2 waybar component
|
||||||
|
maintainer: Harvey Tindall <hrfee@hrfee.dev>
|
||||||
|
license: MIT
|
||||||
|
vendor: hrfee.dev
|
||||||
|
version_metadata: git
|
||||||
|
builds:
|
||||||
|
- main
|
||||||
|
contents:
|
||||||
|
- src: ./LICENSE
|
||||||
|
dst: /usr/share/licenses/waybar-mpris
|
||||||
|
formats:
|
||||||
|
- deb
|
||||||
|
- rpm
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2021 Harvey Tindall
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
29
README.md
29
README.md
@@ -3,11 +3,15 @@
|
|||||||
<img src="images/cropped.gif" style="width: 100%;" alt="bar gif"></img>
|
<img src="images/cropped.gif" style="width: 100%;" alt="bar gif"></img>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
##### Downloads:
|
||||||
|
##### [binary](https://builds2.hrfee.pw/view/hrfee/waybar-mpris) | [aur](https://aur.archlinux.org/packages/waybar-mpris-git/)
|
||||||
|
|
||||||
a waybar component/utility for displaying and controlling MPRIS2 compliant media players individually, inspired by [waybar-media](https://github.com/yurihs/waybar-media).
|
a waybar component/utility for displaying and controlling MPRIS2 compliant media players individually, inspired by [waybar-media](https://github.com/yurihs/waybar-media).
|
||||||
|
|
||||||
MPRIS2 is widely supported, so this component should work with:
|
MPRIS2 is widely supported, so this component should work with:
|
||||||
* Chrome/Chromium
|
* Chrome/Chromium
|
||||||
* Other browsers (with kde plasma integration installed)
|
* Firefox (Limited support with `media.hardwaremediakeys.enabled = true` in about:config)
|
||||||
|
* Other browsers (using KDE Plasma Integration)
|
||||||
* VLC
|
* VLC
|
||||||
* Spotify
|
* Spotify
|
||||||
* Noson
|
* Noson
|
||||||
@@ -15,10 +19,23 @@ MPRIS2 is widely supported, so this component should work with:
|
|||||||
* Most other music/media players
|
* Most other music/media players
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
`go get git.hrfee.pw/hrfee/waybar-mpris` will install the program, as well as the go dbus bindings and pflags for command-line arguments.
|
Available on the AUR as [waybar-mpris-git](https://aur.archlinux.org/packages/waybar-mpris-git/) (Thanks @nichobi!)
|
||||||
|
|
||||||
or just grab the `waybar-mpris` binary from here and place it in your PATH.
|
Available on my Debian repo as well:
|
||||||
|
```sh
|
||||||
|
sudo apt-get update && sudo apt-get install curl apt-transport-https gnupg
|
||||||
|
curl https://apt.hrfee.dev/hrfee.pubkey.gpg | sudo apt-key add -
|
||||||
|
echo "deb https://apt.hrfee.dev trusty-unstable main" | sudo tee /etc/apt/sources.list.d/hrfee.list
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install waybar-mpris
|
||||||
|
```
|
||||||
|
|
||||||
|
`go get git.hrfee.pw/hrfee/waybar-mpris` will compile from source and install.
|
||||||
|
|
||||||
|
You can also download a precompiled binary from [here](https://builds2.hrfee.pw/view/hrfee/waybar-mpris).
|
||||||
|
|
||||||
|
## Issues
|
||||||
|
Stick them on [mpris2client](https://github.com/hrfee/mpris2client) or the [og](https://github.com/hrfee/waybar-mpris) repository (both on github) if you can't make an account here.
|
||||||
## Usage
|
## Usage
|
||||||
When running, the program will pipe out json in waybar's format. Add something like this to your waybar `config.json`:
|
When running, the program will pipe out json in waybar's format. Add something like this to your waybar `config.json`:
|
||||||
```
|
```
|
||||||
@@ -42,10 +59,12 @@ When running, the program will pipe out json in waybar's format. Add something l
|
|||||||
```
|
```
|
||||||
Usage of waybar-mpris:
|
Usage of waybar-mpris:
|
||||||
--autofocus Auto switch to currently playing music players.
|
--autofocus Auto switch to currently playing music players.
|
||||||
|
--interpolate Interpolate track position (helpful for players that don't update regularly, e.g mpDris2)
|
||||||
--order string Element order. (default "SYMBOL:ARTIST:ALBUM:TITLE:POSITION")
|
--order string Element order. (default "SYMBOL:ARTIST:ALBUM:TITLE:POSITION")
|
||||||
--pause string Pause symbol/text to use. (default "\uf8e3")
|
--pause string Pause symbol/text to use. (default "\uf8e3")
|
||||||
--play string Play symbol/text to use. (default "▶")
|
--play string Play symbol/text to use. (default "▶")
|
||||||
--position Show current position between brackets, e.g (04:50/05:00)
|
--position Show current position between brackets, e.g (04:50/05:00)
|
||||||
|
--replace Replace any running instances
|
||||||
--send string send command to already runnning waybar-mpris instance. (options: player-next/player-prev/next/prev/toggle)
|
--send string send command to already runnning waybar-mpris instance. (options: player-next/player-prev/next/prev/toggle)
|
||||||
--separator string Separator string to use between artist, album, and title. (default " - ")
|
--separator string Separator string to use between artist, album, and title. (default " - ")
|
||||||
```
|
```
|
||||||
@@ -55,10 +74,12 @@ Usage of waybar-mpris:
|
|||||||
* `--separator` specifies a string to separate the artist, album and title text.
|
* `--separator` specifies a string to separate the artist, album and title text.
|
||||||
* `--autofocus` makes waybar-mpris automatically focus on currently playing music players.
|
* `--autofocus` makes waybar-mpris automatically focus on currently playing music players.
|
||||||
* `--position` enables the display of the track position.
|
* `--position` enables the display of the track position.
|
||||||
|
* `--interpolate` increments the track position every second. This is useful for players (e.g mpDris2) that don't regularly update the position.
|
||||||
|
* `--replace`: By default, new instances will attach to the existing one so that the output is identical. This lets this instance replace any others running. It isn't recommended.
|
||||||
* `--send` sends commands to an already running waybar-mpris instance via a unix socket. Commands:
|
* `--send` sends commands to an already running waybar-mpris instance via a unix socket. Commands:
|
||||||
* `player-next`: Switch to displaying and controlling next available player.
|
* `player-next`: Switch to displaying and controlling next available player.
|
||||||
* `player-prev`: Same as `player-next`, but for the previous player.
|
* `player-prev`: Same as `player-next`, but for the previous player.
|
||||||
* `next/prev`: Next/previous track on the selected player.
|
* `next/prev`: Next/previous track on the selected player.
|
||||||
* `toggle`: Play/pause.
|
* `toggle`: Play/pause.
|
||||||
* *Note: you can also bind these commands to keys in your sway/other wm config.*
|
* You can also bind these commands to Media keys in your WM config.
|
||||||
|
|
||||||
|
|||||||
3
go.mod
3
go.mod
@@ -3,6 +3,9 @@ module git.hrfee.pw/hrfee/waybar-mpris
|
|||||||
go 1.15
|
go 1.15
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/fsnotify/fsnotify v1.4.9
|
||||||
github.com/godbus/dbus/v5 v5.0.3
|
github.com/godbus/dbus/v5 v5.0.3
|
||||||
|
github.com/hrfee/mpris2client v0.0.5
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
|
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
7
go.sum
7
go.sum
@@ -1,4 +1,11 @@
|
|||||||
|
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||||
|
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||||
github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME=
|
github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME=
|
||||||
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
|
github.com/hrfee/mpris2client v0.0.5 h1:h3gcb8Q68i6SfcEgOxL9cXcGee9ekvxXltrUxGwRLDU=
|
||||||
|
github.com/hrfee/mpris2client v0.0.5/go.mod h1:tVpzzAlsljmQevNA4mJwUy1onUUiaQcRAa4gdl37okY=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY=
|
||||||
|
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
|||||||
BIN
images/bar.gif
BIN
images/bar.gif
Binary file not shown.
|
Before Width: | Height: | Size: 170 KiB |
BIN
images/bar.mkv
BIN
images/bar.mkv
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 178 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 947 B |
Binary file not shown.
|
Before Width: | Height: | Size: 991 B |
2
version.sh
Executable file
2
version.sh
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
NFPM_EPOCH=$(git rev-list --all --count) $@
|
||||||
BIN
waybar-mpris
BIN
waybar-mpris
Binary file not shown.
Reference in New Issue
Block a user