diff --git a/pym/desktop/variables/desktop.py b/pym/desktop/variables/desktop.py index 959cbbc..3a6afd7 100644 --- a/pym/desktop/variables/desktop.py +++ b/pym/desktop/variables/desktop.py @@ -25,9 +25,10 @@ from calculate.lib.datavars import (Variable, VariableError, ReadonlyVariable, from calculate.lib.utils.common import getValueFromConfig from calculate.lib.variables import user from calculate.lib.utils.files import (readLinesFile, process, - listDirectory) + listDirectory, readFile) from calculate.desktop._cl_keys import getKey from itertools import * +import glob from calculate.lib.cl_template import templateFunction from calculate.lib.cl_ini_parser import iniParser import hashlib @@ -202,6 +203,23 @@ class VariableClDesktopXfceMixer(ReadonlyVariable): self.Get('cl_desktop_gst_data').get('channels', []))) +class VariableClDesktopXfcePointers(ReadonlyVariable): + """ + Список устройств-указателей для xfce + """ + type = "list" + + def get(self): + def generate(): + for name_fn in sorted( + glob.glob("/sys/class/input/mouse*/device/name")): + data = readFile(name_fn) + if data: + yield data.strip().replace(" ", "_") + + return list(generate()) + + class VariableClDesktopOnlineData(ReadonlyTableVariable, DomainInfoHelper): """ Information about online users