Gnome 3 Shell and Gratuitous Jupiter Notifications

I’ve been mostly enjoying running Ubuntu 12.10 with Gnome 3 Shell on my ThinkPad T530. The essential Gnome Shell Extensions were available pretty quick after 12.10’s release and Gnome 3 continues to get better and more polished. I even think the new Nautilus is pretty great. Much faster than the old Nautilus even though it’s missing some awesome features that had been recently introduced to the old version.

However, I like to install the Jupiter Applet to (I believe) improve my laptop’s battery life. And that applet has been flooding my Gnome Shell notifications panel with little lightning bolt notification icons. A new one is added every suspend/resume-from-suspend cycle. How to fix this? Is it possible to tell Jupiter to tell me less?

Ask Ubuntu To the Rescue

Today I found a fix for this problem. I’m making a post here in case an update erases my changes and I have to do it again. But this specific answer to the question “How do I clear all Gnome Shell notifications?” by user jtaillon does exactly what I wanted: Tells Jupiter to take it easy on the notifications.

The special text that needs to be added is this:

--hint int:transient:1

Here’s how to open the right file with sudo: Open a terminal and copy/paste the following and hit ENTER.

sudo gedit /usr/lib/jupiter/scripts/notify

Before proceeding, select all, copy and paste this file’s contents into a backup text file somewhere. Just in case you make a mistake.

Now compare the following example to your own file and add “–hint int:transient:1” as needed – should be 3 places where that is needed. You should be able to leave alone any other variations between my example and your file.

function notify {
  if [ ! "$NO_NOTIFY" = "1" ]; then
    ICON=$2
    MESSAGE=$1
    if [ "$DISTRIB_RELEASE" = "9.10" ]; then
      DISPLAY=:0.0 notify-send --hint int:transient:1 -i $ICON -t 1500 "$MESSAGE" 2>/dev/null
    else
      USER=$(who | sed -n '/ (:0[\.0]*)$\| :0 /{s/ .*//p;q}')
      USERCNT=$(who | wc -l)
      if [ ! "$(whoami)" = "$USER" ]; then
        if [ ! "$USERCNT" -lt 1 ]; then
          su $USER -l -c "DISPLAY=:0.0 notify-send --hint int:transient:1 -i $ICON -t 700 \"$MESSAGE\" 2>/dev/null"
        fi
      else
        if [ ! "$USERCNT" -lt 1 ]; then
          notify-send --hint int:transient:1 -i $ICON -t 700 "$MESSAGE" 2>/dev/null
        fi
      fi
    fi
  fi
}

Save and close the file once you’ve made the changes.

In my experience you should see the result of the change immediately without restarting your system. Now at most I see one single notification from Jupiter at a time and it disappears a few minutes after I resume-from-suspend.

I hope you find this helpful.