YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 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)
|
||||
}
|
||||
}
|
||||
10
Task/Video-display-modes/Phix/video-display-modes.phix
Normal file
10
Task/Video-display-modes/Phix/video-display-modes.phix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
if platform()=LINUX then
|
||||
{} = system_exec("xrandr -s 640x480")
|
||||
sleep(3)
|
||||
{} = system_exec("xrandr -s 1280x960")
|
||||
else -- WINDOWS
|
||||
puts(1,"") -- (ensure console exists)
|
||||
system("mode CON: COLS=40 LINES=25")
|
||||
sleep(3)
|
||||
system("mode CON: COLS=80 LINES=25")
|
||||
end if
|
||||
Loading…
Add table
Add a link
Reference in a new issue