I am writing a program to remind extract the pendrive before shutdown. This program locks shutdown if pendrive is connected, and unlock it if pendrive is disconnected.
For do this, I use a polkit authority file (.pkla), which is copied when pendrive is connected, and removed after pendrive is disconnected
I use polkit 0.105, that don't allows set javascript rules
[Shutdown]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.stop;org.freedesktop.login1.power-off;org.freedesktop.login1.power-off-multiple-sessions;org.xfce.session.xfsm- shutdown-helper
ResultAny=no
ResultInactive=yes
ResultActive=no
With this, I got that shutdown is locked. But now I want to, furthermore to lock shutdown, the system shows a notification when user press shutdown button (which call any of this polkit actions)
How can I do it?
BTW, the notification don't needs been called by polkit. If there is any form to show the notification when user press shutdown button, although don't use polkit, it's good