When the Centos will Shutdwon, reboot or logoff , I want to pop a Message Window.
I made the window by gtk, then how can i do?
Please forgive me my lousy English. :-(
You will need to write your program as a daemon, and use DBus to monitor signals from logind. Take a look at the PrepareForShutdown
and PrepareForSleep
signals; probably also one or more of the UserRemoved
, SessionRemoved
, SeatRemoved
signals.
In order to pop up your dialog you will also need to set an inhibitor so that the system cannot shut down until your dialog box has been dismissed.
If you want to interrupt logging off or switching users, you will also need to set an inhibitor on org.gnome.SessionManager
.