-
Notifications
You must be signed in to change notification settings - Fork 1
/
modem.lisp
35 lines (28 loc) · 1.07 KB
/
modem.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(in-package :stumpwm)
(ql:quickload :dbus)
#|
(dbus::get-property bus
"org.freedesktop.ModemManager1"
"/org/freedesktop/ModemManager1/Modem/6"
"org.freedesktop.ModemManager1.Modem"
"SignalQuality"
)
(dbus::with-introspected-object (modem bus "/org/freedesktop/ModemManager1/Modem/6" "org.freedesktop.ModemManager1")
(modem "org.freedesktop.ModemManager1" "Modem"))
|#
(defun get-dbus-modem-property (property)
(dbus::with-open-bus (bus (dbus::system-server-addresses))
(dbus::get-property bus
"org.freedesktop.ModemManager1"
"/org/freedesktop/ModemManager1/Modem/6"
"org.freedesktop.ModemManager1.Modem"
property)))
(defun get-modem-signal-percent ()
(car
(get-dbus-modem-property "SignalQuality")))
(defun get-modem-phone-number ()
(car
(get-dbus-modem-property "OwnNumbers")))
(defun get-modem-state ()
(car
(get-dbus-modem-property "State")))