ohmyzsh/plugins/bgnotify
duerrp 0c55d42480 Fix currentWindowId
On my system xmonad on Ubuntu 14.04, the xprop -root call has an earlier ocurence of NET_ACTIVE_WINDOW that makes this function fail. I guess someone who knows more about xprop should rewrite this function in a less brittle way, but for now my fix should do.
2015-04-24 12:39:00 +09:00
..
bgnotify.plugin.zsh Fix currentWindowId 2015-04-24 12:39:00 +09:00
README.md Add screenshots to readme 2014-11-08 14:20:37 -08:00

bgnotify zsh plugin

cross-platform background notifications for long running commands! Supports OSX and Ubuntu linux.

Standalone homepage: t413/zsh-background-notify


How to use!

Just add bgnotify to your plugins list in your .zshrc

  • On OS X you'll need terminal-notifer
    • brew install terminal-notifier (or gem install terminal-notifier)
  • On ubuntu you're already all set!
  • On windows you can use notifu or the Cygwin Ports libnotify package

Screenshots

Linux

screenshot from 2014-11-07 15 58 36

OS X

screenshot 2014-11-08 14 15 12

Windows

screenshot from 2014-11-07 15 55 00

Configuration

One can configure a few things:

  • bgnotify_threshold sets the notification threshold time (default 6 seconds)
  • function bgnotify_formatted lets you change the notification

Use these by adding a function definition before the your call to source. Example:

bgnotify_threshold=4  ## set your own notification threshold

function bgnotify_formatted {
  ## $1=exit_status, $2=command, $3=elapsed_time
  [ $1 -eq 0 ] && title="Holy Smokes Batman!" || title="Holy Graf Zeppelin!"
  bgnotify "$title -- after $3 s" "$2";
}

plugins=(git bgnotify)  ## add to plugins list
source $ZSH/oh-my-zsh.sh  ## existing source call