1

我正在尝试监视 ACPI 事件,以检测ThinkPad S1 Yoga上的屏幕何时折叠(将笔记本电脑变成平板电脑)。我正在查看的是以下内容,这表明屏幕位置已被切换:

sudo acpi_listen
ibm/hotkey HKEY 00000080 000060c0

我对此很陌生,但是按照在线说明代码,我正在尝试使用模块socket监视 Python 中的 ACPI 事件,但我遇到了困难:

>>> import socket
>>> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
>>> s.connect("/var/run/acpid.socket")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 111] Connection refused

我会很感激一些指导。谢谢!

4

0 回答 0