Artificial intelligent assistant

How to create a daemon which would be listening to dbus and fire script on message I want to create a daemon, which would fire up a shell script in the background every time I unlock the screen on my ubuntu. I managed to create such script according to answer to related question: run-script-on-screen-lock-unlock. And it works well in terminal window. But now I want to create a daemon from that and I didn't get any luck yet. Any suggestions?

Based on <


#!/bin/bash

interface=org.gnome.ScreenSaver
member=ActiveChanged

dbus-monitor --profile "interface='$interface',member='$member'" |
while read -r line; do
echo $line | grep ActiveChanged && your_script_goes_here
done


Just stick that in **/etc/init.d/monitor-for-unlock** , make it executable, and then make a soft link in rc2.d


chmod +x /etc/init.d/monitor-for-unlock
cd /etc/rc2.d
ln -s /etc/init.d/monitor-for-unlock .

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 0c4d3a1711fb11c74e2d815091647d2d