Compare commits

...

7 commits
v2.3.1 ... main

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
Simon Vieille 7057a29f6d
update ci
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-09-05 11:17:36 +02:00
Simon Vieille 7dded95ca0
update ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-09-05 11:16:47 +02:00
Simon Vieille b395a13e00
update ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-09-05 11:11:21 +02:00
Simon Vieille b8ad31e366
update ci
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-09-05 10:58:42 +02:00
3 changed files with 33 additions and 10 deletions

View file

@ -1,4 +1,4 @@
pipeline:
steps:
vendor:
image: golang:1.18
commands:
@ -8,6 +8,9 @@ pipeline:
image: golang:1.18
commands:
- make
- mkdir release
- tar -c -z -f release/build-amd64.tar.gz build/linux-amd64/
- tar -c -z -f release/build-arm64.tar.gz build/linux-arm64/
release:
image: plugins/gitea-release
@ -16,6 +19,6 @@ pipeline:
from_secret: gitnet_api_key
base_url: https://gitnet.fr
note:
files: build/*
files: release/*
when:
event: [tag]

View file

@ -1,8 +1,16 @@
all: linux-amd64 linux-arm64
.ONESHELL:
all:
linux-amd64:
for i in blocks/*; do
go build -ldflags '-s -w' -v -o "build/$$(basename "$$i")" "$$i/main.go"
GOARCH=amd64 GOOS=linux go build -ldflags '-s -w' -v -o "build/linux-amd64/$$(basename "$$i")" "$$i/main.go"
done
.ONESHELL:
linux-arm64:
for i in blocks/*; do
GOARCH=arm64 GOOS=linux go build -ldflags '-s -w' -v -o "build/linux-arm64/$$(basename "$$i")" "$$i/main.go"
done
clean:
rm build/* 2>/dev/null || true
rm -fr build/* 2>/dev/null || true

View file

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