-
I have a script that displays the current month's calendar and I'd like to add the ability to display previous, next, or back to today within the notification. The script works great, I'm just not sure how to format the options displayed in the context menu. For simplicity's sake, if I use the following command: $ dunstify -t 0 --action="yes,OK" --action="no,Cancel" "Important" "Do you agree?" Right clicking the notification (I believe middle click is the default for do_action but I've changed this in dunstrc) gives me a rofi context menu with two options that look like this:
Either "yes" or "no" is returned to stdout, which is exactly as it should be. The context menu is opened on a right click and I'm using rofi. From dunstrc:
My only question really is, is there any way to format the options sent to the rofi context menu so its just two options reading "OK" and "Cancel" (or ideally a nerd font icon)? EDIT: I should mention I'm using dunst 1.10.0 (waiting for FreeBSD pkg to update to 1.12.2). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Right now it works this way to correctly identify which actions are clicked. But maybe we can introduce some format string for actions. Nonetheless I think the job of hiding the action real name (as opposed to its message/title) should be done by the dmenu program. I think there is a patch for dmenu that hides text after a delimiter. Probably rofi has something similar. While we think about action formatting maybe you can hide after a '[' |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your answer. As I looked into it more and more I kinda figured this was the case, as it also happens when using notify-send in place of dunstify. I ended up going a different route where I don't use --action at all in the script, and instead call rofi directly. The notification only opens when I click on the date displayed in my menu bar. After 0.1 seconds rofi is called, the menu is created over the top of the date location in the menu bar, and we're off to the races. I do very much appreciate your response. Thank you. On another note, this seems like an ideal use case for Clickable buttons for actions?, but I do understand this is pretty low on the priority list. |
Beta Was this translation helpful? Give feedback.
Right now it works this way to correctly identify which actions are clicked. But maybe we can introduce some format string for actions. Nonetheless I think the job of hiding the action real name (as opposed to its message/title) should be done by the dmenu program. I think there is a patch for dmenu that hides text after a delimiter. Probably rofi has something similar.
While we think about action formatting maybe you can hide after a '['