Is there any way to initiate "urgent animation" of an icon on the Unity launcher from command line?
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".
Solution 1:
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.
Solution 2:
Install notify-send.
sudo apt-get update; sudo apt-get upgrade; notify-send 'Ubuntu updated' 'All updates complete'