mirror of
https://codeberg.org/scip/swayipc.git
synced 2026-10-08 11:14:25 +02:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f4a4a6995 | |||
| d64f84c887 | |||
| 9e558e1f3c | |||
| f95d156509 | |||
| a718a31249 |
30
node.go
30
node.go
@@ -6,11 +6,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
NodeTypeRoot = "root"
|
NodeTypeRoot = iota + 1 // A root node
|
||||||
NodeTypeOutput = "output"
|
NodeTypeOutput // An output node
|
||||||
NodeTypeWorkspace = "workspace"
|
NodeTypeWorkspace // A workspace
|
||||||
NodeTypeCon = "con"
|
NodeTypeCon // A container node (containing more nodes)
|
||||||
NodeTypeFloating = "floating_con"
|
NodeTypeFloating // A floating node
|
||||||
)
|
)
|
||||||
|
|
||||||
// Node can be an output, a workspace, a container or a container
|
// Node can be an output, a workspace, a container or a container
|
||||||
@@ -86,26 +86,6 @@ func (node *Node) FindCurrentWorkspace() string {
|
|||||||
return searchCurrentWorkspace(node.Nodes)
|
return searchCurrentWorkspace(node.Nodes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (node *Node) IsRoot() bool {
|
|
||||||
return node.Type == NodeTypeRoot
|
|
||||||
}
|
|
||||||
|
|
||||||
func (node *Node) IsOutput() bool {
|
|
||||||
return node.Type == NodeTypeOutput
|
|
||||||
}
|
|
||||||
|
|
||||||
func (node *Node) IsWorkspace() bool {
|
|
||||||
return node.Type == NodeTypeWorkspace
|
|
||||||
}
|
|
||||||
|
|
||||||
func (node *Node) IsContainer() bool {
|
|
||||||
return node.Type == NodeTypeCon
|
|
||||||
}
|
|
||||||
|
|
||||||
func (node *Node) IsFloating() bool {
|
|
||||||
return node.Type == NodeTypeFloating
|
|
||||||
}
|
|
||||||
|
|
||||||
// searchCurrentWorkspace search for current workspace
|
// searchCurrentWorkspace search for current workspace
|
||||||
func searchCurrentWorkspace(nodes []*Node) string {
|
func searchCurrentWorkspace(nodes []*Node) string {
|
||||||
for _, node := range nodes {
|
for _, node := range nodes {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
VERSION = "v2.1.1"
|
VERSION = "v2.1.0"
|
||||||
|
|
||||||
IpcHeaderSize = 14
|
IpcHeaderSize = 14
|
||||||
IpcMagix = "i3-ipc"
|
IpcMagix = "i3-ipc"
|
||||||
|
|||||||
Reference in New Issue
Block a user