go-i3/marks.go

18 lines
363 B
Go
Raw Normal View History

2023-10-22 16:19:10 +02:00
package i3
import "encoding/json"
// GetMarks returns the names of all currently set marks.
//
// GetMarks is supported in i3 ≥ v4.1 (2011-11-11).
func GetMarks() ([]string, error) {
reply, err := roundTrip(messageTypeGetMarks, nil)
if err != nil {
return nil, err
}
var marks []string
err = json.Unmarshal(reply.Payload, &marks)
return marks, err
}