Python code or install curl. You can use the OpenWebif AJAX API over HTTP. I don't think there are any API calls to control PIP directly, so you may have to resort to sending key press commands to simulate remote control.
Alternatively, you could try to inject the correct key codes into the Linux input event system. For a really dirty hack, you could just craft a binary file with the right input events and then use dd to inject them. For a more high level approach, something like python-evdev might be useful.
As a proof of concept, I started capturing the events from /dev/input/event1 into a file, pressed the required keys to simulate a macro and stopped the capture. Then I injected these events back into /dev/input/event1 and sure enough, got the expected results.
Code: Select all
# cat /dev/input/event1 >key_capture
# cat key_capture >/dev/input/event1