This is my approach to playing videos on a Kodi powered TV from a computer. It takes a url as an argument or from the copy buffer and attempts to play it in Kodi via its API. After enabling the (webserver) in Kodi, you will need to change the 'HOST' and 'AUTH' variables in send-to-kodi.sh
. Wayland users might need to set XDG_SESSION_TYPE=wayland
environment variable.
$ /path/to/send-to-kodi.sh https://www.youtube.com/watch?v=OfIQW6s1-ew
or via URL in copy buffer
$ /path/to/send-to-kodi.sh
Via URL in copy buffer and keybinding with this configuration.
bindsym $mod+x exec "/path/to/send-to-kodi.sh"
Using 'X' hint with this configuration.
config.bind('X', 'hint links spawn /path/to/send-to-kodi.sh {hint-url}')
Using tuir's viewing media links feature with this configuration in the mailcap file.
video/*; /path/to/send-to-kodi.sh '%s' ; test=test -n "$DISPLAY"