I am trying to change the format of text appearing in pop-up notification while using
notify-send command. Here I saw that it can be done using HTML formatting. But that doesn't seem to be working for me.
Is there any way to achieve this?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
The issue might be that the
summary string is not parsed, whereas the
body string is parsed. The format should be notify-send <OPTIONS summary body>
You will notice in the code below the
summary (or title, or subject, one could say) will not be formatted, but the
body string will be.
You can pass an empty string for the summary, but the spacing will still be there. Although the title is optional, it's suggested to include it in the event your notifications are used in other applications such as tickers or feeds that do not require or support anything but plain text.
#!/usr/bin/env bash phrase="Hey sexy, it's `date +'%l:%M %P'`" /usr/bin/notify-send --icon=clock -t 4000 "<i>Time Now</i>" "<span color='#57dafd' font='26px'><i><b>$phrase</b></i></span>" >/dev/null 2>&1
according to the docs the
a single line overview of the notification. For instance, "You have mail" or "A friend has come online". It should generally not be longer than 40 characters, though this is not a requirement, and server implementations should word wrap if necessary. The summary must be encoded using UTF-8."
For more info on styling the body text, see http://www.galago-project.org/specs/notification/0.9/x161.html