9

It would be great if one could use it in the terminal for announcing that some time intensive job is done, e.g. "apt-get dist-upgrade; urg-anim".

8

You can set the urgency hint using wmctrl (needs to be installed):

some_task ; wmctrl -i -r $WINDOWID -b add,demands_attention

Where $WINDOWID is a variable holding the terminal window's ID. Because that's rather long to type, you can set up an alias for it in your ~/.bashrc:

alias set_urgent='wmctrl -i -r $WINDOWID -b add,demands_attention'

Then you'd simply run:

some_task ; set_urgent

Of course this will do nothing if the terminal is active at the time the wmctrl command is run.

| improve this answer | |
  • 1
    If you want a stand-in for some_task (for testing), use sleep 5, which will pause for 5 seconds. Also, you'll want to replace the quoted text "Terminal" with (part of) the title of your terminal, since the word "Terminal" may not occur in your terminal's window title (this can be configured via Edit->Profile Preferences->Title and Command tab->When terminal commands set their own title drop-down.). – Kevin May 5 '11 at 22:02
  • Yeah, doing this via title matching is ugly. I have searched for a way to return the window id of the terminal and use it with the -i switch of wmctrl, but no luck. – htorque May 5 '11 at 22:21
  • The compiz wiki has some really helpful info on this – Kevin May 6 '11 at 0:24
  • The problem with this is, that it's interactive - you need to click on a window to get the information. What would be great: alias urgent_blink='wmctrl -i -r $(get me the window id) -b add,demands_attention'. On the other hand, it shouldn't matter which terminal instance causes the launcher to wiggle. – htorque May 6 '11 at 8:57
  • 1
    Thanks for your answers, my final solution is: alias yoo-hoo='wmctrl -i -r $WINDOWID -b add,demands_attention – Jan Nekvasil May 6 '11 at 9:23
1

Install notify-send.

sudo apt-get update; sudo apt-get upgrade; notify-send 'Ubuntu updated' 'All updates complete'
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.