Sunday, July 16, 2017

send key to vlc

***vlc-sendkey ***
#!/usr/bin/python
import os
import sys

inputkey = " " +sys.argv[1]

getactid = os.popen("xdotool getactivewindow").read()

winIda = getactid.strip()

getvlcid = os.popen("xdotool search --name 'VLC media player' | head -n 1").read()
vlcid = getvlcid.strip()

print vlcid
os.system("xdotool key -window " + vlcid  + inputkey)

#os.system("xdotool windowactivate " + winIda)




****

## fullscreen
$ ./vlc-sendkey f

## next
$ ./vlc-sendkey n


## mute
$ ./vlc-sendkeym

## execute from ssh
$ DISPLAY=:1 myutil/vlc-next.py n

No comments:

Post a Comment