How can I show a message before shutting down on Pika OS?
Asked by
scanDPI_600
I'm using Pika OS, which is Debian-based, and I'd like to display a short message such as "Turn 'em off" immediately before the computer shuts down. The exact format doesn't matterโI just want the message to appear briefly before shutdown begins.
Answers
You can broadcast a message to logged-in terminals with `wall "Turn 'em off"`, then shut down afterward. For example: `wall "Turn 'em off"; sleep 2; sudo shutdown -h now`. The message will appear in active terminal sessions before the system powers off.
Reply to this answer
If you want the message to be more visible, you could trigger a screen locker or fullscreen notification first, wait a couple of seconds, and then run the shutdown command. Just be careful when replacing or aliasing the shutdown command so you donโt accidentally create a recursive alias.
Reply to this answer
The `shutdown` command can also schedule a shutdown and announce it to logged-in users. Check `man shutdown` for the available options on your version of Pika OS, including how to set a delay and broadcast a warning message.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions