Kodibuntu: Custom Program on Boot
#1
Hello! I will try to explain what I want and why.
I have kodibuntu installed, I recently updated to Isengard, I love it. My htpc is doing nas work sometimes, like downloading and other stuff so I have been writing a custom script to autoshutdown the system when:
- Downloads are under 50 kb/s (transmission-remote) &
- No connections on some specifics ports (grepping netstat) &
- X have been idle for 15 minutes or more (grepping xprintidle)&
- Kodi it's not running (don't shutdown when I'm watching something)

Imagine I wake my pc from job and add a torrent, it download the file and now the system should shutdown. So I thought I could make a program that launch on boot instead of kodi, a simpel program 1 or 2 buttons to launch kodi easily with a remote, just to prevent kodi run and make my script work.
This is just an idea, may be there is an easy way.

As you can see I check idle time, I don't know how kodi works, If when I'm wathcing a movie there is no idle time then I shouldn't need to check if kodi is runnning and I won't need a custom program.

What do you think? Thanks.
Reply
#2
Ok, I have a bigger problem. It could be done checking idle time in kodi.
But, when I run "xprintidle" (from ssh) and I'm logged on kodi it never gets high times. When I tested the command from desktop enviroment it worked perfectly, but under kodi it doesn't.
I haven't touch anything, the screen is almost black, with dim screensaver, but "xprintidle" always returns low values.

If I could check idle time in kodi then I will not need any custom program or boot.

EDIT:
I think I found a solution on this post: http://forum.kodi.tv/showthread.php?tid=141078
The process now will be:
-ports and other stuff...
-¿kodi running?
-Yes: curl screensaver
-No: xprintidle

I will post my script when ready Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Kodibuntu: Custom Program on Boot0