Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scripts-perso
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Daniel Stan
scripts-perso
Commits
4bcb8fe9
Commit
4bcb8fe9
authored
Feb 22, 2016
by
Daniel STAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gruik locking
parent
06412991
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
remote.py
remote.py
+10
-0
No files found.
remote.py
View file @
4bcb8fe9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment