Here’s another small bash script for you to try. It should show the notification as-is.
It is doesn’t, can you try other values for: urgency and/or expiretime.
Save the script to file /tmp/test and make it executable.
Run it with command
sudo /tmp/test denalb
#!/bin/bash
DIE() {
local progname=${0##*/}
echo -e "==> $progname: error: $1" >&2
exit 1
}
Main() {
local user="$1"
[ "$user" ] || DIE "please give your user name."
local userid="$(/bin/id -u "$user")"
local appname="testing app"
local icon="info"
local title="my title"
local message="my message"
local urgency="normal" # values: low, normal, critical
local expiretime=0 # or 3000; value in milliseconds
local command=(
DISPLAY=:0
WAYLAND_DISPLAY=wayland-0
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$userid/bus"
notify-send
--icon="'$icon'"
--urgency="'$urgency'"
--expire-time="'$expiretime'"
--app-name="'$appname'"
"'$title'"
"'$message'"
)
/bin/sudo -u "$user" bash -c "${command[*]}"
}
Main "$@"