0

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.

Azarilh
  • 121
  • 1
  • 8

3 Answers3

1

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.

Caleb McKay
  • 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
0

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/

simryang
  • 1
  • 3
0

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.