forked from Lissy93/espanso-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.yml
272 lines (245 loc) · 7.93 KB
/
utils.yml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# Handy utilities, for use with Espanso, the open source cross-platform text expander
# Licensed under MIT X11, © Alicia Sykes 2021: https://aliciasykes.com
name: alicia-utils
package_author: Alicia Sykes <alicia@omg.lol>
parent: default
matches:
# Outputs public IP address
- trigger: ":ip"
replace: "{{output}}"
vars:
- name: output
type: shell
params:
cmd: "curl 'https://api.ipify.org'"
# Outputs the current weather for your location
- trigger: ":weather"
replace: "{{output}}"
vars:
- name: output
type: shell
params:
cmd: "curl 'http://wttr.in/?format=3'"
# Auto close brackets, quotes and formatting modifiers, and put cursor in center
- trigger: ':('
replace: '($|$)'
- trigger: ':['
replace: '[$|$]'
- trigger: ':{'
replace: '{$|$}'
- trigger: ':<'
replace: '<$|$>'
- trigger: ':`'
replace: '`$|$`'
- trigger: ":\'"
replace: "\'$|$\'"
- trigger: ':"'
replace: '"$|$"'
- trigger: ':_'
replace: '_$|$_'
- trigger: ':*'
replace: '*$|$*'
- trigger: ':-'
replace: '-$|$-'
# Inserts a markdown code block
- trigger: :md-code
replace: "```\n$|$\n```"
# Inserts markdown collapsable section
- trigger: :md-collapse
replace: "\n<details>\n\t<summary>$|$</summary>\n\t<p></p>\n</details>"
# Outputs markdown link, with clipboard contents as the URL
- trigger: ":md-link"
replace: "[$|$]({{clipboard}})"
vars:
- name: "clipboard"
type: "clipboard"
# Creates a HTML anchor element, with clipboard contents as href
- trigger: ":html-link"
replace: "<a href=\"{{clipboard}}\" />$|$</a>"
vars:
- name: "clipboard"
type: "clipboard"
# Outputs BB Code link, with clipboard contents as the URL
- trigger: ":bb-link"
replace: "[url={{clipboard}}]$|$[/url]"
vars:
- name: "clipboard"
type: "clipboard"
# Inserts common HTML elements
- trigger: :hr
replace: '<hr />'
- trigger: :br
replace: '<br />'
- trigger: :div
replace: '<div>$|$</div>'
- trigger: :span
replace: '<span>$|$</span>'
- trigger: :h1
replace: '<h1>$|$</h1>'
- trigger: :h2
replace: '<h2>$|$</h2>'
- trigger: :h3
replace: '<h3>$|$</h3>'
- trigger: :para
replace: '<p>$|$</p>'
# Inserts any custom HTML, XML or web component tag
- trigger: ":tag"
replace: "<{{html.element}}>$|$</{{html.element}}>"
vars:
- name: "html"
type: form
params:
layout: "XML / HTML Element Inserter\nTag Name: {{element}}"
fields: { element: { type: text }}
# Outputs todays date (dd/mm/yy)
- trigger: :date
replace: "{{date}}"
vars:
- name: date
type: date
params:
format: "%d/%m/%y"
# Outputs the current time (24hr)
- trigger: :time
replace: "{{time}}"
vars:
- name: time
type: date
params:
format: "%H:%M"
# Outputs the month and year (e.g. January 2020)
- trigger: :month
replace: "{{date}}"
vars:
- name: date
type: date
params:
format: "%B %Y"
# Easily inputs ASCII emojis from a dropdown
- trigger: :lenny
form: "{{smileys}}"
form_fields:
smileys:
type: choice
values:
- '¯\\_(ツ)_/¯'
- '(╯°□°)╯︵ ┻━┻'
- '( ͡ಠ ʖ̯ ͡ಠ)'
- '☉ ‿ ⚆'
- 'ʕ•ᴥ•ʔ'
- '⋆。˚ ☁︎ ˚。⋆。˚☽˚。⋆'
- '◤◢◣◥◤◢◣◥'
- '(づᵔ◡ᵔ)づ'
- '|ᵔ‿ᵔ|'
- '⤜(*﹏*)⤏'
- 'ツ'
# Ouputs MIT License short text
- trigger: :mit-short
replace: "Licensed under MIT X11, © Alicia Sykes {{year}}: https://aliciasykes.com"
vars: [{name: year, type: date, params: {format: "%Y"}}]
# Outputs full MIT license text, from GitHub
- trigger: :mit-long
replace: "{{output}}"
vars:
- name: output
type: shell
params:
cmd: "curl 'https://gist.githubusercontent.com/Lissy93/143d2ee01ccc5c052a17/raw/a8ac96cd15847a231931b561d95d2de47066fd33/LICENSE.MD'"
# Personal email notes
- trigger: :kr
replace: "Kind Regards,\nAlicia\n"
# Outputs git commit command, with cursor in the message block
- trigger: :commit
replace: git commit -m "$|$"
# Fetches a funny commit message from whatthecommit.com
- trigger: :wtc
replace: "{{output}}"
vars:
- name: output
type: shell
params: {cmd: "curl -s whatthecommit.com/index.txt"}
# Uses Lesspass to generatre a password for a given account
# Requires the Lesspass CLI to be installed, see:
# https://github.com/lesspass/lesspass/tree/master/cli
- trigger: :pass
replace: "{{lesspass}}"
vars:
- name: "params"
type: form
params:
layout: |
Less Pass Generator
Website: {{site}}
Login: {{login}}
Master Password: {{pass}}
- name: lesspass
type: shell
params:
cmd: "lesspass $ESPANSO_PARAMS_SITE $ESPANSO_PARAMS_LOGIN $ESPANSO_PARAMS_PASS"
# Quick search, formulates the URL params for searching a given website
- triggers: [:srch-ddg, :search-duckduckgo]
replace: 'https://duckduckgo.com/?q='
- triggers: [:srch-wiki, :search-wikipedia]
replace: 'https://en.wikipedia.org/w/?search='
- triggers: [:srch-gh, :search-github]
replace: 'https://github.com/search?q='
- triggers: [:srch-so, :search-stackoverflow]
replace: 'https://stackoverflow.com/search?q='
- triggers: [:srch-dh, :search-dockerhub]
replace: 'https://hub.docker.com/search?q='
- triggers: [:srch-wa, :search-wolframalpha]
replace: 'https://www.wolframalpha.com/input/?i='
- triggers: [:srch-red, :search-reddit]
replace: 'https://www.reddit.com/search/?q='
- triggers: [:srch-bbc, :search-bbc]
replace: 'https://www.bbc.co.uk/search?q='
- triggers: [:srch-vt, :search-virustotal]
replace: 'https://www.virustotal.com/gui/search/'
- triggers: [:srch-amz, :search-amazon]
replace: 'https://amazon.co.uk/s?k='
- triggers: [:srch-yt, :search-youtube]
replace: 'https://youtube.com/results?q='
- triggers: [:srch-maps, :search-maps]
replace: 'https://www.google.com/maps/search/'
- triggers: [:srch-goo, :search-google]
replace: 'https://google.com/search?q='
# Similar to above, but it uses the clipboard for the search query
- trigger: ":swc-ddg"
replace: "https://duckduckgo.com/?q={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-wiki"
replace: "https://en.wikipedia.org/w/?search='{{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-gh"
replace: "https://github.com/search?q={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-so"
replace: "https://stackoverflow.com/search?q={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-dh"
replace: "https://hub.docker.com/search?q={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-wa"
replace: "https://www.wolframalpha.com/input/?i={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-red"
replace: "https://www.reddit.com/search/?q={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-bbc"
replace: "https://www.bbc.co.uk/search?q={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-vt"
replace: "https://www.virustotal.com/gui/search/{{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-amz"
replace: "https://amazon.co.uk/s?k={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-yt"
replace: "https://youtube.com/results?q={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-maps"
replace: "https://www.google.com/maps/search/{{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]
- trigger: ":swc-goo"
replace: "https://google.com/search?q={{clipboard}}"
vars: [{ name: "clipboard", type: "clipboard"}]