I want a script to send a notification that asks something and i want the notification to have a button.
notify-send
doesn't seem to support this or i can't see the function.
I'm using Plasma.
-
theres dunstify– lneeSep 20, 2022 at 16:15
-
@lnee thank you for writing that commit– lneeDec 5, 2022 at 15:21
3 Answers
Something like in a bash file?...
#! /bin/sh
kdialog --msgbox 'Test Message' Details
Take a look at https://develop.kde.org/deploy/kdialog/ for more options and examples.
-
I want a classic notification, not a dialog popup, it gets on the way.– AzarilhDec 2, 2021 at 14:41
-
Can you give an example of what you mean by "classic notification?" That is a bit vague. You can send notifications using --passivepopup that will show up like standard Plasma notifications. But you aren't going to be able to have buttons on them. That link above gives you numerous examples of what can be done with Plasma's notification system. Dec 2, 2021 at 17:20
-
Ye, the standard Plasma notification is what i want. So i'm asking too much?– AzarilhDec 2, 2021 at 22:40
In my system(ubuntu 20.04 gnome shell 3.36.9) following works.
#/usr/bin/env bash
gdialog --msgbox 'Hi'
gdialog is wrapper of zenity in gnome shell environment. For detailed use, run zenity --help
zenity --info --text='Hi'
equals above gdialog command
Please refer https://help.gnome.org/users/zenity/3.32/
-
OP is using Plasma, not Gnome, so kdialog would be more appropriate. Dec 2, 2021 at 13:45
-
-
@Azarilh notify-send do notification and Caleb McKay 's solution will give dialog with button I can't imagine what you want. Do you have any feagure what you want?– simryangDec 7, 2021 at 7:54
It looks like dunstify
, part of the dunst notification daemon, may do what you want:
dunstify -A yes.ACCEPT -A no,DECLINE "A message"
Dunst is available on Ubuntu, but apparently doesn't integrate very well with Plasma on KDE or Unity. You should still be able to use it though if it integrates well enough for your needs and you manage to install it.
I came acrosss dunstify
on the Arch Wiki when searching for an answer to a similar problem but haven't managed to get it working. You might have more luck.