Compare commits

...

3 commits

Author SHA1 Message Date
Simon Vieille 1b5b96a10f fix ci syntax
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-09-29 16:14:37 +02:00
Simon Vieille 64629c2d23
Trim metadata in spotify block
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-03-07 13:26:02 +01:00
Simon Vieille 64908e4eb4
fix block spotify (handle stopped status)
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
2022-09-14 09:24:21 +02:00
2 changed files with 18 additions and 6 deletions

View file

@ -1,4 +1,4 @@
pipeline: steps:
vendor: vendor:
image: golang:1.18 image: golang:1.18
commands: commands:

View file

@ -2,10 +2,16 @@ package main
import ( import (
"fmt" "fmt"
r "gitnet.fr/deblan/i3-blocks-go/rendering" sos"
"os" "os/"
"os/exec"
"strings" "strings"
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-gsrrindg
r "gitnet.fr/deblan/i3-blocks-go/rendering"
) )
func GetMetadata(metadata string) string { func GetMetadata(metadata string) string {
@ -20,11 +26,15 @@ func GetMetadata(metadata string) string {
} }
func GetTitle() string { func GetTitle() string {
return GetMetadata("xesam:title") data := GetMetadata("xesam:title")
return strings.Trim(string(data), "\n")
} }
func GetArtist() string { func GetArtist() string {
return GetMetadata("xesam:artist") data := GetMetadata("xesam:artist")
return strings.Trim(string(data), "\n")
} }
func GetStatus() string { func GetStatus() string {
@ -41,6 +51,8 @@ func main() {
if status == "Not available" { if status == "Not available" {
return return
} else if status == "Stopped" {
return
} else if status == "Paused" { } else if status == "Paused" {
stmt = r.TextWithPadding(r.FontAwesome("\uf04c"), r.FB{ stmt = r.TextWithPadding(r.FontAwesome("\uf04c"), r.FB{
Background: r.Color("black3"), Background: r.Color("black3"),