Commit 4bcb8fe9 authored by Daniel STAN's avatar Daniel STAN

gruik locking

parent 06412991
......@@ -6,6 +6,7 @@ import requests
import collections
import select
import sys
import time
SERIALPORT = "/dev/ttyUSB0"
BAUDRATE = 9600
......@@ -31,6 +32,12 @@ proxy = bus.get_object('org.mpris.MediaPlayer2.spotify', '/org/mpris/MediaPlayer
#proxy = bus.get_object('org.mpris.MediaPlayer2.vlc', '/org/mpris/MediaPlayer2')
spotify = dbus.Interface(proxy, dbus_interface='org.mpris.MediaPlayer2.Player')
bus = dbus.SessionBus()
proxy = bus.get_object('org.gnome.ScreenSaver', '/org/gnome/ScreenSaver')
ss = dbus.Interface(proxy, dbus_interface='org.gnome.ScreenSaver')
#ss.Lock()
# Volume control
def volume(p):
call(["amixer", "-D", "pulse", "sset", "Master", p])
......@@ -44,6 +51,9 @@ def light(p):
_states[p] = not _states[p]
def process_line(response):
if response.startswith('Unkwon: 4294967295'):
ss.Lock()
return
if response.startswith(CONTROL):
key = response[len(CONTROL):].strip().lower()
print key
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment