My problem is the same of this question but I am not able to get it working in ubuntu 17.10:
I want to run a script that changes my keyboard RGB configuration at screen locks. The script runs flawless. The problem is to get the event of the locking/unlocking. I have try using dbus-monitor as said in that question and as said here:
So running this script:
#!/bin/bash dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" | \ ( while true do read X if echo $X | grep "boolean true" &> /dev/null; then echo "locking at $(date)" >> $HOME/time_xprofile elif echo $X | grep "boolean false" &> /dev/null; then echo "unlocking at $(date)" >> $HOME/time_xprofile fi done )
But it only works... a few times(!).... I cannot understand what happens.
I'm using ubuntu 17.10 with ubuntu's gnome over X-server (no Wayland) and have try vanilla gnome and have the same problem.
I have try too:
dbus-monitor > out.log
To see ALL the traces that occur while locking/unlocking and it doesn't appear that signal... Only.... well... very few times...
I don't know what to do know, Any advice will be helpfull.