1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/usr/bin/env python
import subprocess, os, time, xvfbwrapper, itertools
def ratpoison(*args):
return subprocess.check_output(("ratpoison",) + tuple(itertools.chain.from_iterable(("-c", a) for a in args)))
def snooze(how_long = 15):
time.sleep(how_long)
def main():
with xvfbwrapper.Xvfb(fbdir = "/framebuf"):
print("DISPLAY={}".format(os.getenv("DISPLAY")))
print("Starting rodent-free window manager")
rat = subprocess.Popen(["ratpoison"])
snooze()
print("Starting XiLinx license manager")
xlcm = ". /opt/Xilinx/14.7/ISE_DS/settings64.sh; /opt/Xilinx/14.7/ISE_DS/common/bin/lin64/xlcm -manage"
xlcm = subprocess.Popen(xlcm, shell = True)
snooze()
print("First screen")
ratpoison("ratwarp 100 116", "ratclick")
snooze()
print("Second screen")
ratpoison("ratwarp 220 170", "ratclick",
"ratwarp 680 490", "ratclick")
snooze()
print("Third screen")
ratpoison("ratwarp 400 360", "ratclick",
"ratwarp 750 650", "ratclick",
"quit")
print("xlcm exited with status {}".format(xlcm.wait()))
print("ratpoison exited with status {}".format(rat.wait()))
if __name__ == "__main__":
main()
|