From 1cde07a07b7e526d237a87a5d9ac26be844b61db Mon Sep 17 00:00:00 2001 From: "T. von Dein" Date: Mon, 10 Nov 2025 20:59:46 +0100 Subject: [PATCH] migrate to codeberg (#1) --- .github/workflows/ci.yaml | 47 --------------------------- .woodpecker/build.yaml | 29 +++++++++++++++++ README.md | 22 ++++++------- _examples/current_workspace/main.go | 2 +- _examples/events/main.go | 2 +- _examples/find_focused_window/main.go | 2 +- _examples/get_bars/main.go | 2 +- _examples/get_config/main.go | 2 +- _examples/get_inputs/main.go | 2 +- _examples/get_marks/main.go | 2 +- _examples/get_outputs/main.go | 2 +- _examples/get_seats/main.go | 2 +- _examples/get_tree/main.go | 2 +- _examples/get_version/main.go | 2 +- _examples/get_workspaces/main.go | 2 +- _examples/run_command/main.go | 2 +- _examples/run_global_command/main.go | 2 +- _examples/send_tick/main.go | 2 +- bar.go => v1/bar.go | 0 command.go => v1/command.go | 0 doc.go => v1/doc.go | 0 event.go => v1/event.go | 0 go.mod => v1/go.mod | 2 +- go.sum => v1/go.sum | 0 input.go => v1/input.go | 0 io.go => v1/io.go | 0 net.go => v1/net.go | 4 +-- node.go => v1/node.go | 0 output.go => v1/output.go | 0 seat.go => v1/seat.go | 0 simpletons.go => v1/simpletons.go | 0 swayipc.go => v1/swayipc.go | 2 +- version.go => v1/version.go | 0 33 files changed, 59 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/ci.yaml create mode 100644 .woodpecker/build.yaml rename bar.go => v1/bar.go (100%) rename command.go => v1/command.go (100%) rename doc.go => v1/doc.go (100%) rename event.go => v1/event.go (100%) rename go.mod => v1/go.mod (64%) rename go.sum => v1/go.sum (100%) rename input.go => v1/input.go (100%) rename io.go => v1/io.go (100%) rename net.go => v1/net.go (97%) rename node.go => v1/node.go (100%) rename output.go => v1/output.go (100%) rename seat.go => v1/seat.go (100%) rename simpletons.go => v1/simpletons.go (100%) rename swayipc.go => v1/swayipc.go (98%) rename version.go => v1/version.go (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index e72ed13..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: build-and-test -on: [push, pull_request] -jobs: - build: - strategy: - matrix: - version: ['1.22'] - os: [ubuntu-latest, windows-latest, macos-latest] - name: Build - runs-on: ${{ matrix.os }} - steps: - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '${{ matrix.version }}' - id: go - - - name: checkout - uses: actions/checkout@v3 - - - name: build - run: go build - - # - name: test - # run: make test - - # - name: Update coverage report - # uses: ncruces/go-coverage-report@main - # with: - # report: true - # chart: true - # amend: true - # if: | - # matrix.os == 'ubuntu-latest' && - # github.event_name == 'push' - # continue-on-error: true - - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v3 - with: - go-version: 1.22 - - uses: actions/checkout@v3 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..2753a83 --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,29 @@ +matrix: + platform: + - linux/amd64 + goversion: + - 1.24 + +labels: + platform: ${platform} + +steps: + build: + when: + event: [push] + image: golang:${goversion} + commands: + - cd v1 + - go get + - go build + + linter: + when: + event: [push] + image: golang:${goversion} + commands: + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0 + - cd v1 + - golangci-lint --version + - golangci-lint run ./... + depends_on: [build] diff --git a/README.md b/README.md index 5e6b6d1..2ee94b0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -[![Go Report Card](https://goreportcard.com/badge/github.com/tlinden/swayipc)](https://goreportcard.com/report/github.com/tlinden/swayipc) -[![Actions](https://github.com/tlinden/swayipc/actions/workflows/ci.yaml/badge.svg)](https://github.com/tlinden/swayipc/actions) -![GitHub License](https://img.shields.io/github/license/tlinden/swayipc) -[![GoDoc](https://godoc.org/github.com/tlinden/swayipc?status.svg)](https://godoc.org/github.com/tlinden/swayipc) +[![status-badge](https://ci.codeberg.org/api/badges/15565/status.svg)](https://ci.codeberg.org/repos/15565) +[![Go Report Card](https://goreportcard.com/badge/codeberg.org/scip/swayipc/v1)](https://goreportcard.com/report/codeberg.org/scip/swayipc/v1) +[![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://codeberg.org/scip/swayipc/raw/branch/main/LICENSE) +[![GoDoc](https://godoc.org/codeberg.org/scip/swayipc?status.svg)](https://godoc.org/codeberg.org/scip/swayipc/v1) # swayipc - go bindings to control sway and swayfx @@ -26,7 +26,7 @@ haven't tested it on i3wm. The module uses the i3-IPC proctocol as outlined in sway-ipc(7). For details on how to use the library, see the -[reference documentation](https://godoc.org/github.com/tlinden/swayipc). +[reference documentation](https://godoc.org/codeberg.org/scip/swayipc/v1). ## Example usage @@ -39,7 +39,7 @@ import ( "fmt" "log" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { @@ -69,17 +69,17 @@ func main() { Also take a look into the **_examples** folder for more examples. For a more comprehensive and practical example look at the -[descratch](https://github.com/TLINDEN/sway-descratch) program which +[descratch](https://codeberg.org/scip/sway-descratch) program which you can use to selectively retrieve a window from the scratchpad. -You may also take a look at the [tool swaycycle](https://github.com/tlinden/swaycycle) +You may also take a look at the [tool swaycycle](https://codeberg.org/scip/swaycycle) which is using this module. ## Installation Execute this to add the module to your project: ```sh -go get github.com/tlinden/swayipc +go get codeberg.org/scip/swayipc/v1 ``` ## Acknowledgements @@ -95,7 +95,7 @@ best way for me to forget to do something. In order to report a bug, unexpected behavior, feature requests or to submit a patch, please open an issue on github: -https://github.com/TLINDEN/swayipc/issues. +https://codeberg.org/scip/swayipc/issues. ## Copyright and license @@ -107,7 +107,7 @@ T.v.Dein ## Project homepage -https://github.com/TLINDEN/swayipc +https://codeberg.org/scip/swayipc ## Copyright and License diff --git a/_examples/current_workspace/main.go b/_examples/current_workspace/main.go index 4a70b57..940648a 100644 --- a/_examples/current_workspace/main.go +++ b/_examples/current_workspace/main.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/events/main.go b/_examples/events/main.go index 9fc75a3..12d9f6d 100644 --- a/_examples/events/main.go +++ b/_examples/events/main.go @@ -10,7 +10,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) // Event callback function, needs to implement each subscribed events, diff --git a/_examples/find_focused_window/main.go b/_examples/find_focused_window/main.go index 1c48943..0c14077 100644 --- a/_examples/find_focused_window/main.go +++ b/_examples/find_focused_window/main.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/get_bars/main.go b/_examples/get_bars/main.go index 1e786bc..500b651 100644 --- a/_examples/get_bars/main.go +++ b/_examples/get_bars/main.go @@ -9,7 +9,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/get_config/main.go b/_examples/get_config/main.go index 874c824..06e2a51 100644 --- a/_examples/get_config/main.go +++ b/_examples/get_config/main.go @@ -8,7 +8,7 @@ import ( "fmt" "log" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/get_inputs/main.go b/_examples/get_inputs/main.go index bb47fd5..c07335e 100644 --- a/_examples/get_inputs/main.go +++ b/_examples/get_inputs/main.go @@ -8,7 +8,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/get_marks/main.go b/_examples/get_marks/main.go index a20e832..f31abb3 100644 --- a/_examples/get_marks/main.go +++ b/_examples/get_marks/main.go @@ -8,7 +8,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/get_outputs/main.go b/_examples/get_outputs/main.go index f93f0ec..1dec1dc 100644 --- a/_examples/get_outputs/main.go +++ b/_examples/get_outputs/main.go @@ -8,7 +8,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/get_seats/main.go b/_examples/get_seats/main.go index faf51ea..5454c86 100644 --- a/_examples/get_seats/main.go +++ b/_examples/get_seats/main.go @@ -8,7 +8,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/get_tree/main.go b/_examples/get_tree/main.go index 420ccb3..425d808 100644 --- a/_examples/get_tree/main.go +++ b/_examples/get_tree/main.go @@ -4,7 +4,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/get_version/main.go b/_examples/get_version/main.go index 2815fb8..df344b8 100644 --- a/_examples/get_version/main.go +++ b/_examples/get_version/main.go @@ -8,7 +8,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/get_workspaces/main.go b/_examples/get_workspaces/main.go index 6d15a64..4fa102f 100644 --- a/_examples/get_workspaces/main.go +++ b/_examples/get_workspaces/main.go @@ -8,7 +8,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/run_command/main.go b/_examples/run_command/main.go index 3e91755..a0f2324 100644 --- a/_examples/run_command/main.go +++ b/_examples/run_command/main.go @@ -10,7 +10,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/run_global_command/main.go b/_examples/run_global_command/main.go index cc95529..55e1c62 100644 --- a/_examples/run_global_command/main.go +++ b/_examples/run_global_command/main.go @@ -9,7 +9,7 @@ import ( "log" "github.com/alecthomas/repr" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/_examples/send_tick/main.go b/_examples/send_tick/main.go index beb1520..c1ded20 100644 --- a/_examples/send_tick/main.go +++ b/_examples/send_tick/main.go @@ -12,7 +12,7 @@ import ( "log" "os" - "github.com/tlinden/swayipc" + "codeberg.org/scip/swayipc/v1" ) func main() { diff --git a/bar.go b/v1/bar.go similarity index 100% rename from bar.go rename to v1/bar.go diff --git a/command.go b/v1/command.go similarity index 100% rename from command.go rename to v1/command.go diff --git a/doc.go b/v1/doc.go similarity index 100% rename from doc.go rename to v1/doc.go diff --git a/event.go b/v1/event.go similarity index 100% rename from event.go rename to v1/event.go diff --git a/go.mod b/v1/go.mod similarity index 64% rename from go.mod rename to v1/go.mod index 922f750..78b37f6 100644 --- a/go.mod +++ b/v1/go.mod @@ -1,4 +1,4 @@ -module github.com/tlinden/swayipc +module codeberg.org/scip/swayipc/v1 go 1.23 diff --git a/go.sum b/v1/go.sum similarity index 100% rename from go.sum rename to v1/go.sum diff --git a/input.go b/v1/input.go similarity index 100% rename from input.go rename to v1/input.go diff --git a/io.go b/v1/io.go similarity index 100% rename from io.go rename to v1/io.go diff --git a/net.go b/v1/net.go similarity index 97% rename from net.go rename to v1/net.go index d6e2534..dbc20d0 100644 --- a/net.go +++ b/v1/net.go @@ -34,8 +34,8 @@ func (ipc *SwayIPC) Connect() error { } // Close the socket. -func (ipc *SwayIPC) Close() { - ipc.socket.Close() +func (ipc *SwayIPC) Close() error { + return ipc.socket.Close() } func (ipc *SwayIPC) sendHeader(messageType uint32, len uint32) error { diff --git a/node.go b/v1/node.go similarity index 100% rename from node.go rename to v1/node.go diff --git a/output.go b/v1/output.go similarity index 100% rename from output.go rename to v1/output.go diff --git a/seat.go b/v1/seat.go similarity index 100% rename from seat.go rename to v1/seat.go diff --git a/simpletons.go b/v1/simpletons.go similarity index 100% rename from simpletons.go rename to v1/simpletons.go diff --git a/swayipc.go b/v1/swayipc.go similarity index 98% rename from swayipc.go rename to v1/swayipc.go index 7ff9684..c0ddfe6 100644 --- a/swayipc.go +++ b/v1/swayipc.go @@ -5,7 +5,7 @@ import ( ) const ( - VERSION = "v0.3.0" + VERSION = "v1.0.0" IPC_HEADER_SIZE = 14 IPC_MAGIC = "i3-ipc" diff --git a/version.go b/v1/version.go similarity index 100% rename from version.go rename to v1/version.go