Example #1
0
 def read(self):
     l = runCmd("hddtemp %s" % self.__disk)
     for x in l:
         m = re.match("[^:]+:[^:]+:\s+(\d+)\s+C", x)
         if m:
             return float(m.group(1))
     return None
Example #2
0
 def setRotation(self, o):
     runCmd("%s --output LVDS --rotate %s" % (self.__xrandr, o))
     self.__wacom.setRotation(o)
     self.__updateArrowKeys(o)
Example #3
0
 def getRotation(self):
     l = runCmd(self.__xrandr)
     l = [x for x in l if re.search(r"(LVDS|default) connected", x)][0]
     l = l.split(" ")[3]
     l = re.sub(r"\(", "", l)
     return l.strip()
Example #4
0
def __getDisplays():
    who = runCmd("/usr/bin/who -s")
    l = filter(lambda s: re.search("^[^\s]+\s+(:[\.\d]+)", s), who)
    return map(lambda x: (re.split("\s+", x)[0], re.split("\s+", x)[1]), l)
Example #5
0
 def getPenButton(self):
     return runCmd("%s get %s %s" % (self.__xsetwacom, self.__devices[0], wacomButton))[0].strip()
Example #6
0
 def setRotation(self, o):
     for d in self.__devices:
         runCmd("%s set %s Rotate %s" % (self.__xsetwacom, d, wacomRotations[o]))
Example #7
0
 def __findDevices(self):
     dev = runCmd("%s list dev | awk {'print $1'}" % self.__xsetwacom)
     return map(lambda s: s.strip(), dev)