Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (39 sloc) 1002 Bytes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
<string>#!/bin/bash
esc () {
STR="$1" ruby &lt;&lt;"RUBY"
str = ENV['STR']
str = str.gsub(/'/, "'\\\\''")
str = str.gsub(/[\\"]/, '\\\\\\0')
print "'#{str}'"
RUBY
}
osascript &lt;&lt;- APPLESCRIPT
tell app "Terminal"
launch
activate
do script "clear; sudo dtrace -s $(esc "${TM_FILEPATH}")"
set position of first window to { 100, 100 }
end tell
APPLESCRIPT
</string>
<key>input</key>
<string>document</string>
<key>keyEquivalent</key>
<string>@d</string>
<key>name</key>
<string>Run DTrace Script in Terminal</string>
<key>output</key>
<string>discard</string>
<key>scope</key>
<string>source.dtrace</string>
<key>uuid</key>
<string>D2E2A3AF-9E53-4074-84A3-52CEA8257DB1</string>
</dict>
</plist>