obmenu-generator icon indicating copy to clipboard operation
obmenu-generator copied to clipboard

Feature request: support prompts for actions

Open montagdude opened this issue 5 years ago • 2 comments

Openbox actions can have a prompt specified, which brings up a dialog box displaying the message with a Yes/No button. I use prompts for shutdown, restart, and suspend actions, for example. Currently, I have to add these prompts in manually after generating the menu. It would be nice if prompts could be put in schema.pl instead as an optional 4th argument for an item. The syntax for the prompt in menu.xml is:

<item ...><action ...><command>...</command><prompt>Message text</prompt></action><item>

montagdude avatar Jul 21 '18 19:07 montagdude

For now, items with actions can be added by using the raw entry:

our $SCHEMA = [
    # ...
    {raw => q(<item ...><action ...><command>...</command><prompt>Message text</prompt></action<item>)},
    # ...
]

trizen avatar Jul 21 '18 22:07 trizen

Thanks for the suggestion. I didn't know about the raw entry. It's a decent workaround, except that if you use icons, with this method you have to hardcode the icon path and manually update it if you change the icon theme. (Unless I'm missing something.)

montagdude avatar Jul 22 '18 02:07 montagdude