Edit power button 'ask' menu?

Forum rules
Before you post please read how to get help
Post Reply
anderson
Level 1
Level 1
Posts: 11
Joined: Wed Jun 19, 2019 12:02 am

Edit power button 'ask' menu?

Post by anderson » Fri Jul 19, 2019 11:06 pm

I am curious if it's possible to edit the menu which appears when you have the power button event set to 'ask'?

I have a convertible laptop, and there are times when the keyboard is disabled but common scripts need to be run. I would like to add these to the menu which appears when the power button is pressed, so that I may re-enable the keyboard, or rotate the screen, for example, from the convenient overlaid menu, rather than a tray button or tray menu.

It is not necessary that the existing menu options remain, e.g. if it is possible to set 'do nothing', and then set a newly created menu to appear when this button is pressed, that would be acceptable as well, but I am not experienced enough to figure it out.

Any guidance or advice? It is possible I am going about this completely wrong as well :D

gm10
Level 18
Level 18
Posts: 8706
Joined: Thu Jun 21, 2018 5:11 pm

Re: Edit power button 'ask' menu?

Post by gm10 » Fri Jul 19, 2019 11:11 pm

Why not just add them to the regular menu?
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

anderson
Level 1
Level 1
Posts: 11
Joined: Wed Jun 19, 2019 12:02 am

Re: Edit power button 'ask' menu?

Post by anderson » Sat Jul 20, 2019 12:26 am

I'd rather have a physical button I can press to bring up an overlay menu to control the convertible. Unfortunately the only physical buttons I have are the power button and the volume buttons, and my volume buttons need to be used for volume.

It is too clunky for me to move the cursor over the menu bar to bring it up, then click on the menu, then click on the button.

Crippled

Re: Edit power button 'ask' menu?

Post by Crippled » Sat Jul 20, 2019 7:05 am

You can try adding keyboard shortcuts by going into, Settings > Keyboard > select the Application Shortcuts tab and then Add and follow what it tells you from there.

gm10
Level 18
Level 18
Posts: 8706
Joined: Thu Jun 21, 2018 5:11 pm

Re: Edit power button 'ask' menu?

Post by gm10 » Sat Jul 20, 2019 7:45 am

anderson wrote:
Sat Jul 20, 2019 12:26 am
I'd rather have a physical button I can press to bring up an overlay menu to control the convertible. Unfortunately the only physical buttons I have are the power button and the volume buttons, and my volume buttons need to be used for volume.

It is too clunky for me to move the cursor over the menu bar to bring it up, then click on the menu, then click on the button.
Ok, weird situation. The answer is that you cannot easily do this, you would have to modify the source code of your desktop environment's logout/shutdown dialog and add your option, but if that is within your capabilities then you can certainly do that, it's all open source after all. But the existing options cannot easily be redirected for they are dbus calls to systemd, i.e. inter-process communication.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

anderson
Level 1
Level 1
Posts: 11
Joined: Wed Jun 19, 2019 12:02 am

Re: Edit power button 'ask' menu?

Post by anderson » Sat Jul 20, 2019 5:36 pm

I may have managed to do it just by setting acpi_listen to run all the time, and watching for PBTN, this is not the best solution obviously.

Post Reply

Return to “Xfce”