/kontrol

Yet another remote control for Kodi

Primary LanguagePythonThe UnlicenseUnlicense

Kontrol

Simple remote for Kodi.

Kontrol requires kodipydent

pip3 install --user kodipydent

And probably Python 3.7 or 3.8+, whichever supports type hints.

Currently TV Show selection isnt implemented for Rofi.

Usage

Usage: kontrol <command>
up|down|right|left : move selection in given direction
enter  : "select" current selection
back   : just back.
-<int>  : decrease volume
+<int>  : increase volume
mute  : mute
play  : play or pause
stop  : stop playback
movies  : if ROFI, play movies via rofi, else print JSON from kodi
shows   : TODO
text : run tk dialog for sending text

Options

HOST = "192.168.1.2"
PORT = 8080
USERNAME = "kodi"
PASSWORD = "pass"
ROFI = True  # use rofi
NOTIFY = True  # send notification via notify-send

Rofi

Kontrol supports Rofi for selecting and playing media.

Set ROFI=True in kontrol

Notifications

Notifications are optional via NOTIFY=True, it requires notify-send to be available. Notifications can get a bit spammy.

i3wm and sway example

mode "kodi" {
        set $kontrol exec --no-startup-id /path/to/kontrol
        bindsym $mod+d $kontrol movies
        #bindsym $mod+Shift+d $kontrol shows
        bindsym j $kontrol left
        bindsym k $kontrol down
        bindsym l $kontrol up
        bindsym semicolon $kontrol right
        bindsym Left $kontrol left
        bindsym Down $kontrol down
        bindsym Up $kontrol up
        bindsym Right $kontrol right
        bindsym Backspace $kontrol back
        bindsym Return $kontrol enter
        
        # audio
        bindsym XF86AudioRaiseVolume $kontrol +10
        bindsym XF86AudioLowerVolume $kontrol -10
        bindsym XF86AudioMute $kontrol mute
        
        bindsym Escape mode "default
        bindsym $mod+o mode "default"
}

bindsym $mod+o mode "kodi"