Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
31
Task/Video-display-modes/Go/video-display-modes.go
Normal file
31
Task/Video-display-modes/Go/video-display-modes.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os/exec"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// query supported display modes
|
||||
out, err := exec.Command("xrandr", "-q").Output()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println(string(out))
|
||||
time.Sleep(3 * time.Second)
|
||||
|
||||
// change display mode to 1024x768 say (no text output)
|
||||
err = exec.Command("xrandr", "-s", "1024x768").Run()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
time.Sleep(3 * time.Second)
|
||||
|
||||
// change it back again to 1366x768 (or whatever is optimal for your system)
|
||||
err = exec.Command("xrandr", "-s", "1366x768").Run()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue