Compare commits

..

No commits in common. "main" and "v2.3.0" have entirely different histories.
main ... v2.3.0

5 changed files with 23 additions and 49 deletions

View file

@ -1,4 +1,4 @@
steps:
pipeline:
vendor:
image: golang:1.18
commands:
@ -8,9 +8,6 @@ steps:
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
@ -19,6 +16,6 @@ steps:
from_secret: gitnet_api_key
base_url: https://gitnet.fr
note:
files: release/*
files: build/*
when:
event: [tag]

View file

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

View file

@ -83,6 +83,18 @@ markup=pango
interval=30
```
### Weather
Show the weather of the given location ([https://fr.wttr.in/](https://fr.wttr.in/)).
```
[weather]
command=/path/to/weather -loc=Paris -lang=fr
format=json
markup=pango
interval=1800
```
### IP
Show the IP of the given iface.
@ -187,18 +199,6 @@ markup=pango
interval=1
```
### Weather
Show the weather of the given location ([https://fr.wttr.in/](https://fr.wttr.in/)).
```
[weather]
command=/path/to/weather -loc=Paris -lang=fr
format=json
markup=pango
interval=1800
```
### Wireguard toggler
Toggler for wireguard.
@ -217,7 +217,7 @@ markup=pango
interval=2
```
### Workspace Apps (task bar)
### Task bar
Add blocks that represent opened apps and create a task bar.

View file

@ -2,16 +2,10 @@ package main
import (
"fmt"
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"
"os"
"os/exec"
"strings"
)
func GetMetadata(metadata string) string {
@ -26,15 +20,11 @@ func GetMetadata(metadata string) string {
}
func GetTitle() string {
data := GetMetadata("xesam:title")
return strings.Trim(string(data), "\n")
return GetMetadata("xesam:title")
}
func GetArtist() string {
data := GetMetadata("xesam:artist")
return strings.Trim(string(data), "\n")
return GetMetadata("xesam:artist")
}
func GetStatus() string {
@ -51,8 +41,6 @@ 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"),

View file

@ -1,9 +1,7 @@
package rendering
import (
// "bytes"
"encoding/json"
// "strconv"
"strings"
)
@ -33,7 +31,6 @@ func Block(name string, options BlockOptions) string {
block = strings.ReplaceAll(block, `\u003c`, "<")
block = strings.ReplaceAll(block, `\u003e`, ">")
block = strings.ReplaceAll(block, `\u0026`, "et")
return block
}