Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
windowgrid [2011/04/05 01:00] – created killermoehre | windowgrid [2011/12/13 17:49] – killermoehre | ||
---|---|---|---|
Line 7: | Line 7: | ||
* hope for fixing of [[https:// | * hope for fixing of [[https:// | ||
- | If there are questions, please ask. | + | If there are questions, please ask (and help). |
---- | ---- | ||
Line 13: | Line 13: | ||
# | # | ||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||
+ | | ||
import sys | import sys | ||
import os | import os | ||
import wnck | import wnck | ||
from Xlib import display | from Xlib import display | ||
- | | + | |
PACKAGE = " | PACKAGE = " | ||
+ | | ||
def _help_(): | def _help_(): | ||
print(u' | print(u' | ||
print(u' | print(u' | ||
return(0) | return(0) | ||
+ | | ||
def active_window(): | def active_window(): | ||
# returns the default screen, but it fails when not called from X | # returns the default screen, but it fails when not called from X | ||
Line 34: | Line 33: | ||
screen.force_update() | screen.force_update() | ||
return(screen.get_active_window()) | return(screen.get_active_window()) | ||
+ | | ||
def get_resolution(orientation): | def get_resolution(orientation): | ||
# Accept only ' | # Accept only ' | ||
return display.Display.screen(display.Display())[orientation + | return display.Display.screen(display.Display())[orientation + | ||
' | ' | ||
+ | | ||
def get_geometry(): | def get_geometry(): | ||
# just a shorting for wnck.Window.get_geometry(active_window()) | # just a shorting for wnck.Window.get_geometry(active_window()) | ||
return(active_window().get_geometry()) | return(active_window().get_geometry()) | ||
+ | | ||
def window_state(head, | def window_state(head, | ||
# The HeadMap showing the screen; 4, 5 and 6 are vertical full, | # The HeadMap showing the screen; 4, 5 and 6 are vertical full, | ||
Line 99: | Line 98: | ||
height = y_res / 2 | height = y_res / 2 | ||
return(int(x), | return(int(x), | ||
+ | | ||
def set_geometry(geo_list): | def set_geometry(geo_list): | ||
# DOC: http:// | # DOC: http:// | ||
Line 120: | Line 119: | ||
active_window().set_geometry(10, | active_window().set_geometry(10, | ||
return 0 | return 0 | ||
- | | + | |
def main(): | def main(): | ||
if len(sys.argv) > 2: | if len(sys.argv) > 2: | ||
Line 162: | Line 161: | ||
print(' | print(' | ||
sys.exit(0) | sys.exit(0) | ||
+ | | ||
if __name__ == ' | if __name__ == ' | ||
main() | main() |