Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@shizeeg
Last active September 7, 2018 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shizeeg/7f40ad3623f12c98b3e0 to your computer and use it in GitHub Desktop.
Save shizeeg/7f40ad3623f12c98b3e0 to your computer and use it in GitHub Desktop.
Send any text to Kodi/XBMC
#!/bin/sh
# check if `xdotool` installed
if [[ ! -x $(which xdotool) ]];then
echo
echo "Install 'xdotool' first."
echo "In Arch Linux:"
echo "$ sudo pacman -S xdotool"
echo "or Ubuntu/Debian/etc.:"
echo "$ sudo apt-get install xdotool"
echo
exit -1;
fi
# find Kodi window
KODIWINID=$(xdotool search --class Kodi)
# fawk! No Kodi. Curse & bail out
if [[ $KODIWINID = "" ]];then
echo "Run Kodi! Stupid beotch!"
exit -2;
fi
# no parameters from command line? Read from stdin...
if [[ -z "${1}" ]];then
while read LINE; do
xdotool type --window $KODIWINID "${LINE}"
done
fi
# send 1st command line parameter to Kodi (hopefully) =]
xdotool type --window $KODIWINID "${1}"
@smartiptv
Copy link

Hi,

thanks to share it!

where is the ip address of another Kodi which I need to send it to it?

I mean is this if I want to send message from kodi to kodi?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment