How can I make a daemon that detects mouse and keyboard activity in a chroot and resets the screen blanking timer of the parent OS?

view full story

http://unix.stackexchange.com – This is a couple of quite specific system programming questions. I am inexperienced in practical modern system programming, and I hope that someone who knows about that can guide me, to avoid that I wander in stupid beginner mistakes. But before I ask my questions, I explain some background. I guess it's better if you only read the whole story if you need more info; so now you should just skip to the questions (in bold, at the bottom) first. The background, in short, is that I am running Archlinux in a chroot alongside Chrome OS on a chromebook. The original project is there, my fork of it is (HowTos)