'alert' alias creates notifications that don't go away in GNOME 3

Bug #1067774 reported by Brendan Long on 2012-10-17
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash (Ubuntu)

Bug Description

The default .bashrc has this:

    # Add an "alert" alias for long running commands. Use like so:
    # sleep 10; alert
    alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

This creates a libnotify popup showing your last command. The problem is that it creates a notification in the system tray, which only goes away when you right click and choose "Remove". This is annoying since now instead of just getting a notification and handling it, you need to go into the system tray and remove the notification, then handle whatever it is you actually wanted to do.

Red Hat has a bug report on this:


Their solution is to add this to notify-send when you want it to be transient:


So I think the default alias should be this:

    alias alert='notify-send --hint=int:transient:1 --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

I've tested this on my machine and it does what I was wanting: A notification pops up, then goes away.

Brendan Long (shlf) wrote :

I can confirm that the fixed alias works. This is a minor change so it would be nice if it was fixed by default.

Changed in bash (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers