Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Notify-send HOWTO

  1. #21
    Join Date
    Jun 2007
    Beans
    8

    Smile Re: Notify-send HOWTO

    Thanks! I am relatively new to linux but I managed to create a simple bash script to show a notification to rest my eyes & also activate the screen saver


    Quote Originally Posted by DeusEx View Post
    Notify-send is a little, simple On-Screen Display application. It uses the notify bubble (or balloon?) pop-up system as seen in 9.10 Karmic.

    Despite its usage is very simple you can have a lot of fun with it. Let's install it first:

    Code:
    sudo apt-get install notify-osd
    Now this command should pop up a 'bubble':
    Code:
    notify-send Test "Hello World"
    The --help option shows basic usage:

    Code:
    $notify-send --help
    Usage:                             
      notify-send [OPTION...] <SUMMARY> [BODY] - create a notification                                                    
    
    Help Options:
      -?, --help                        Show help options
    
    Application Options:
      -u, --urgency=LEVEL               Specifies the urgency level (low, normal, critical).                              
      -t, --expire-time=TIME            Specifies the timeout in milliseconds at which to expire the notification.
      -i, --icon=ICON[,ICON...]         Specifies an icon filename or stock icon to display.
      -c, --category=TYPE[,TYPE...]     Specifies the notification category.
      -h, --hint=TYPE:NAME:VALUE        Specifies basic extra data to pass. Valid types are int, double, string and byte.
      -v, --version                     Version of the package.
    Some examples:

    1. Basic message with an icon in front of the Title showing 5000 milliseconds
    Code:
    notify-send "Message Title" "The message body is shown here" -i /usr/share/pixmaps/idle.xpm -t 5000
    2. Show contents of a file:
    Code:
    notify-send test "`tail /var/log/syslog`"
    3. Follow log file:
    Code:
    tail -n0 -f /var/log/messages | while read line; do notify-send "System Message" "$line"; done
    4. Format message with HTML:
    Code:
    notify-send Test "<font size=16 color=blue><b><i>Hello World</b></i></font>"

  2. #22
    Join Date
    Feb 2012
    Beans
    1

    Re: Notify-send HOWTO

    Hi, I have a related issue. I am using ubuntu 11.10 and tried the scrypt for ultrabay_eject from thinkwiki. It calls notify-send but no notificatio is displayed. The ONLY way for the notification to work is to do

    xhost +local:

    in a terminal window and then generate the acpi event by pulling the lever on the laptop. Note that the script is working with notifications if manually run via the terminal.

    So the question here is - how can i make xhost +local: work in the script or being executed as my laptop starts? Tried placing it in /etc/rc.local but still no go.

    Thanks

  3. #23
    Join Date
    Oct 2010
    Beans
    17

    Re: Notify-send HOWTO

    For some reason my notify-send does not load stock icons. For example, instead of
    Code:
    notify-send -i notification-message-im
    , I have to specify the full path with
    Code:
    notify-send -i /usr/share/notify-osd/icons/hicolor/scalable/status/notification-message-im.svg
    Is there any way to fix this?

  4. #24
    Join Date
    Apr 2011
    Beans
    1

    Re: Notify-send HOWTO

    Quote Originally Posted by Lupius View Post
    For some reason my notify-send does not load stock icons. For example, instead of
    Code:
    notify-send -i notification-message-im
    , I have to specify the full path with
    Code:
    notify-send -i /usr/share/notify-osd/icons/hicolor/scalable/status/notification-message-im.svg
    Is there any way to fix this?
    Just send
    Code:
    notify-send -i message-im
    I.e., without the "notification-" in the beginning.

  5. #25
    Join Date
    Oct 2010
    Beans
    17

    Re: Notify-send HOWTO

    Thanks but that didn't work either.

  6. #26
    Join Date
    Sep 2013
    Beans
    1

    Re: Notify-send HOWTO

    Quote Originally Posted by Lupius View Post
    For some reason my notify-send does not load stock icons. For example, instead of
    Code:
    notify-send -i notification-message-im
    , I have to specify the full path with
    Code:
    notify-send -i /usr/share/notify-osd/icons/hicolor/scalable/status/notification-message-im.svg
    Is there any way to fix this?
    You should put the image path into "...". Try this and feed back me your result

  7. #27
    Join Date
    Aug 2006
    Location
    St. Louis Metro
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Notify-send HOWTO

    I'm trying to add a custom icon to my notification that is getting created in a Java class. When I explicitly provide a path to the image, ie-'/home/name/Pictures/image.png' it works beautifully. But I'm having a problem now where I want to package this app up and put it on github so anyone can use it, but when I include the image in my java project, and either put it in a 'res' folder, or even in the same folder as the Main.java file, it isn't working. Any idea why?

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •