Skip to content

Commit

Permalink
Added exit option #15
Browse files Browse the repository at this point in the history
  • Loading branch information
GulsahKose committed Jan 9, 2015
1 parent c205303 commit 84bbd3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions exit_click
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ps aux | grep p.py | sed 's/\s\+/ /g' | cut -d' ' -f2 | xargs kill
ps aux | grep soffice | sed 's/\s\+/ /g' | cut -d' ' -f2 | xargs kill -2
8 changes: 6 additions & 2 deletions libpebble/p.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def cmd_remote(pebble, args):
pebble.set_nowplaying_metadata(_("LibreOffice Remote Control "), _("Next"), _("Previous"))

try:
pexpect.run(runodp, timeout=5)
pexpect.run(runodp)
window_id = pexpect.run("xdotool search --sync --onlyvisible --class \"libreoffice\"")
fullscreen = "xdotool key --window " +window_id+" F5"
pexpect.run(fullscreen)
Expand All @@ -28,16 +28,20 @@ def cmd_remote(pebble, args):
def libreoffice_event_handler(event):
right_click = "xdotool key --window "+ window_id + "Right"
left_click = "xdotool key --window "+ window_id + "Left"
exit_click= "bash /usr/lib/python2.7/pebble/exit_click"

if event == "next":
pexpect.run(right_click)

if event == "previous":
pexpect.run(left_click)

if event == "exit":
pexpect.run(exit_click)

def music_control_handler(endpoint, resp):
events = {
"PLAYPAUSE": "playpause",
"PLAYPAUSE": "exit",
"PREVIOUS": "previous",
"NEXT": "next"
}
Expand Down

0 comments on commit 84bbd3f

Please sign in to comment.