Archive:Xbev: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>NedBot
m (Robot: Cosmetic changes)
m (Bot: Automated text replacement (-class="wikitable" +class="prettytable" & -Available Tags +Available tags & -<source +<syntaxhighlight & -</source> +</syntaxhighlight>))
Line 21: Line 21:
== Pretty pictures with text ==
== Pretty pictures with text ==


{| class="wikitable"
{| class="prettytable"
| When starting xbev without arguments, it will wait for XBMC to start.
| When starting xbev without arguments, it will wait for XBMC to start.
| When XBMC starts (or is already running), xbev will connect to XBMC's eventserver and JSON-RPC server.
| When XBMC starts (or is already running), xbev will connect to XBMC's eventserver and JSON-RPC server.

Revision as of 06:15, 14 March 2014

xbev is a simple eventclient for XBMC, written in Python, it creates a window on the desktop using gtk and sends any keypresses received on that window to XBMC's eventserver.
It can be downloaded from https://github.com/bobo1on1/xbev (click the zip button if you don't have git or don't know how to use it).


It also uses the JSON-RPC api to show a text input box when XBMC sends Input.OnInputRequested, the text entered there will be sent to XBMC using Input.SendText, this can be used to enter text in xbmc when needed. The entered text will be sent to XBMC immediately, when you press enter xbev will set the "done" parameter to true indicating that this is the final text. When the text input is active, xbev will not send any keypresses to XBMC except the escape key to abort the text input. This feature is only supported in XBMC Frodo and higher.


usage: xbev [HOST]


If xbev is started without arguments, it will automatically try to detect the ip address using zeroconf.

Known issues

  • A blocking socket is used from the main thread for JSON-RPC, if any operation on the socket blocks (for example the connect takes a long time), then xbev will be frozen until the call returns.
  • xbev assumes that the entire Input.OnInputRequested and Input.OnInputFinished JSON messages are fully read in one recv call (I know it's retarded, but I'm new to python).

Pretty pictures with text

When starting xbev without arguments, it will wait for XBMC to start. When XBMC starts (or is already running), xbev will connect to XBMC's eventserver and JSON-RPC server. If xbev can't connect to the JSON-RPC socket, it will show an error message. If XBMC sends a Input.OnInputRequested message to xbev, xbev will show a text entry.
Xbev-waiting.png Xbev-connected.png Xbev-error.png Xbev-textinput.png

Running xbev on windows (thanks to ParkerR_)

Download and install python 2.7 from http://python.org/download/ (I have no idea if it works with python 3.3, but there's no PyGTK package for it at the time of writing).


Add the path where you installed it to the PATH variable (default C:\Python27)

  1. Right click Computer
  2. Click Properties
  3. On the left hand side click Advanced system settings
  4. Then towards the bottom of that windows click Environment Variables...
  5. Scroll down in System variables until you see Path
  6. Add in the path to Python27 at the end. (Would be ;C:\Python27

Download and install the PyGTK all-in-one installer for python 2.7 from http://pygtk.org/downloads.html


Next open a command prompt and cd to the directory where xbev is. Run python xbev and the XBMC IP address (ex python xbev 192.168.1.128)