{"id":2652,"date":"2015-04-30T10:48:17","date_gmt":"2015-04-30T10:48:17","guid":{"rendered":"http:\/\/wiki.davelevy.info\/?p=2652"},"modified":"2025-12-28T11:09:04","modified_gmt":"2025-12-28T11:09:04","slug":"notify-send","status":"publish","type":"post","link":"https:\/\/davelevy.info\/wiki\/notify-send\/","title":{"rendered":"notify-send"},"content":{"rendered":"\n<p>Originally written in 2015, this post contains my notes on how to write messages to the screen. I started with ubuntu and then played with <a href=\"https:\/\/davelevy.info\/wiki\/tag\/elementary-os\/\">elementary <\/a>and raspbian. WRT to raspian\/raspberry pi OS, I had problems connecting it to the screen display, and at xmas 2025, I gave up and switched to <a href=\"https:\/\/davelevy.info\/wiki\/zenity\/\">zenity<\/a>. <\/p>\n\n\n\n<p>notify-send may remain sensible and more integrated to the build for Ubuntu. I am playing with MInt today and so may test it there, but if I learn to use zenity, probably not. Note that each build has a different package name. See overleaf, or below for more &#8230;<\/p>\n\n\n\n<!--more-->\n\n\n\n<h3 class=\"wp-block-heading\">Purpose\/Use Case<\/h3>\n\n\n\n<p>While installing docker, I decided I needed to write some notifications to ensure the configuration works. See <a href=\"https:\/\/davelevy.info\/wiki\/docker\/\">Docker<\/a>. I started with a TCL\/TK script, which these days looks a bit old school, and writing the packer was (&amp; remains) difficult. Virtualbox reports its status on Ubuntu via a very pretty interface, prettier than Apple script anyway, so I thought I&#8217;d have a lock. This page contains the original notes in Ubuntu and Docker and has been supplemented by notes on Elementary and Raspbian. This seems easiest to use on Gnome\/Ubuntu. There is a message sender i.e. notify-send, and a notification daemon and obviously a desktop.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Ubuntu<\/h3>\n\n\n\n<p>The command is <code>notify-send<\/code>. This is part of the desktop, obviously not needed if running headless.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"http:\/\/manpages.ubuntu.com\/manpages\/trusty\/man1\/notify-send.1.html\">http:\/\/manpages.ubuntu.com\/manpages\/trusty\/man1\/notify-send.1.html<\/a> &#8211; the man page<\/li>\n\n\n\n<li><a href=\"http:\/\/www.linuxjournal.com\/content\/tech-tip-get-notifications-your-scripts-notify-send\">http:\/\/www.linuxjournal.com\/content\/tech-tip-get-notifications-your-scripts-notify-send<\/a> &#8211; some examples<\/li>\n\n\n\n<li><a href=\"https:\/\/web.archive.org\/web\/20190426202005\/https:\/\/ubuntuforums.org\/showthread.php?t=1411620\">http:\/\/ubuntuforums.org\/showthread.php?t=1411620<\/a> &#8211; an ubuntu forums thread with some tips<\/li>\n<\/ol>\n\n\n\n<p>With Ubuntu, it is part of a notification system which offers a cool look and feel and message storage and display through the desktop panel. It comes with some standard icons, somewhere in the \/usr\/share\/icons directories, allegedly. The command syntax is as follows<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ notify-send -i ${icon file, path and basename} \"Docker Daemon\" \\\n        \"docker daemon is running\"\n<\/pre>\n\n\n\n<p>I plan to put this in my .profile; or somewhere else if that doesn&#8217;t work on a graphic login. This <a href=\"https:\/\/unix.stackexchange.com\/questions\/172179\/gnome-shell-running-shell-script-after-session-starts\">article on stackexchange addresses how to run a script on GNOME login<\/a>.<\/p>\n\n\n\n<p>I became interested in customising the look and feel and found <a href=\"https:\/\/unix.stackexchange.com\/questions\/684614\/how-to-customise-the-appearance-of-notify-send\">&#8220;how-to-customise-the-appearance-of-notify-send&#8221;<\/a>&nbsp;at stackexchange, although it seems this dependent on the notification daemon.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Elementary<\/h3>\n\n\n\n<p>I came across another use case and needed it to run on an elementary OS systems. The version of notification used by elementary seems to have some differences. I installed <code>notify-osd<\/code> and then copied the icon I wanted to use to <code>\/usr\/share\/icons<\/code>. The icon is then referred to by its file name prefix.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Raspbian<\/h3>\n\n\n\n<p>Installing on Raspbian;\u00a0<a href=\"https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?f=32&amp;t=270632&amp;p=1642182&amp;hilit=notify+send+apt#p1642182\">installing notify-send on Raspbian<\/a>. Stranger than expected. I got an error reply, i.e. I am using the wrong daemon.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt -y install xfce4-notifyd &amp;&amp; notify-send 'your notifications look like this'<\/code><\/pre>\n\n\n\n<p>However, while trying to make this do what I want on Raspian, I couldn&#8217;t connect to the X-Display channel, and I was pointed at Zenity. On returning to the problem, I <a href=\"https:\/\/github.com\/dfl1955\/ubuntu-tools\/blob\/master\/apttools\/check_aptrepob\">rewrote the script<\/a> to use zenity. NB the management of the arguments in a script is fun. Not!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Originally written in 2015, this post contains my notes on how to write messages to the screen. I started with ubuntu and then played with elementary and raspbian. WRT to raspian\/raspberry pi OS, I had problems connecting it to the screen display, and at xmas 2025, I gave up and switched to zenity. notify-send may&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2658,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_share_on_mastodon":"0"},"categories":[3],"tags":[871,710,982,916,405,880,881,1286,911,343,1869],"class_list":["post-2652","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-docker","tag-elementary-os","tag-gnome","tag-linux","tag-login","tag-notify","tag-notify-send","tag-raspbian","tag-technology","tag-ubuntu","tag-zenity"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2015\/04\/notify-docker-w650.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/2652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/comments?post=2652"}],"version-history":[{"count":3,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/2652\/revisions"}],"predecessor-version":[{"id":13657,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/2652\/revisions\/13657"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media\/2658"}],"wp:attachment":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media?parent=2652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/categories?post=2652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/tags?post=2652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}