mirror of
https://codeberg.org/scip/swayipc.git
synced 2026-08-24 06:44:19 +02:00
renovate the code, update to go 1.26 and satisfy linter (#3)
This commit is contained in:
88
_examples/Makefile
Normal file
88
_examples/Makefile
Normal file
@@ -0,0 +1,88 @@
|
||||
examples: example-current_workspace example-events example-find_focused_window example-get_bars example-get_config example-get_inputs example-get_marks example-get_outputs example-get_seats example-get_tree example-get_version example-get_workspaces example-run_command example-run_global_command
|
||||
|
||||
clean: clean-example-current_workspace clean-example-events clean-example-find_focused_window clean-example-get_bars clean-example-get_config clean-example-get_inputs clean-example-get_marks clean-example-get_outputs clean-example-get_seats clean-example-get_tree clean-example-get_version clean-example-get_workspaces clean-example-run_command clean-example-run_global_command
|
||||
|
||||
example-current_workspace:
|
||||
make -C current_workspace
|
||||
|
||||
example-events:
|
||||
make -C events
|
||||
|
||||
example-find_focused_window:
|
||||
make -C find_focused_window
|
||||
|
||||
example-get_bars:
|
||||
make -C get_bars
|
||||
|
||||
example-get_config:
|
||||
make -C get_config
|
||||
|
||||
example-get_inputs:
|
||||
make -C get_inputs
|
||||
|
||||
example-get_marks:
|
||||
make -C get_marks
|
||||
|
||||
example-get_outputs:
|
||||
make -C get_outputs
|
||||
|
||||
example-get_seats:
|
||||
make -C get_seats
|
||||
|
||||
example-get_tree:
|
||||
make -C get_tree
|
||||
|
||||
example-get_version:
|
||||
make -C get_version
|
||||
|
||||
example-get_workspaces:
|
||||
make -C get_workspaces
|
||||
|
||||
example-run_command:
|
||||
make -C run_command
|
||||
|
||||
example-run_global_command:
|
||||
make -C run_global_command
|
||||
|
||||
clean-example-current_workspace:
|
||||
make -C current_workspace clean
|
||||
|
||||
clean-example-events:
|
||||
make -C events clean
|
||||
|
||||
clean-example-find_focused_window:
|
||||
make -C find_focused_window clean
|
||||
|
||||
clean-example-get_bars:
|
||||
make -C get_bars clean
|
||||
|
||||
clean-example-get_config:
|
||||
make -C get_config clean
|
||||
|
||||
clean-example-get_inputs:
|
||||
make -C get_inputs clean
|
||||
|
||||
clean-example-get_marks:
|
||||
make -C get_marks clean
|
||||
|
||||
clean-example-get_outputs:
|
||||
make -C get_outputs clean
|
||||
|
||||
clean-example-get_seats:
|
||||
make -C get_seats clean
|
||||
|
||||
clean-example-get_tree:
|
||||
make -C get_tree clean
|
||||
|
||||
clean-example-get_version:
|
||||
make -C get_version clean
|
||||
|
||||
clean-example-get_workspaces:
|
||||
make -C get_workspaces clean
|
||||
|
||||
clean-example-run_command:
|
||||
make -C run_command clean
|
||||
|
||||
clean-example-run_global_command:
|
||||
make -C run_global_command clean
|
||||
|
||||
5
_examples/current_workspace/Makefile
Normal file
5
_examples/current_workspace/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f current_workspace
|
||||
9
_examples/current_workspace/go.mod
Normal file
9
_examples/current_workspace/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module current_workspace
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/current_workspace/go.sum
Normal file
2
_examples/current_workspace/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/events/Makefile
Normal file
5
_examples/events/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f events
|
||||
9
_examples/events/go.mod
Normal file
9
_examples/events/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/events/go.sum
Normal file
2
_examples/events/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
)
|
||||
|
||||
// Event callback function, needs to implement each subscribed events,
|
||||
@@ -18,11 +18,11 @@ import (
|
||||
func ProcessTick(event *swayipc.RawResponse) error {
|
||||
var err error
|
||||
switch event.PayloadType {
|
||||
case swayipc.EV_Tick:
|
||||
case swayipc.EvTick:
|
||||
ev := &swayipc.EventTick{}
|
||||
err = json.Unmarshal(event.Payload, &ev)
|
||||
repr.Println(ev)
|
||||
case swayipc.EV_Window:
|
||||
case swayipc.EvWindow:
|
||||
ev := &swayipc.EventWindow{}
|
||||
err = json.Unmarshal(event.Payload, &ev)
|
||||
repr.Println(ev)
|
||||
|
||||
5
_examples/find_focused_window/Makefile
Normal file
5
_examples/find_focused_window/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f find_focused_window
|
||||
9
_examples/find_focused_window/go.mod
Normal file
9
_examples/find_focused_window/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/find_focused_window/go.sum
Normal file
2
_examples/find_focused_window/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -25,6 +25,6 @@ func main() {
|
||||
|
||||
if focused != nil {
|
||||
fmt.Printf("focused node: %s\n id: %d\n Geometry: %dx%d\n",
|
||||
focused.Name, focused.Id, focused.Geometry.Width, focused.Geometry.Height)
|
||||
focused.Name, focused.ID, focused.Geometry.Width, focused.Geometry.Height)
|
||||
}
|
||||
}
|
||||
|
||||
5
_examples/get_bars/Makefile
Normal file
5
_examples/get_bars/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f get_bars
|
||||
9
_examples/get_bars/go.mod
Normal file
9
_examples/get_bars/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/get_bars/go.sum
Normal file
2
_examples/get_bars/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/get_config/Makefile
Normal file
5
_examples/get_config/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f get_config
|
||||
9
_examples/get_config/go.mod
Normal file
9
_examples/get_config/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/get_config/go.sum
Normal file
2
_examples/get_config/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/get_inputs/Makefile
Normal file
5
_examples/get_inputs/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f get_inputs
|
||||
9
_examples/get_inputs/go.mod
Normal file
9
_examples/get_inputs/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/get_inputs/go.sum
Normal file
2
_examples/get_inputs/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/get_marks/Makefile
Normal file
5
_examples/get_marks/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f get_marks
|
||||
9
_examples/get_marks/go.mod
Normal file
9
_examples/get_marks/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/get_marks/go.sum
Normal file
2
_examples/get_marks/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/get_outputs/Makefile
Normal file
5
_examples/get_outputs/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f get_outputs
|
||||
9
_examples/get_outputs/go.mod
Normal file
9
_examples/get_outputs/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/get_outputs/go.sum
Normal file
2
_examples/get_outputs/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/get_seats/Makefile
Normal file
5
_examples/get_seats/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f get_seats
|
||||
9
_examples/get_seats/go.mod
Normal file
9
_examples/get_seats/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/get_seats/go.sum
Normal file
2
_examples/get_seats/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/get_tree/Makefile
Normal file
5
_examples/get_tree/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f get_tree
|
||||
9
_examples/get_tree/go.mod
Normal file
9
_examples/get_tree/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/get_tree/go.sum
Normal file
2
_examples/get_tree/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/get_version/Makefile
Normal file
5
_examples/get_version/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f get_version
|
||||
9
_examples/get_version/go.mod
Normal file
9
_examples/get_version/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/get_version/go.sum
Normal file
2
_examples/get_version/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/get_workspaces/Makefile
Normal file
5
_examples/get_workspaces/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f get_workspaces
|
||||
9
_examples/get_workspaces/go.mod
Normal file
9
_examples/get_workspaces/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/get_workspaces/go.sum
Normal file
2
_examples/get_workspaces/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/run_command/Makefile
Normal file
5
_examples/run_command/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f run_command
|
||||
9
_examples/run_command/go.mod
Normal file
9
_examples/run_command/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/run_command/go.sum
Normal file
2
_examples/run_command/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -9,8 +9,8 @@ package main
|
||||
import (
|
||||
"log"
|
||||
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -37,7 +37,7 @@ func main() {
|
||||
|
||||
// finally execute the given commands on it, you can use any run
|
||||
// command, see sway(5)
|
||||
responses, err := ipc.RunContainerCommand(focused.Id, "floating toggle", "border toggle")
|
||||
responses, err := ipc.RunContainerCommand(focused.ID, "floating toggle", "border toggle")
|
||||
if err != nil {
|
||||
repr.Println(responses)
|
||||
log.Fatal(err)
|
||||
|
||||
5
_examples/run_global_command/Makefile
Normal file
5
_examples/run_global_command/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f run_global_command
|
||||
9
_examples/run_global_command/go.mod
Normal file
9
_examples/run_global_command/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/run_global_command/go.sum
Normal file
2
_examples/run_global_command/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/alecthomas/repr"
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
5
_examples/send_tick/Makefile
Normal file
5
_examples/send_tick/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
all:
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f send_tick
|
||||
9
_examples/send_tick/go.mod
Normal file
9
_examples/send_tick/go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module send_tick
|
||||
|
||||
go 1.26
|
||||
|
||||
require github.com/alecthomas/repr v0.5.4 // indirect
|
||||
|
||||
replace codeberg.org/scip/swayipc/v2 => ../..
|
||||
|
||||
require codeberg.org/scip/swayipc/v2 v2.1.0
|
||||
2
_examples/send_tick/go.sum
Normal file
2
_examples/send_tick/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/alecthomas/repr v0.5.4 h1:OVP7JEcuzU9CCDsT6STCr3rg17oQfWILtPWd2EG0uN4=
|
||||
github.com/alecthomas/repr v0.5.4/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"codeberg.org/scip/swayipc/v1"
|
||||
"codeberg.org/scip/swayipc/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user