Basically, what I want to do is lock my KDE session as you do normally via the menu or with Ctrl-Alt-L. However, I want it to run a script before and after the unlocking (So I can pause and resume Amarok etc.). At the moment I have a script which launches kdesktop_lock as well as the other stuff, but I want to make it so I can just use the normal KDE Lock Session buttons. Is there a way of doing this?

Thanks