mirror of
https://codeberg.org/scip/swayipc.git
synced 2026-08-24 23:04:19 +02:00
update to module changes
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"codeberg.org/scip/swayipc/v2"
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Event callback function, needs to implement each subscribed events,
|
// Event callback function, needs to implement each subscribed events,
|
||||||
@@ -18,11 +18,11 @@ import (
|
|||||||
func ProcessTick(event *swayipc.RawResponse) error {
|
func ProcessTick(event *swayipc.RawResponse) error {
|
||||||
var err error
|
var err error
|
||||||
switch event.PayloadType {
|
switch event.PayloadType {
|
||||||
case swayipc.EV_Tick:
|
case swayipc.EvTick:
|
||||||
ev := &swayipc.EventTick{}
|
ev := &swayipc.EventTick{}
|
||||||
err = json.Unmarshal(event.Payload, &ev)
|
err = json.Unmarshal(event.Payload, &ev)
|
||||||
repr.Println(ev)
|
repr.Println(ev)
|
||||||
case swayipc.EV_Window:
|
case swayipc.EvWindow:
|
||||||
ev := &swayipc.EventWindow{}
|
ev := &swayipc.EventWindow{}
|
||||||
err = json.Unmarshal(event.Payload, &ev)
|
err = json.Unmarshal(event.Payload, &ev)
|
||||||
repr.Println(ev)
|
repr.Println(ev)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -25,6 +25,6 @@ func main() {
|
|||||||
|
|
||||||
if focused != nil {
|
if focused != nil {
|
||||||
fmt.Printf("focused node: %s\n id: %d\n Geometry: %dx%d\n",
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"codeberg.org/scip/swayipc/v2"
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -37,7 +37,7 @@ func main() {
|
|||||||
|
|
||||||
// finally execute the given commands on it, you can use any run
|
// finally execute the given commands on it, you can use any run
|
||||||
// command, see sway(5)
|
// 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 {
|
if err != nil {
|
||||||
repr.Println(responses)
|
repr.Println(responses)
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/alecthomas/repr"
|
"github.com/alecthomas/repr"
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"codeberg.org/scip/swayipc/v1"
|
"codeberg.org/scip/swayipc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user