← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #186796]: Send signal from user to root (time to RUN a script)

 

Question #186796 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/186796

    Status: Open => Answered

RaiMan proposed the following answer:
Looks very sophisticated ;-)

Seems to be on some Linux.

I guess, you want to block the mouse usage, while Sikuli script is
running. Right?

But you do not want the user script to run with root privileges. Right?

So you have to have a process running as root, that is able, to switch
the mouse on and of on request. And you want this to be triggered from a
user script that runs in the normal user context.

You could do this using XML-RPC, which is available in a basic manner in
Python/Jython/Sikuli script (SimpleXML-RPC).

Set up a server, running as root. This contains sikuli scripts, that use
os.popen, to run your switch-on/off shell scripts.

On the user side set up a shell script that contains:
sikuli-ide.sh -r mouse-off.sikuli
sikuli-ide.sh -r userscript.sikuli # might be a parameter
sikuli-ide.sh -r mouse-on.sikuli

The sikuli scripts mouse-on and mouse-off are XML-RPC clients, that send
the respective requests to the server.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.