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.
- 121
- 1
- 8
-
theres dunstify – lnee Sep 20 '22 at 16:15
-
@lnee thank you for writing that commit – lnee Dec 05 '22 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.
- 704
- 5
- 7
-
I want a classic notification, not a dialog popup, it gets on the way. – Azarilh Dec 02 '21 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. – Caleb McKay Dec 02 '21 at 17:20
-
Ye, the standard Plasma notification is what i want. So i'm asking too much? – Azarilh Dec 02 '21 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/
- 1
- 3
-
OP is using Plasma, not Gnome, so kdialog would be more appropriate. – Caleb McKay Dec 02 '21 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? – simryang Dec 07 '21 at 07: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.
- 170
- 11