add an "alert" alias, which can optionally be added after long running commands
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
Fix Released
|
Wishlist
|
Dustin Kirkland |
Bug Description
Binary package hint: bash
This bug is closely related, though slightly different from Bug #315932.
I recently posted:
http://
This post received some positive feedback in the comments and in IRC. A number of people have asked for this sort of functionality in the default Ubuntu .bashrc. I think this is a perfectly reasonable request. It doesn't get in the way, as current users must consciously append "; alert" onto their long running commands.
We can experiment with this as a proof-of-concept in Maverick, and perhaps look at better ways of doing this automagically by default (again, see the really interesting implementation in Bug #315932).
I have tested:
a) when libnotify-bin is not installed -- command-not-found prints a useful error message
b) when gnome-terminal is not installed -- icons aren't present; notify message pops up without icons; still functional
c) over ssh -X -- works fine, assuming the client and host has the necessary packages to do libnotify stuff
Changed in bash (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → Dustin Kirkland (kirkland) |
importance: | Undecided → Wishlist |
For the moment, commited as:
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$ //'\'') "'
with generic icon 'terminal' so that it should be happier on K/Xubuntu with reduced icons sets and the lower priority to not be unnecessarily noisy. Long-term there are going to be better solutions(tm).