How to start/stop motion on screen lock/unlock?

1

I installed motion in Fedora 17, and I want it to start when I lock the screen with control + alt + l, and stop when I unlock it.

I found this to run/stop a script on screen lock: https://unix.stackexchange.com/questions/28181/run-script-on-screen-lock-unlock/28183#28183

The problem is that motion requires that I use sudo, eg: $ sudo service motion start

How can I get around this?

ChocoDeveloper

Posted 2013-06-30T21:54:52.540

Reputation: 2 327

Answers

2

You can run it with the option -n. motion -n runs it in non-deamon-mode, so u don't need to start a service.

If its still not working try adding your user to the video group. Maybe you dont have permission to use the videodevice.

Hope I could help you.

Johnny

Posted 2013-06-30T21:54:52.540

Reputation: 21