On my notebook in the dash (above the keyboard) there is physical button for turning the computer on and off.
How to set up this button to turn off the system immediately without confirmation? Where is the handler for this button? Or how to create it and use? I want to put to it systemctl poweroff
.
There is the similar question - Disable shutdown confirmation ubuntu 20.04 but it is not only about setting up the physical "Power off" button. For configuring Shutdown
/Reboot
menu items in system menu Bring Out Sub Menu Extension
can be used as explained here.
Moreover the accepted answer in this question is not working - I tried it. Also this answer explains that the solution must be another.
Please do not suggest to me:
- To press to the button and wait a minute.
- To make keyboard shortcut.
I have "Power button" and I want to make use of it. Or at least to know that this is impossible in Ubuntu 20.04.