Пример #1
0
	def setRotation(self, o):
		for d in self.__devices:
			runCmd("%s set %s Rotate %s" % (self.__xsetwacom, d, wacomRotations[o]))
Пример #2
0
	def getPenButton(self):
		return runCmd('%s get %s %s' % (self.__xsetwacom, self.__devices[0], wacomButton))[0].strip()
Пример #3
0
	def __findDevices(self):
		dev = runCmd("%s list dev | awk {'print $1'}" % self.__xsetwacom)
		return map(lambda s: s.strip(), dev)
Пример #4
0
	def setRotation(self, o):
		runCmd("%s --output LVDS --rotate %s" % (self.__xrandr, o))
		self.__wacom.setRotation(o)
		self.__updateArrowKeys(o)
Пример #5
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()
Пример #6
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)
Пример #7
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