From 51c7a983a0cce4ee55a44fd607d71d60313a90ca Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sun, 16 May 2021 23:28:23 +0100 Subject: add PLAYER to --order, remove binary from repo also added more prominent download links to the readme. --- .gitignore | 1 + README.md | 3 +++ main.go | 6 +++++- waybar-mpris | Bin 4203341 -> 0 bytes 4 files changed, 9 insertions(+), 1 deletion(-) delete mode 100755 waybar-mpris diff --git a/.gitignore b/.gitignore index 7b81853..5fb6eeb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ ./main +./waybar-mpris diff --git a/README.md b/README.md index 82b2753..789bb59 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ bar gif

+##### 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). MPRIS2 is widely supported, so this component should work with: diff --git a/main.go b/main.go index eacd904..6ca022d 100644 --- a/main.go +++ b/main.go @@ -79,6 +79,10 @@ func playerJSON(p *mpris2.Player) string { if pos != "" && SHOW_POS { items = append(items, pos) } + case "PLAYER": + if p.Name != "" { + items = append(items, p.Name) + } } } if len(items) == 0 { @@ -318,7 +322,7 @@ func main() { flag.StringVar(&PLAY, "play", PLAY, "Play symbol/text to use.") flag.StringVar(&PAUSE, "pause", PAUSE, "Pause symbol/text to use.") flag.StringVar(&SEP, "separator", SEP, "Separator string to use between artist, album, and title.") - flag.StringVar(&ORDER, "order", ORDER, "Element order.") + flag.StringVar(&ORDER, "order", ORDER, "Element order. An extra \"PLAYER\" element is also available.") flag.BoolVar(&AUTOFOCUS, "autofocus", AUTOFOCUS, "Auto switch to currently playing music players.") flag.BoolVar(&SHOW_POS, "position", SHOW_POS, "Show current position between brackets, e.g (04:50/05:00)") flag.BoolVar(&INTERPOLATE, "interpolate", INTERPOLATE, "Interpolate track position (helpful for players that don't update regularly, e.g mpDris2)") diff --git a/waybar-mpris b/waybar-mpris deleted file mode 100755 index c69d6e4..0000000 Binary files a/waybar-mpris and /dev/null differ -- cgit v1.2.3