Sha256: f2738454fde7d3af0041592f354913599e8a89b9c3473543de3bcd8de9f0e9e3

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

#!/usr/bin/env ruby
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Example MS-Windows notify-send wrapper script. Assumes growlnotify.exe is in your 'path'.

require 'optparse'

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: notify-send [options]"

  opts.on('-u', '--urgency LEVEL')           { |v| options[:u] = v } # TO DO: Set to /p:priority
  opts.on('-t', '--expire-time TIME')        { |v| options[:t] = v } # Option gets removed 
  opts.on('-a', '--app-name APP_NAME')       { |v| options[:a] = v } # TO DO: Set to /a:application
  opts.on('-i', '--icon ICON[,ICON...]')     { |v| options[:i] = v } # TO DO: Set to /i:icon (url only) 
  opts.on('-c', '--category TYPE[,TYPE...]') { |v| options[:c] = v } # Option gets removed 
  opts.on('-h', '--hint TYPE:NAME:VALUE')    { |v| options[:h] = v } # Option gets removed
  opts.on('-v', '--version')                 { |v| options[:v] = v } # Option gets removed
end.parse!



if ARGV.length == 0
  puts "No summary specified"
elsif ARGV.length == 1
  message = "'#{ARGV[0]}'"
  system("growlnotify.exe \"#{message}\"")
elsif ARGV.length == 2
  title = "/t:'#{ARGV[0]}'"
  message = "'#{ARGV[1]}'"
  system("growlnotify.exe \"#{title}\" \"#{message}\"")
else
  message = ARGV.map{|a| "'#{a}'"}.join(' ')
  system("growlnotify.exe \"#{message}\"")
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-notify-0.5.0 examples/windows/notify-send_growl_for_windows