53 lines
713 B
Go
53 lines
713 B
Go
|
package xrandr
|
||
|
|
||
|
type Reflection string
|
||
|
|
||
|
const (
|
||
|
ReflectionNormal Reflection = "normal"
|
||
|
ReflectionX Reflection = "X axis"
|
||
|
ReflectionY Reflection = "Y axis"
|
||
|
ReflectionXY Reflection = "X and Y axis"
|
||
|
)
|
||
|
|
||
|
func MakeReflection(ref string) Reflection {
|
||
|
switch ref {
|
||
|
|
||
|
case "normal":
|
||
|
return ReflectionNormal
|
||
|
|
||
|
case "X axis":
|
||
|
return ReflectionX
|
||
|
|
||
|
case "Y axis":
|
||
|
return ReflectionY
|
||
|
|
||
|
case "X and Y axis":
|
||
|
return ReflectionXY
|
||
|
|
||
|
default:
|
||
|
return ReflectionNormal
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (r Reflection) xrandr() string {
|
||
|
switch r {
|
||
|
|
||
|
case ReflectionNormal:
|
||
|
return "normal"
|
||
|
|
||
|
case ReflectionX:
|
||
|
return "x"
|
||
|
|
||
|
case ReflectionY:
|
||
|
return "y"
|
||
|
|
||
|
case ReflectionXY:
|
||
|
return "xy"
|
||
|
|
||
|
default:
|
||
|
return "normal"
|
||
|
|
||
|
}
|
||
|
}
|