Now I’m thinking how can I turn off the PC off programmatically at the click of a button?

The default MATE desktop environment has an entry "Shut Down..." at the bottom of the main menu and you can add a button doing the same on any panel. What desktop environment do you use?

Reply via email to