Initial commit
This commit is contained in:
24
vendor/go.i3wm.org/i3/config.go
generated
vendored
Normal file
24
vendor/go.i3wm.org/i3/config.go
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package i3
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// Config contains details about the configuration file.
|
||||
//
|
||||
// See https://i3wm.org/docs/ipc.html#_config_reply for more details.
|
||||
type Config struct {
|
||||
Config string `json:"config"`
|
||||
}
|
||||
|
||||
// GetConfig returns i3’s in-memory copy of the configuration file contents.
|
||||
//
|
||||
// GetConfig is supported in i3 ≥ v4.14 (2017-09-04).
|
||||
func GetConfig() (Config, error) {
|
||||
reply, err := roundTrip(messageTypeGetConfig, nil)
|
||||
if err != nil {
|
||||
return Config{}, err
|
||||
}
|
||||
|
||||
var cfg Config
|
||||
err = json.Unmarshal(reply.Payload, &cfg)
|
||||
return cfg, err
|
||||
}
|
||||
Reference in New Issue
Block a user