Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I wrote a script which greps through the output of synclient to determine whether a laptop's touchpad has miraculously turned itself off (Ubuntu seems to /love/ doing this recently) and, if so, turns it back on.

The script is something like this:

#!/bin/bash
while true ; do
    if [ `synclient | grep -e"TouchpadOff[\s]*1" | wc -l` -ge 1 ] ; then
        synclient TouchpadOff=0
    fi
    sleep(3)
done

(I don't have the laptop to hand right now but you get the point! I will update later when I'm at my laptop if that's incorrect)

So I tried running this as an upstart script so my touchpad can heal itself without any interaction. But it seems synclient doesn't find the current user's X session when my script is upstart'ed.

I tried running it by using something like su -c myscript.sh ledneb in my script stanza, but to no avail.

Should I be looking in the direction of /etc/X11/xinit/xinitrc rather than upstart?

Is there a proper way to have this script run in the context of the current (or even a hard-coded) user's x session?

share|improve this question

1 Answer 1

You can do what you are asking...

... but I'm not sure this is the right approach. If you have not already done so, please consider reporting the issue in Ubuntu so it can be fixed as the behaviour you describe sounds like a bug.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.