Video display modes: Difference between revisions

Added Go
(Removed {{omit from|Go}} template as this task can be completed on an X Window system by invoking the utility 'xrandr'.)
(Added Go)
Line 59:
 
ERRE language (for C-64) support high resolution graphic (320x200) using HGR.LIB library.
 
=={{header|Go}}==
{{trans|UNIX Shell}}
{{works with|Ubuntu 16.04}}
<lang go>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)
}
}</lang>
 
{{out}}
<pre>
Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767
eDP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
1366x768 60.00*+ 48.01
1360x768 59.80 59.96
1280x720 60.00
1024x768 60.00
1024x576 60.00
960x540 60.00
800x600 60.32 56.25
864x486 60.00
640x480 59.94
720x405 60.00
680x384 60.00
640x360 60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
</pre>
 
=={{header|Icon}} and {{header|Unicon}}==
9,483

edits