Este programa muda para a tela 0-9 e a-z, (11 - 37). Ele precisa ser chamado de chmod +x switcher.py
e ser chamado por um atalho na chave / atalhos.
import subprocess
import Tkinter as tk
class App(object):
def __init__(self, master, **kwargs):
self.master = master
master.geometry('200x200+0+0')
master.bind('<KeyPress>', self.react_to_keypress)
master.after(2500, quit)
def react_to_keypress(self, event):
key = event.char.lower()
try:
int(key)
except ValueError:
if ord(key) < 97 or ord(key) > 122:
return False
else:
key = str(ord(key) - 97 + 10)
print key
subprocess.call(["/usr/bin/wmctrl", "-s " + key])
def quit(self):
self.master.quit()
root = tk.Tk()
app = App(root)
root.mainloop()