Inviare notifiche al desktop di Ubuntu da shell scripts

From RVM Wiki
Revision as of 13:52, 30 March 2012 by Gabriele.vivinetto (talk | contribs) (Created page with "* Si usa notify-send * Installare sudo apt-get install libnotify-bin * Testare: notify-send 'title of notification' 'body of notification' * Attenzione: da shell script (es…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • Si usa notify-send
  • Installare
sudo apt-get  install libnotify-bin
  • Testare:
notify-send 'title of notification' 'body of notification'
  • Attenzione: da shell script (esempio ifupdown), eseguito da root o in background, occorre gestire il Display e l'utente a cui notificare, tramite le apposite varibili, altrimenti la notifica non verrà mostrata:
DISPLAY=:0 XAUTHORITY=/home/myusername/.Xauthority /usr/bin/notify-send "Myscriptname" "Test of notification"

Riferimenti