Does anyone know how I can make a confirmation dialog pop up from bash (with the result then used in the bash script)?
I tried zenity and xdialog and gdialog but none of them are present in dom0 and I don’t want to install any additional software in dom0 just for this…somehow dialogs do work since they will pop up for qrexec stuff…but in my use case I don’t need to have a VM request this, I’m just triggering a script with a key combination in dom0 and I want the dialog to have a custom title and text.
S/he shouldn’t have to install zenity; clearly there’s some other, already-installed way to produce a dialog. So a reasonable question to ask is: “what is it?”
Unfortunately, notify-send does not yet support the “-A” option in its version in Fedora 32 (dom0 of Qubes 4.1). In Fedora 38 it does, and I hope in Fedora 37 (dom0 of Qubes 4.2) as well, so I could implement this with notify-send if that is the case but I’m not yet ready to upgrade.
Whiptail is also interesting, but doesn’t work in my use case.
If anyone has any other ideas or knows how qrexec does it, let me know…if there are no more answers and if I find, once I upgrade to Q4.2, that actions in notify-send work there, I will mark that as the correct answer.
I should have been more precise: I’m looking to use a confirmation dialog in the sense that I want to not only display some info, but also give (as the human looking at the info) a response (yes/no) and then use that response in the further workings of the script.
With notify-send this could work, but only if actions (option -A) are available, which is not the case with the version in Fedora 32.
Ashes on my head, I didn’t realize what you did there!
Very good idea and it works! I’ll have to think about the security implications of passing io back to dom0, but it’s a possible workaround until I upgrade, thank you!
Should anyone have another solution that can be executed only in dom0 of Q4.1 without making use of another VM, feel free to post!
On fedora 37 dom0, the hint "{'urgency': <2>}" was not necessary as the notification doesn’t disappear.
But in a standalone fedora 32, the notification disappear after some seconds (without signal emitted).
The notification also disappear if you mouse hover the notif and mouse out of the notification (still without signal emitted).
I guess the expire_timeout of 0 is not honored by the server.
Setting the urgency to critical solved this problem, the notification will not disappear until you click on an action (ActionInvoked signal) or on the notification itself (NotificationClosed signal).
Its working fine on the standalone fedora 32 and on dom0 fedora 37.
Notice than my standalone fedora 32 is not updated, it could work better on dom0 f32.