This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kdialog questions

Tags: notify-send, desktop, notifications notify-send, desktop, notifications notify-send, desktop, notifications
(comma "," separated)
User avatar
xxmlud
Registered Member
Posts
11
Karma
0
OS

Kdialog questions

Mon Aug 22, 2022 6:38 pm
Hello,

I want to launch a notification on my screen when the script that I leave in the dispatcher.d directory, which is related to the Network Manager, is executed.

But I can't get this notification to show on my screen.

I have tried to test with the "cron" service but without success. Any help?
I have searched for information in "https://develop.kde.org/deploy/kdialog/" but I have not found anything significant.

Regards
User avatar
chiefbromden
Registered Member
Posts
39
Karma
0
OS

Re: Kdialog questions

Thu Aug 25, 2022 9:32 pm
I didn't know about Kdialog, so I got curious. I tried this:
Code: Select all
kdialog --title "Notify me" --passivepopup "Waiting 5 sec" 5

and this:
Code: Select all
notify-send "Notify me"

and both works. This thread also mentions Inotifywait but I didn't try.

Then, I tried to test it on my wifi following Listing 2 of this guide, changing the UUID, removing the mount lines and adding kdialog. It didn't worked. I don't have more knowledge to make more testing on the network, but I hope this info helps you in some way.

Thanks for the tip, sometimes i write some little scripts and it would be helpful to implement this when I left one running on the background.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Kdialog questions

Fri Aug 26, 2022 8:17 am
Hi!
xxmlud wrote:But I can't get this notification to show on my screen.

Network scripts usually run as root and root does not have knowledge of your display. NM-Dispatcher scripts also have a special environment set up and uses DBus, so you may just have to listen on a signal or use notify-send looping over all logged in users. An (XServer) example can be found at jryan128/notify-send-all.bash.
I cannot check the exact methods as I am not running NM.

I have tried to test with the "cron" service but without success. Any help?

Why cron? Ubuntu uses systemd for years now, so you should use a systemd-timer-unit. What exactly are you tring to do?
User avatar
xxmlud
Registered Member
Posts
11
Karma
0
OS

Re: Kdialog questions

Tue Aug 30, 2022 6:58 am
Hello,

Thank you for replying to both of you.

Next week I will test "notify-send-all.bash" and give you feedback.

Thanks for the reply to both of you.

Regards
User avatar
xxmlud
Registered Member
Posts
11
Karma
0
OS

Re: Kdialog questions

Fri Sep 09, 2022 8:25 pm
Hello,

Sorry for the delay in replying, today after trying I managed to do it this way:

Code: Select all
# sudo -u X_user DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/X_userid/bus notify-send 'Hello world!' 'This is an example notification.'


I got the help from the web site "https://wiki.archlinux.org/title/Desktop_notifications".

Thanks anyway


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]