diff options
author | Rob Austein <sra@hactrn.net> | 2019-02-13 02:19:35 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2019-02-13 02:19:35 +0000 |
commit | 48e70b200759f51b8470f67146d35688c18ead3b (patch) | |
tree | bdefbaa8ab18511c597cd97e25e295d5b1608031 | |
parent | 8b18f65526d2b600c4aef49be338a83402bb6b58 (diff) |
Licenser
-rwxr-xr-x | stage2/licenser | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/stage2/licenser b/stage2/licenser new file mode 100755 index 0000000..3bccb83 --- /dev/null +++ b/stage2/licenser @@ -0,0 +1,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() |