Browse Source

Add xinput short list

In this commit module `xutil` is added which will contain utility
functions relatd to xorg (e.g. xinput, xrandr and ...).

modules and classes inside xutil are wrappers around those binaries.
pull/2/head
Ali Hatami Tajik 2 years ago
parent
commit
29867682ef
  1. 10
      src/scripts/python/xutil/common.py

10
src/scripts/python/xutil/common.py

@ -0,0 +1,10 @@
import subprocess
ENCODING = 'utf-8'
def get_list_short():
"""Returns string output of the `xinput --list --short` command encoded as
UTF-8"""
completed = subprocess.run(
['xinput', '--list', '--short'], capture_output=True)
return completed.stdout.decode(ENCODING)
Loading…
Cancel
Save