Last active
September 7, 2018 14:36
-
-
Save shizeeg/7f40ad3623f12c98b3e0 to your computer and use it in GitHub Desktop.
Send any text to Kodi/XBMC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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