You are not logged in.
I want to be able to edit the notification body, before showing it to screen. For example to replace all URLs with "<URL>".
I didn't find a way to do it so far, so that's why I came her to ask if anyone have an idea how to do it.
I still didn't choose my notification daemon, so I'm opened to any suggestions about different daemons.
Info that might be usefull:
WM : Hyprland 0.50.0
Kernel : Linux 6.15.6
Offline
I severely doubt that this is frequently possible and with the
example to replace all URLs with "<URL>"
also suspect this to be some https://en.wikipedia.org/wiki/XY_problem
Why exactly do you want to edit notifications? And what sends those?
Offline
I severely doubt that this is frequently possible and with the
example to replace all URLs with "<URL>"
also suspect this to be some https://en.wikipedia.org/wiki/XY_problem
Why exactly do you want to edit notifications? And what sends those?
Might be. So I better explain it with example.
My friend sends me a message in discord:
Hey, bro! Check this out https:/youtube.com/sasyfiuegfyjiagdjkadfjkgfesjlaegjlsyftduysarkuafkujhkjafjkuyhdff
And the notification becomes a complete mess because link, because this link occupies almost the whole body and it's hard to read.
So instead of showing full message, I'd like to show:
Hey, bro! Check this out <URL>
It's easy to read and if it'll be possible with scripting I could even keep the domain:
Hey, bro! Check this out <URL:youtube.com>
Last edited by Akamiblade129_7 (2025-07-19 04:07:26)
Offline
My friend sends me a message in discord:
Get better friends, I guess ![]()
(Youtube urls don't have to be that long at all)
dunst is perhaps the most versatile notification daemon and even there my best idea would be to configure a rule that suppresses the actual message and notify-send's / dunstify's a sed-corrected version via a script hook.
But you'd also lose the ability to open the url from the notification.
Offline
(Youtube urls don't have to be that long at all)
It's not always about youtube urls, for example GIFs in discord are sent via tenor.com link and it's usually even longer
dunst is perhaps the most versatile notification daemon and even there my best idea would be to configure a rule that suppresses the actual message and notify-send's / dunstify's a sed-corrected version via a script hook.
But you'd also lose the ability to open the url from the notification.
I've tried it, but icon isn't not showing up and there's no icon_path for some reason.
It's working tho, but I'd like to keep icons still
Last edited by Akamiblade129_7 (2025-07-19 10:23:06)
Offline
I'd like to show:
Hey, bro! Check this out <URL>
Similar to this issue?
• https://github.com/emersion/mako/issues/590
Ah, prolly not quite what you're looking for.
Guessing you want hyperlink previews replacing the textual URLs.
Last edited by tekstryder (2025-07-19 11:12:01)
Offline
https://man.archlinux.org/man/dunst.5.en#SCRIPTING you sould have access to the $DUNST_ICON_PATH and utilize that w/ your subsequent dunstify?
Offline
https://man.archlinux.org/man/dunst.5.en#SCRIPTING you sould have access to the $DUNST_ICON_PATH and utilize that w/ your subsequent dunstify?
It's empty for some reason. I don't know why. Even in the history
{
"body" : {
"type" : "s",
"data" : "Ну как, желаете сегодня поболтать?"
},
"message" : {
"type" : "s",
"data" : "discord\n<b>Norf</b>\nНу как, желаете сегодня поболтать?"
},
"summary" : {
"type" : "s",
"data" : "Norf"
},
"appname" : {
"type" : "s",
"data" : "discord"
},
"category" : {
"type" : "s",
"data" : ""
},
"default_action_name" : {
"type" : "s",
"data" : "default"
},
"icon_path" : {
"type" : "s",
"data" : ""
},
"id" : {
"type" : "i",
"data" : 1303
},
"timestamp" : {
"type" : "x",
"data" : 29659920934
},
"timeout" : {
"type" : "x",
"data" : 5000000
},
"progress" : {
"type" : "i",
"data" : -1
},
"urgency" : {
"type" : "s",
"data" : "NORMAL"
},
"stack_tag" : {
"type" : "s",
"data" : ""
},
"urls" : {
"type" : "s",
"data" : ""
}
},Even tho there IS an icon and I can actual see it in the notification
Offline
Is it a custom icon or just the discord logo? (You could hardcode that?)
Offline
Is it a custom icon or just the discord logo? (You could hardcode that?)
It's User's avatar
Last edited by Akamiblade129_7 (2025-07-20 15:18:00)
Offline
It's probably temporary data w/o any disk icon to use.
Luckily upstream is at least not opposed to a body editing feature: https://github.com/dunst-project/dunst/issues/1494
Offline