I use a Raspberry Pi as TV. I want to login to PIXEL if keyboard or mouse are connected and login to Kodi if keyboard or mouse are not connected and the Raspberry is connected to TV. I want to login to Pixel if connected remotely. How can I config raspberry?
I find that I can write a Bash script in
~/xsession to specify what session to be loaded but how can I detect status of keyboard, mouse or TV connection?