zsh-users
 help / color / mirror / code / Atom feed
* command completion notification
@ 2012-08-04  6:08 William G. Scott
  2012-08-04 23:10 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: William G. Scott @ 2012-08-04  6:08 UTC (permalink / raw)
  To: zsh-users

Forgive me, as it has been a few years since my last email…

In OS X, 10.8 (aka Mtn Lion), Apple has introduced a notification system.  Using gem, I installed a command-line utility called terminal-notifier.

I wrote a simple function to test its capabilities:

function tnot { "$@" && terminal-notifier -message "$( echo $@ ) returned $?" -title "Command $HISTCMD Completed" >|/dev/null }

Now if I issue a command like

tnot  sleep 12

It will post a notification on the screen and log the notification to the so-called notification center where all the nagging notices pile up.

This isn't particularly elegant.  I would rather use this as a preexec function, or something similar, so I wouldn't have to explicitly type "tnot".  However, there are only a small subset of commands I would want to bind to a notification.

Is it straightforward to somehow bind this to, say, control-return, or some other modified return key sequence?

Thanks.

Bill Scott




William G. Scott
Professor
Department of Chemistry and Biochemistry
and The Center for the Molecular Biology of RNA
228 Sinsheimer Laboratories
University of California at Santa Cruz
Santa Cruz, California 95064
USA
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-20  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-04  6:08 command completion notification William G. Scott
2012-08-04 23:10 ` Bart Schaefer
2012-08-05  3:43   ` William Scott
2012-08-05 18:21     ` Bart Schaefer
2012-09-20  9:04     ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).