From e9df618c595493f4a12f60c5c8f93e14712d909d Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 7 Aug 2024 23:21:28 +0200 Subject: [PATCH 1/6] apply linter --- blocks/ip_wan/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blocks/ip_wan/main.go b/blocks/ip_wan/main.go index 1ff9df0..082da8f 100644 --- a/blocks/ip_wan/main.go +++ b/blocks/ip_wan/main.go @@ -2,11 +2,12 @@ package main import ( "fmt" - "github.com/atotto/clipboard" - r "gitnet.fr/deblan/i3-blocks-go/rendering" "io" "net/http" "os" + + "github.com/atotto/clipboard" + r "gitnet.fr/deblan/i3-blocks-go/rendering" ) func main() { From ba7f37dbb64a93c3e28c8a9bb194ac39a4cea0fb Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 7 Aug 2024 23:21:42 +0200 Subject: [PATCH 2/6] fix spotify block --- blocks/spotify/main.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/blocks/spotify/main.go b/blocks/spotify/main.go index d2bae0e..166ede0 100644 --- a/blocks/spotify/main.go +++ b/blocks/spotify/main.go @@ -2,15 +2,10 @@ package main import ( "fmt" - sos" - "os/" + "os" + "os/exec" "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" ) From 23f5b32d2c9d097173d547df3d726f0eff2872a1 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 7 Aug 2024 23:25:19 +0200 Subject: [PATCH 3/6] upgrade to golang 1.22 --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index eb99650..5c6cf64 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,11 +1,11 @@ steps: vendor: - image: golang:1.18 + image: golang:1.22 commands: - go mod vendor build: - image: golang:1.18 + image: golang:1.22 commands: - make - mkdir release From 23cacd940f85589a370cc61a031feafce4cc1a43 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 7 Aug 2024 23:26:30 +0200 Subject: [PATCH 4/6] upgrade to golang 1.22 --- Makefile | 6 ++++++ go.mod | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 47d140a..864334d 100644 --- a/Makefile +++ b/Makefile @@ -14,3 +14,9 @@ linux-arm64: clean: rm -fr build/* 2>/dev/null || true + +tool-gofumpt: + which golangci-lint > /dev/null 2>&1 || go install mvdan.cc/gofumpt@latest + +fmt: tool-gofumpt + gofumpt -w --extra . diff --git a/go.mod b/go.mod index 413d5cb..36633d0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module gitnet.fr/deblan/i3-blocks-go -go 1.18 +go 1.22 require ( github.com/enescakir/emoji v1.0.0 From 1f1b6e377245b91063d3a24d8d38787b1d3717b5 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 7 Aug 2024 23:26:39 +0200 Subject: [PATCH 5/6] apply linter --- blocks/acpi/main.go | 2 +- blocks/app/main.go | 3 ++- blocks/date/main.go | 3 ++- blocks/du/main.go | 3 ++- blocks/ip/main.go | 6 +++--- blocks/ip_wan/main.go | 1 - blocks/prusa_telemetry/main.go | 6 +++--- blocks/ps/main.go | 3 ++- blocks/rss/main.go | 4 ++-- blocks/weather/main.go | 4 ++-- blocks/wireguard/main.go | 3 ++- blocks/workspace_apps/main.go | 7 ++++--- 12 files changed, 25 insertions(+), 20 deletions(-) diff --git a/blocks/acpi/main.go b/blocks/acpi/main.go index da5aedc..8ddc055 100644 --- a/blocks/acpi/main.go +++ b/blocks/acpi/main.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "github.com/enescakir/emoji" "github.com/xellio/tools/acpi" r "gitnet.fr/deblan/i3-blocks-go/rendering" @@ -13,7 +14,6 @@ import ( func main() { datas, err := acpi.Battery() - if err != nil { return } diff --git a/blocks/app/main.go b/blocks/app/main.go index 873c9d4..f372121 100644 --- a/blocks/app/main.go +++ b/blocks/app/main.go @@ -3,10 +3,11 @@ package main import ( "flag" "fmt" - r "gitnet.fr/deblan/i3-blocks-go/rendering" "os" "os/exec" "sync" + + r "gitnet.fr/deblan/i3-blocks-go/rendering" ) func runCmd(wg *sync.WaitGroup, value string) { diff --git a/blocks/date/main.go b/blocks/date/main.go index 257772b..6a8727a 100644 --- a/blocks/date/main.go +++ b/blocks/date/main.go @@ -3,10 +3,11 @@ package main import ( "flag" "fmt" + "time" + "github.com/enescakir/emoji" "github.com/itchyny/timefmt-go" r "gitnet.fr/deblan/i3-blocks-go/rendering" - "time" ) func main() { diff --git a/blocks/du/main.go b/blocks/du/main.go index 27723eb..72e260b 100644 --- a/blocks/du/main.go +++ b/blocks/du/main.go @@ -3,12 +3,13 @@ package main import ( "flag" "fmt" - r "gitnet.fr/deblan/i3-blocks-go/rendering" "os" "os/exec" "strconv" "strings" "sync" + + r "gitnet.fr/deblan/i3-blocks-go/rendering" ) func DiskUsage(path string) int { diff --git a/blocks/ip/main.go b/blocks/ip/main.go index 1d0d551..319c506 100644 --- a/blocks/ip/main.go +++ b/blocks/ip/main.go @@ -3,12 +3,13 @@ package main import ( "flag" "fmt" - "github.com/atotto/clipboard" - r "gitnet.fr/deblan/i3-blocks-go/rendering" "net" "os" "regexp" "strings" + + "github.com/atotto/clipboard" + r "gitnet.fr/deblan/i3-blocks-go/rendering" ) func main() { @@ -24,7 +25,6 @@ func main() { ) iface, err := net.InterfaceByName(*argIface) - if err != nil { return } diff --git a/blocks/ip_wan/main.go b/blocks/ip_wan/main.go index 082da8f..eee5cdf 100644 --- a/blocks/ip_wan/main.go +++ b/blocks/ip_wan/main.go @@ -12,7 +12,6 @@ import ( func main() { resp, err := http.Get("https://api.ipify.org/") - if err != nil { return } diff --git a/blocks/prusa_telemetry/main.go b/blocks/prusa_telemetry/main.go index 7898cef..0f3ea01 100644 --- a/blocks/prusa_telemetry/main.go +++ b/blocks/prusa_telemetry/main.go @@ -4,12 +4,13 @@ import ( "encoding/json" "flag" "fmt" - "github.com/itchyny/timefmt-go" - r "gitnet.fr/deblan/i3-blocks-go/rendering" "io" "net/http" "strconv" "time" + + "github.com/itchyny/timefmt-go" + r "gitnet.fr/deblan/i3-blocks-go/rendering" ) type Telemetry struct { @@ -24,7 +25,6 @@ func main() { flag.Parse() resp, err := http.Get(*argApi) - if err != nil { return } diff --git a/blocks/ps/main.go b/blocks/ps/main.go index 173484d..5c59181 100644 --- a/blocks/ps/main.go +++ b/blocks/ps/main.go @@ -3,9 +3,10 @@ package main import ( "flag" "fmt" - r "gitnet.fr/deblan/i3-blocks-go/rendering" "os/exec" "strings" + + r "gitnet.fr/deblan/i3-blocks-go/rendering" ) func ProcessExists(process string) bool { diff --git a/blocks/rss/main.go b/blocks/rss/main.go index 9cf38b9..c772e3f 100644 --- a/blocks/rss/main.go +++ b/blocks/rss/main.go @@ -3,13 +3,14 @@ package main import ( "flag" "fmt" - r "gitnet.fr/deblan/i3-blocks-go/rendering" "io" "net/http" "os" "os/exec" "strings" "sync" + + r "gitnet.fr/deblan/i3-blocks-go/rendering" ) type Telemetry struct { @@ -41,7 +42,6 @@ func main() { } resp, err := http.Get(*argFeed) - if err != nil { return } diff --git a/blocks/weather/main.go b/blocks/weather/main.go index 0784079..3df828d 100644 --- a/blocks/weather/main.go +++ b/blocks/weather/main.go @@ -3,13 +3,14 @@ package main import ( "flag" "fmt" - r "gitnet.fr/deblan/i3-blocks-go/rendering" "io" "net/http" "os" "os/exec" "strings" "sync" + + r "gitnet.fr/deblan/i3-blocks-go/rendering" ) func openBrowser(wg *sync.WaitGroup, url string) { @@ -34,7 +35,6 @@ func main() { } resp, err := http.Get(url) - if err != nil { return } diff --git a/blocks/wireguard/main.go b/blocks/wireguard/main.go index 6ad1056..caf837a 100644 --- a/blocks/wireguard/main.go +++ b/blocks/wireguard/main.go @@ -3,11 +3,12 @@ package main import ( "flag" "fmt" - r "gitnet.fr/deblan/i3-blocks-go/rendering" "net" "os" "os/exec" "strings" + + r "gitnet.fr/deblan/i3-blocks-go/rendering" ) func main() { diff --git a/blocks/workspace_apps/main.go b/blocks/workspace_apps/main.go index 9b348dc..56a8d79 100644 --- a/blocks/workspace_apps/main.go +++ b/blocks/workspace_apps/main.go @@ -2,13 +2,14 @@ package main import ( "encoding/json" - "fmt" - r "gitnet.fr/deblan/i3-blocks-go/rendering" - // "os" "flag" + "fmt" "os/exec" "strconv" "strings" + + r "gitnet.fr/deblan/i3-blocks-go/rendering" + // "os" ) type WindowProperty struct { From 7e03a1b3640d9830abc5134f1c081e7228eb85a6 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 21 Aug 2024 20:18:51 +0200 Subject: [PATCH 6/6] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 768896a..218dbe6 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ Note: use `pamixer --list-sinks` ``` [volume] -command=/path/to/volume -sinks="Default:alsa_output.pci-0000_00_1f.3.analog-stereo;Headset:bluez_output.00_1B_66_B6_87_05 +command=/path/to/volume -sinks="Default:alsa_output.pci-0000_00_1f.3.analog-stereo;Headset:bluez_output.00_1B_66_B6_87_05" format=json markup=pango interval=1