Exemplo n.º 1
0
def main_laptop():
    for win in Window.by_class('emacs.Emacs'):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=526, y=0, w=2036, h=1300)

    for win in Window.by_role('autoterm'):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=526, y=0, w=2036, h=1460)

    for win in Window.by_class('mail.google.com.Google-chrome'):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=PANEL, y=0, w=1428, h=1440)

    for win in Window.by_class('web.whatsapp.com.Google-chrome'):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=PANEL, y=0, w=1428, h=900)

    for win in Window.by_class(TELEGRAM):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=PANEL, y=200, w=1428, h=700)

    mattermost_class = 'mattermost.smithersbet.com.Google-chrome'  # chrome webapp
    #mattermost_class = 'mattermost.Mattermost' # native app
    for win in Window.by_class(mattermost_class):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=PANEL, y=0, w=1428, h=956)

    for win in Window.by_class('hexchat.Hexchat'):
        unmaximize(win)
        win.set_decorations(False)
        win.sticky()
        win.resize_and_move(x=PANEL, y=1440 - 960, w=1428, h=960)
        set_hexchat_font(13)

    for win in Window.by_class('google-chrome.Google-chrome'):
        # position this at the center of the main screen
        W = 1800
        X = PANEL + (2560 - W - PANEL) / 2
        win.resize_and_move(x=X, y=0, w=W, h=1440)

    for win in Window.by_class('conky.conky'):
        win.sticky()
Exemplo n.º 2
0
def main_dock():
    X0 = 0  # x position of the leftmost screen
    X1 = 1440  # x position of the center screen
    X2 = X1 + 3840  # x position of the rightmost screen

    for win in Window.by_class('emacs.Emacs'):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=X1 + 1806, y=0, w=2036, h=1900)

    for win in Window.by_role('autoterm'):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=X1 + 1809, y=0, w=2036, h=2160)

    for win in Window.by_class('mail.google.com.Google-chrome'):
        unmaximize(win)
        win.resize_and_move(x=1440 + 64, y=0, w=1740, h=1803)

    for win in Window.by_class('web.whatsapp.com.Google-chrome'):
        unmaximize(win)
        win.resize_and_move(x=0, y=0, w=1428, h=1200)
        win.sticky()

    for win in Window.by_class(TELEGRAM):
        unmaximize(win)
        win.resize_and_move(x=0, y=1288, w=1440, h=1000)
        win.sticky()

    mattermost_class = 'mattermost.smithersbet.com.Google-chrome'  # chrome webapp
    #mattermost_class = 'mattermost.Mattermost' # native app
    for win in Window.by_class(mattermost_class):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=X2, y=0, w=1080, h=956)
        win.sticky()

    for win in Window.by_class('hexchat.Hexchat'):
        unmaximize(win)
        win.set_decorations(False)
        win.resize_and_move(x=X2, y=960, w=1080, h=960)
        win.sticky()
        set_hexchat_font(9)

    for win in Window.by_class('google-chrome.Google-chrome'):
        # position this at the center of the main screen
        W = 2000
        X = X1 + PANEL + (3840 - 2000 - PANEL) / 2
        win.resize_and_move(x=X, y=0, w=W, h=2000)
Exemplo n.º 3
0
#!/usr/bin/env python

import os
from wmctrl import Window


def unmaximize(win):
    return
    win.set_properties(['remove', 'maximized_vert', 'maximized_horz'])


WHATSAPP = Window.by_class('web.whatsapp.com.Google-chrome')[0]
TELEGRAM = Window.by_class('Telegram.TelegramDesktop')[0]


def tg():
    WHATSAPP.resize_and_move(x=0, y=0)
    TELEGRAM.resize_and_move(x=0, y=230)
    TELEGRAM.activate()


def wa():
    WHATSAPP.resize_and_move(x=0, y=230)
    WHATSAPP.activate()
    TELEGRAM.resize_and_move(x=0, y=0)


def tg():
    import gtk.gdk
    whatsapp = gtk.gdk.window_foreign_new(int(WHATSAPP.id, 16))
    telegram = gtk.gdk.window_foreign_new(int(TELEGRAM.id, 16))
Exemplo n.º 4
0
import os.path
import time
import pyautogui
from subprocess import call
from wmctrl import Window

for win in Window.list():
    print(win)

# For ubuntu 16
# zap_main = Window.by_class('sun-awt-X11-XFramePeer.OWASP')[0]
zap_main = Window.by_class('OWASP')[0]
zap_main.set_properties(['add', 'maximized_vert', 'maximized_horz'])

pyautogui.screenshot('output/shot.png')

screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
# pyautogui.moveRel(None, 10)  # move mouse 10 pixels down
# pyautogui.doubleClick()

# Mac force to start
# pyautogui.hotkey('command', 'space')
# pyautogui.typewrite('OWASP ZAP', interval=0.01)
# pyautogui.press('enter')

# Quick launch
pyautogui.moveTo(890, 94, duration=0.6)
pyautogui.click()
time.sleep(4)
pyautogui.hotkey('esc')