Invert display and lockscreen control dependencies

This commit is contained in:
2020-08-20 16:57:57 +02:00
parent e6458aba0b
commit ebbd1974df
7 changed files with 59 additions and 17 deletions

View File

@ -7,8 +7,11 @@ import (
)
// Suspend the display using xset
func Suspend() error {
// Xset monitors/controls the display using xset
type Xset struct {}
// Suspend the display
func (Xset) Suspend() error {
cmd := exec.Command("xset",
"dpms",
"force",
@ -18,7 +21,7 @@ func Suspend() error {
}
// IsOn determines if the display is on
func IsOn() (bool, error) {
func (Xset) IsOn() (bool, error) {
cmd := exec.Command("xset", "q")
outputBytes, err := cmd.CombinedOutput()
if err != nil {