I want a computer (Debian, XFCE) to shutdown every day at

  1. a specific time as well as
  2. a pop-up window in advance telling about the immanent shutdown with, say OK, Skip and Delay 60 min buttons.

I noticed xmessage being installed and it gives an easy way to handle rudimentary pop-ups with defined buttons. But the workaround with sed on the crontab (to alter the event) and service cron reload (with the appropriate rights in /etc/sudoers) with all the exceptions I have to capture seems too fiddly.

Any ideas?

P.s.: shutdown's own messages are not being read since the users are usually not on the terminal.


I think you should consider a slightly different approach: instead of using cron for a shutdown, use cron to display a message with xmessage.

Then, after the actions (if any) taken from xmessage events (buttons pressed or not), you initiate a shutdown.

In other words:

  • at a certain time, display xmessage via cron
  • if no action is taken (button pressed) after a certain time - shutdown
  • if button is pressed, delay shutdown with whatever time.

I wrote something similar to your needs in this thread.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.