Found this, which was made by Ubuntu Forums user opus1. Maybe it can help.
This is what the post gives as a solution:
For anyone interested, here's what I did: I looked at the logs
(specifically /var/logs/auth.log) and saw that an entry is made when
ever the password is checked and accepted. My log said:
Aug 7 14:10:57 mumble gnome-screensaver-dialog: gkr-pam: unlocked login keyring
Ultimately I found an application called "Swatch" which monitors a log
for you and will run a script when a string that you specify appears
in that log. Swatch requires a config file (.swatchrc), and mine looks
watchfor /unlocked login keyring/
where "/unlocked login keyring/" is the string to look for and "exec"
defines the script to run when it is found. My wakeServer script looks
#wake the server
#record info in the log file
myVar="woke server at login:"
where "AA:BB:CC:DD:EE:FF" is the MAC address of my server.
Swatch will need to be entered as a start-up application (create an
entry in System | Preferences | Startup applications called
"runSwatch" and make the command "swatch --tail-file /var/log/auth.log
--daemon". (In Debian, only root can read logs So the start up command needs to be prefaced with "sudo" and swatch will need to be added to
the sudoers file without a password. In Ubuntu it appears non-root
users can read logs. There could be a security issue with granting
password-less access to swatch, but in my case it seems acceptable).
So far it has worked perfectly!