mirror of
https://codeberg.org/scip/swayipc.git
synced 2026-08-23 22:34:20 +02:00
renovate the code, update to go 1.26 and satisfy linter (#3)
This commit is contained in:
28
output.go
28
output.go
@@ -5,30 +5,30 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Store an output mode.
|
||||
// Mode stores data of an output mode.
|
||||
type Mode struct {
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
Refresh int `json:"refresh"`
|
||||
}
|
||||
|
||||
// An output object (i.e. a physical monitor)
|
||||
// Output represents an output object (i.e. a physical monitor)
|
||||
type Output struct {
|
||||
Name string `json:"name"`
|
||||
Make string `json:"make"`
|
||||
Serial string `json:"serial"`
|
||||
Active bool `json:"active"`
|
||||
Primary bool `json:"primary"`
|
||||
SubpixelHinting string `json:"subpixel_hinting"`
|
||||
Transform string `json:"transform"`
|
||||
Current_workspace string `json:"current_workspace"`
|
||||
Modes []*Mode `json:"modes"`
|
||||
CurrentMode *Mode `json:"current_mode"`
|
||||
Name string `json:"name"`
|
||||
Make string `json:"make"`
|
||||
Serial string `json:"serial"`
|
||||
Active bool `json:"active"`
|
||||
Primary bool `json:"primary"`
|
||||
SubpixelHinting string `json:"subpixel_hinting"`
|
||||
Transform string `json:"transform"`
|
||||
CurrentWorkspace string `json:"current_workspace"`
|
||||
Modes []*Mode `json:"modes"`
|
||||
CurrentMode *Mode `json:"current_mode"`
|
||||
}
|
||||
|
||||
// Get a list of currently available and usable outputs.
|
||||
// GetOutputs returns a list of currently available and usable outputs.
|
||||
func (ipc *SwayIPC) GetOutputs() ([]*Output, error) {
|
||||
err := ipc.sendHeader(GET_OUTPUTS, 0)
|
||||
err := ipc.sendHeader(MsgGetOutputs, 0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user