|
|
|
@ -9,33 +9,31 @@ import re
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
pid = ""
|
|
|
|
|
if gtk.gdk.get_display():
|
|
|
|
|
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
|
|
|
|
|
|
|
|
|
# Here we connect the "destroy" event to a signal handler
|
|
|
|
|
window.connect("destroy", lambda w: gtk.main_quit())
|
|
|
|
|
pipe = subprocess.Popen(["xdpyinfo"],
|
|
|
|
|
stdout=subprocess.PIPE, env=os.environ)
|
|
|
|
|
reRes = re.compile("dimensions:\s+(\d+)x(\d+)\s+pixels")
|
|
|
|
|
cx, cy = 1024, 768
|
|
|
|
|
if pipe.wait() == 0:
|
|
|
|
|
for line in pipe.stdout:
|
|
|
|
|
searchRes = reRes.search(line)
|
|
|
|
|
if searchRes:
|
|
|
|
|
cx, cy = int(searchRes.group(1)), int(searchRes.group(2))
|
|
|
|
|
break
|
|
|
|
|
pipe.stdout.close()
|
|
|
|
|
window.set_size_request(cx,cy)
|
|
|
|
|
window.maximize()
|
|
|
|
|
|
|
|
|
|
window.set_border_width(0)
|
|
|
|
|
window.modify_bg(gtk.STATE_NORMAL,
|
|
|
|
|
gtk.gdk.rgb_get_colormap().alloc_color('#5F7583'))
|
|
|
|
|
|
|
|
|
|
window.show()
|
|
|
|
|
pid = os.fork()
|
|
|
|
|
if not pid:
|
|
|
|
|
gtk.main()
|
|
|
|
|
print pid
|
|
|
|
|
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
|
|
|
|
|
|
|
|
|
# Here we connect the "destroy" event to a signal handler
|
|
|
|
|
window.connect("destroy", lambda w: gtk.main_quit())
|
|
|
|
|
pipe = subprocess.Popen(["xdpyinfo"],
|
|
|
|
|
stdout=subprocess.PIPE, env=os.environ)
|
|
|
|
|
reRes = re.compile("dimensions:\s+(\d+)x(\d+)\s+pixels")
|
|
|
|
|
cx, cy = 1024, 768
|
|
|
|
|
if pipe.wait() == 0:
|
|
|
|
|
for line in pipe.stdout:
|
|
|
|
|
searchRes = reRes.search(line)
|
|
|
|
|
if searchRes:
|
|
|
|
|
cx, cy = int(searchRes.group(1)), int(searchRes.group(2))
|
|
|
|
|
break
|
|
|
|
|
pipe.stdout.close()
|
|
|
|
|
window.set_size_request(cx,cy)
|
|
|
|
|
window.maximize()
|
|
|
|
|
|
|
|
|
|
window.set_border_width(0)
|
|
|
|
|
window.modify_bg(gtk.STATE_NORMAL,
|
|
|
|
|
gtk.gdk.rgb_get_colormap().alloc_color('#5F7583'))
|
|
|
|
|
|
|
|
|
|
window.show()
|
|
|
|
|
pid = os.fork()
|
|
|
|
|
if not pid:
|
|
|
|
|
gtk.main()
|
|
|
|
|
sys.exit(0)
|
|
|
|
|