Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
command completion notification
- X-seq: zsh-users 17192
- From: "William G. Scott" <wgscott@xxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: command completion notification
- Date: Fri, 3 Aug 2012 23:08:31 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsc.edu; s=ucsc-google; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version:x-mailer; bh=jVoda5liAwcMcaMieZ0l27xnDpKHujm8xw1DYEoZbok=; b=lelvLC+/b8+qRmyPH9tFN0RkqXpvRTN+STSVxb++MkoqD3uXpIoAPY1za2fAM1uzpB 7a1B2JO5wWs/Vuc+IfTtZBdr2ye5jQ2aRfxAWc6U3C+KCDiYb9Jq/KqlABG/UyF5wvok xSB8V1GVrbVPvb0cgLIQKaq0L5J8SepPE1Hzw=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author