Esempio n. 1
0
File: Mixer.py Progetto: klniu/xkeys
def volumeUp():
    os.popen("pamixer --increase 5 --allow-boost")
    volume = SystemUtil.getProcessOutput("pamixer --get-volume")
    Message.hint(volume)
Esempio n. 2
0
File: Mixer.py Progetto: klniu/xkeys
def volumeDown():
    os.popen("pamixer --decrease 5")
    volume = SystemUtil.getProcessOutput("pamixer --get-volume --allow-boost")
    Message.hint(volume)
Esempio n. 3
0
def volumeUp():
    os.popen("pamixer --increase 5 --allow-boost")
    volume = SystemUtil.getProcessOutput("pamixer --get-volume")
    Message.hint(volume)
Esempio n. 4
0
def volumeDown():
    os.popen("pamixer --decrease 5")
    volume = SystemUtil.getProcessOutput("pamixer --get-volume --allow-boost")
    Message.hint(volume)
Esempio n. 5
0
def openSelection():
    SystemUtil.openSelection("xdg-open", "")
Esempio n. 6
0
def runSelection():
    SystemUtil.runSelection()
Esempio n. 7
0
def runSelection():
    text = getSelection()
    common = SystemUtil.transformUrlBeforeOpen(text)
    os.popen("open -a " + common)
    return None
Esempio n. 8
0
Since 2011-02-01
"""

import logging
import os
import subprocess
import sys
import gtk
import ClipboardUtil
import Message
import subprocess
import SendToUi
import SendToUi
import SystemUtil

fireFoxPid=SystemUtil.getProcessOutput("pidof firefox")

if fireFoxPid == "":
    sys.exit("Firefox window is not found")
lines = fireFoxPid.split(None, 4)
fireFoxPid = lines[0]

fireFoxWindowName=SystemUtil.getWindowNameByProcessId(fireFoxPid)
(title,s,url) = fireFoxWindowName.partition('- Firefox -')
lines = title.split(None, 4)
title = lines[4]

# sometimes there are several browser windows are opened get the url of the first window
lines = url.split(None, 2)
url = lines[0]
Esempio n. 9
0
"""
Sends series of characters to UI. Mac version. Based on applescript.

Author Andrew Terekhine
Since 2014-11-23
"""
import os
import string
import time

import MacClipboardUtil
import MacCommon
import MacUtil
import SystemUtil

if SystemUtil.isMac():
    import applescript

if __name__ == "__main__":
    import sys, PythonCall
    PythonCall.PythonCall(sys.argv).execute()


def sendUnicodeTextAsKeyCodes(text):
    if len(text) == 0:
        return
    text = text.strip()
    command = "\nkeystroke \""
    for c in text:
        command += ("0x" + hex(ord(c))[2:].zfill(4))
    content = "tell application \"System Events\"" + command + "\" using option down\n end tell"
Esempio n. 10
0
def openSelection():
    text = getSelection()
    text = SystemUtil.transformUrlBeforeOpen(text)
    os.popen("open " + text)
    return None
Esempio n. 11
0
def getLanguage():
    return SystemUtil.getProcessOutput("setxkbmap -print | grep xkb_symbols | awk -F'+' '{print $2}'")
Esempio n. 12
0
def open(title, url):
    text = SystemUtil.getSelection()
    Message.hint(title + " " + text)
    openExecute(url, text)
Esempio n. 13
0
def runSelection():
    text = getSelection()
    common = SystemUtil.transformUrlBeforeOpen(text)
    os.popen("open -a " + common)
    return None
Esempio n. 14
0
def openSelection():
    text = getSelection()
    text = SystemUtil.transformUrlBeforeOpen(text)
    os.popen("open " + text)
    return None
Esempio n. 15
0
"""
Sends series of characters to UI. Mac version. Based on applescript.

Author Andrew Terekhine
Since 2014-11-23
"""
import os
import string
import time

import MacClipboardUtil
import MacCommon
import MacUtil
import SystemUtil

if SystemUtil.isMac():
    import applescript

if __name__ == "__main__":
        import sys, PythonCall
        PythonCall.PythonCall(sys.argv).execute()

def sendUnicodeTextAsKeyCodes(text):
    if len(text) == 0:
        return
    text = text.strip()
    command = "\nkeystroke \""
    for c in text:
        command += ("0x" + hex(ord(c))[2:].zfill(4))
    content = "tell application \"System Events\"" + command + "\" using option down\n end tell"
    script = applescript.AppleScript(content)