-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.plist
98 lines (95 loc) · 2.71 KB
/
info.plist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?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>bundleid</key>
<string>net.encyphered.alfred.show-ip</string>
<key>connections</key>
<dict>
<key>9D13CC33-0D07-448E-B0E8-0E938563F8BD</key>
<array>
<dict>
<key>destinationuid</key>
<string>58D120CD-F040-4F2B-B5F0-83BABFB978D3</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
</dict>
</array>
</dict>
<key>createdby</key>
<string>encyphered@gmail.com</string>
<key>description</key>
<string>Show IP Address</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Show IP Address</string>
<key>objects</key>
<array>
<dict>
<key>type</key>
<string>alfred.workflow.output.largetype</string>
<key>uid</key>
<string>58D120CD-F040-4F2B-B5F0-83BABFB978D3</string>
<key>version</key>
<integer>0</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>2</integer>
<key>escaping</key>
<integer>0</integer>
<key>keyword</key>
<string>ipaddr</string>
<key>script</key>
<string>ifconfig = %x(/sbin/ifconfig)
intfs = ifconfig.scan(/^[a-z0-9]+:/).map{|intf|intf.sub(/:/,'')}
intfmap = intfs.each_with_index.map { |intf, index|
nintf = intfs[index+1]
if nintf
[intf, (/(^#{intf}:.*)^#{nintf}/m).match(ifconfig)[1]]
else
[intf, (/(^#{intf}:.*)/m).match(ifconfig)[1]]
end
}.select{|map|/en[0-9]/.match(map[0])}.map{|map|[map[0],(/inet (([0-9]{1,3}\.){3}[0-9]{1,3})/).match(map[1])]}.reject{|map|map[1].nil?}.map{|map|[map[0],map[1][1]]}
intfmap.sort!{|a,b|a[0]<=>b[0]}
puts '<?xml version="1.0"?>'
puts '<items>'+intfmap.map{|m|"<item uid=\"#{m[0]}\" arg=\"#{m[1]}\"><title>#{m[1]}</title><subtitle>#{m[0]}</subtitle><icon>icon.png</icon></item>"}.join+'</items>'</string>
<key>title</key>
<string>Show IP Address</string>
<key>type</key>
<integer>2</integer>
<key>withspace</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>9D13CC33-0D07-448E-B0E8-0E938563F8BD</string>
<key>version</key>
<integer>0</integer>
</dict>
</array>
<key>readme</key>
<string></string>
<key>uidata</key>
<dict>
<key>58D120CD-F040-4F2B-B5F0-83BABFB978D3</key>
<dict>
<key>ypos</key>
<real>10</real>
</dict>
<key>9D13CC33-0D07-448E-B0E8-0E938563F8BD</key>
<dict>
<key>ypos</key>
<real>10</real>
</dict>
</dict>
<key>webaddress</key>
<string></string>
</dict>
</plist>