Skip to content

Instantly share code, notes, and snippets.

@g4rcez
Last active January 21, 2025 11:25
Show Gist options
  • Save g4rcez/dc52c404526753edcf4519b85854c1db to your computer and use it in GitHub Desktop.
Save g4rcez/dc52c404526753edcf4519b85854c1db to your computer and use it in GitHub Desktop.
Configuração do espanso gerada pelo meu arquivo de configuração Typescript + Deno
matches:
- label: "Trigger: ;url\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts url --value \"$ESPANSO_CLIPBOARD\"\n \r```\n "
replace: '{{url}}'
trigger: ;url
vars:
- name: clipboard
type: clipboard
- name: url
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts url --value
"$ESPANSO_CLIPBOARD"
shell: bash
type: shell
- label: "Trigger: ;yesterday\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts dates --value=yesterday\n \r```\n "
replace: '{{yesterday}}'
trigger: ;yesterday
vars:
- name: clipboard
type: clipboard
- name: yesterday
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts dates --value=yesterday
shell: bash
type: shell
- label: "Trigger: ;tomorrow\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts dates --value=tomorrow\n \r```\n "
replace: '{{tomorrow}}'
trigger: ;tomorrow
vars:
- name: clipboard
type: clipboard
- name: tomorrow
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts dates --value=tomorrow
shell: bash
type: shell
- label: "Trigger: ;iso\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts dates --value=iso\n \r```\n "
replace: '{{iso}}'
trigger: ;iso
vars:
- name: clipboard
type: clipboard
- name: iso
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts dates --value=iso
shell: bash
type: shell
- label: "Trigger: ;cnpj\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts cnpj\n \r```\n "
replace: '{{cnpj}}'
trigger: ;cnpj
vars:
- name: clipboard
type: clipboard
- name: cnpj
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts cnpj
shell: bash
type: shell
- label: "Trigger: ;cpf\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts cpf\n \r```\n "
replace: '{{cpf}}'
trigger: ;cpf
vars:
- name: clipboard
type: clipboard
- name: cpf
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts cpf
shell: bash
type: shell
- label: "Trigger: ;master\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts card --brand=master\n \r```\n "
replace: '{{master}}'
trigger: ;master
vars:
- name: clipboard
type: clipboard
- name: master
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts card --brand=master
shell: bash
type: shell
- label: "Trigger: ;cvvmaster\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts card --brand=master --cvv\n \r```\n "
replace: '{{cvvmaster}}'
trigger: ;cvvmaster
vars:
- name: clipboard
type: clipboard
- name: cvvmaster
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts card --brand=master
--cvv
shell: bash
type: shell
- label: "Trigger: ;visa\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts card --brand=visa\n \r```\n "
replace: '{{visa}}'
trigger: ;visa
vars:
- name: clipboard
type: clipboard
- name: visa
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts card --brand=visa
shell: bash
type: shell
- label: "Trigger: ;cvvvisa\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts card --brand=visa --cvv\n \r```\n "
replace: '{{cvvvisa}}'
trigger: ;cvvvisa
vars:
- name: clipboard
type: clipboard
- name: cvvvisa
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts card --brand=visa --cvv
shell: bash
type: shell
- label: "Trigger: ;amex\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts card --brand=amex\n \r```\n "
replace: '{{amex}}'
trigger: ;amex
vars:
- name: clipboard
type: clipboard
- name: amex
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts card --brand=amex
shell: bash
type: shell
- label: "Trigger: ;cvvamex\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts card --brand=amex --cvv\n \r```\n "
replace: '{{cvvamex}}'
trigger: ;cvvamex
vars:
- name: clipboard
type: clipboard
- name: cvvamex
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts card --brand=amex --cvv
shell: bash
type: shell
- label: "Trigger: ;uuid\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts uuid\n \r```\n "
replace: '{{uuid}}'
trigger: ;uuid
vars:
- name: clipboard
type: clipboard
- name: uuid
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts uuid
shell: bash
type: shell
- label: "Trigger: ;pass\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts password --length $ESPANSO_N\n \r```\n "
regex: ';pass\[(?P<N>.*)\]'
replace: '{{pass}}'
vars:
- name: clipboard
type: clipboard
- name: pass
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts password --length
$ESPANSO_N
shell: bash
type: shell
- label: "Trigger: ;cellphone\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts phone --mode=cellphone\n \r```\n "
replace: '{{cellphone}}'
trigger: ;cellphone
vars:
- name: clipboard
type: clipboard
- name: cellphone
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts phone --mode=cellphone
shell: bash
type: shell
- label: "Trigger: ;telephone\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts phone --mode=telephone\n \r```\n "
replace: '{{telephone}}'
trigger: ;telephone
vars:
- name: clipboard
type: clipboard
- name: telephone
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts phone --mode=telephone
shell: bash
type: shell
- label: "Trigger: ;email\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts email\n \r```\n "
replace: '{{email}}'
trigger: ;email
vars:
- name: clipboard
type: clipboard
- name: email
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts email
shell: bash
type: shell
- label: "Trigger: ;d\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts dates --value=$ESPANSO_N\n \r```\n "
regex: ';d\[(?P<N>.*)\]'
replace: '{{d}}'
vars:
- name: clipboard
type: clipboard
- name: d
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts dates --value=$ESPANSO_N
shell: bash
type: shell
- label: "Trigger: ;cep\n\n\n \r```text\n \rOne of:\n\n04538-133\n\n04543-907\n\n21530-014\n\n22740-300\n\n25060-236\n\n28957-632\n\n30260-070\n\n70040-010\n \r```\n "
replace: '{{cep}}'
trigger: ;cep
vars:
- name: cep
params:
choices:
- 04538-133
- 04543-907
- 21530-014
- 22740-300
- 25060-236
- 28957-632
- 30260-070
- 70040-010
type: random
- label: "Trigger: ;lorem\n\n\n \r```text\n \rOne of:\n\nMagna pars studiorum, prodita quaerimus.\n\nA communi observantia non est recedendum.\n\nCurabitur est gravida et libero vitae dictum.\n\nCras mattis iudicium purus sit amet fermentum.\n\nUnam incolunt Belgae, aliam Aquitani, tertiam.\n\nGallia est omnis divisa in partes tres, quarum.\n\nNec dubitamus multa iter quae et nos invenerat.\n\nPhasellus laoreet lorem vel dolor tempus vehicula.\n\nCurabitur blandit tempus ardua ridiculus sed magna.\n\nInmensae subtilitatis, obscuris et malesuada fames.\n\nQuo usque tandem abutere, Catilina, patientia nostra?\n\nQuisque ut dolor gravida, placerat libero vel, euismod.\n\nPellentesque habitant morbi tristique senectus et netus.\n\nUllamco laboris nisi ut aliquid ex ea commodi consequat.\n\nPaullum deliquit, ponderibus modulisque suis ratio utitur.\n\nLorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua.\n \r```\n "
replace: '{{lorem}}'
trigger: ;lorem
vars:
- name: lorem
params:
choices:
- 'Magna pars studiorum, prodita quaerimus.'
- A communi observantia non est recedendum.
- Curabitur est gravida et libero vitae dictum.
- Cras mattis iudicium purus sit amet fermentum.
- 'Unam incolunt Belgae, aliam Aquitani, tertiam.'
- 'Gallia est omnis divisa in partes tres, quarum.'
- Nec dubitamus multa iter quae et nos invenerat.
- Phasellus laoreet lorem vel dolor tempus vehicula.
- Curabitur blandit tempus ardua ridiculus sed magna.
- 'Inmensae subtilitatis, obscuris et malesuada fames.'
- 'Quo usque tandem abutere, Catilina, patientia nostra?'
- 'Quisque ut dolor gravida, placerat libero vel, euismod.'
- Pellentesque habitant morbi tristique senectus et netus.
- Ullamco laboris nisi ut aliquid ex ea commodi consequat.
- 'Paullum deliquit, ponderibus modulisque suis ratio utitur.'
- >-
Lorem ipsum dolor sit amet, consectetur adipisici elit, sed
eiusmod tempor incidunt ut labore et dolore magna aliqua.
type: random
- label: "Trigger: ;blog\n\n\n \r```text\n \rhttps://garcez.dev\n \r```\n "
replace: 'https://garcez.dev'
trigger: ;blog
- label: "Trigger: ;git\n\n\n \r```text\n \rhttps://github.com/g4rcez\n \r```\n "
replace: 'https://github.com/g4rcez'
trigger: ;git
- label: "Trigger: ;twitter\n\n\n \r```text\n \rhttps://x.com/garcez_allan\n \r```\n "
replace: 'https://x.com/garcez_allan'
trigger: ;twitter
- label: "Trigger: ;dots\n\n\n \r```text\n \rhttps://github.com/g4rcez/dotfiles\n \r```\n "
replace: 'https://github.com/g4rcez/dotfiles'
trigger: ;dots
- label: "Trigger: ;youtube\n\n\n \r```text\n \rhttps://www.youtube.com/@allangarcez\n \r```\n "
replace: 'https://www.youtube.com/@allangarcez'
trigger: ;youtube
- label: "Trigger: ;linkedin\n\n\n \r```text\n \rhttps://www.linkedin.com/in/allan-garcez/\n \r```\n "
replace: 'https://www.linkedin.com/in/allan-garcez/'
trigger: ;linkedin
- label: "Trigger: ;date\n\n\n \r```text\n \rdate -> %d/%m/%Y\n \r```\n "
replace: '{{date}}'
trigger: ;date
vars:
- name: date
params:
format: '%d/%m/%Y'
type: date
- label: "Trigger: ;time\n\n\n \r```text\n \rdate -> %H:%M\n \r```\n "
replace: '{{time}}'
trigger: ;time
vars:
- name: time
params:
format: '%H:%M'
type: date
- label: "Trigger: ;now\n\n\n \r```text\n \rdate -> %d/%m/%Y %H:%M\n \r```\n "
replace: '{{now}}'
trigger: ;now
vars:
- name: now
params:
format: '%d/%m/%Y %H:%M'
type: date
- label: "Trigger: ;mdl\n\n\n \r```text\n \rlink\n \r```\n "
replace: '[$|$]({{link}})'
trigger: ;mdl
vars:
- name: link
type: clipboard
- label: "Trigger: ;hex\n\n\n \r```text\n \r{{hex}}\n \r```\n "
replace: '{{hex}}'
trigger: ;hex
vars:
- name: form
params:
layout: '[[input]]'
type: form
- name: hex
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts colors --mode=hex
--value="{{form.input}}"
shell: bash
type: shell
- label: "Trigger: ;hsl\n\n\n \r```text\n \r{{hsl}}\n \r```\n "
replace: '{{hsl}}'
trigger: ;hsl
vars:
- name: form
params:
layout: '[[input]]'
type: form
- name: hsl
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts colors --mode=hsl
--value="{{form.input}}"
shell: bash
type: shell
- label: "Trigger: ;rgb\n\n\n \r```text\n \r{{rgb}}\n \r```\n "
replace: '{{rgb}}'
trigger: ;rgb
vars:
- name: form
params:
layout: '[[input]]'
type: form
- name: rgb
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts colors --mode=rgb
--value="{{form.input}}"
shell: bash
type: shell
- label: "Trigger: ;sort\n\n\n \r```text\n \r! awk '{ print length(), $0 | \"sort -n | cut -d\\\\ -f2-\" }'\n \r```\n "
replace: '! awk ''{ print length(), $0 | "sort -n | cut -d\\ -f2-" }'''
trigger: ;sort
- label: "Trigger: ;blz\n\n\n \r```text\n \r\U0001F44D\U0001F3FE\n \r```\n "
replace: "\U0001F44D\U0001F3FE"
trigger: ;blz
- label: "Trigger: ;cry\n\n\n \r```text\n \r\U0001F62D\n \r```\n "
replace: "\U0001F62D"
trigger: ;cry
- label: "Trigger: ;deal\n\n\n \r```text\n \r\U0001F91D\U0001F3FE\n \r```\n "
replace: "\U0001F91D\U0001F3FE"
trigger: ;deal
- label: "Trigger: ;eye\n\n\n \r```text\n \r\U0001F440\n \r```\n "
replace: "\U0001F440"
trigger: ;eye
- label: "Trigger: ;pray\n\n\n \r```text\n \r\U0001F64F\U0001F3FE\n \r```\n "
replace: "\U0001F64F\U0001F3FE"
trigger: ;pray
- label: "Trigger: ;s2\n\n\n \r```text\n \r❤️\n \r```\n "
replace: ❤️
trigger: ;s2
- label: "Trigger: ;party\n\n\n \r```text\n \r\U0001F973\n \r```\n "
replace: "\U0001F973"
trigger: ;party
- label: "Trigger: ;boom\n\n\n \r```text\n \r\U0001F92F\n \r```\n "
replace: "\U0001F92F"
trigger: ;boom
- label: "Trigger: ;up\n\n\n \r```text\n \r\U0001F64C\U0001F3FE\n \r```\n "
replace: "\U0001F64C\U0001F3FE"
trigger: ;up
- label: "Trigger: ;idk\n\n\n \r```text\n \r'¯\\\\_(ツ)_/¯'\n \r```\n "
replace: '''¯\\_(ツ)_/¯'''
trigger: ;idk
- label: "Trigger: ;tnc\n\n\n \r```text\n \r$|$\n……..…../´¯/)……….. (\\¯`\\\r\n…………/….//……….. …\\\\….\\\r\n………../….//………… ….\\\\….\\\r\n…../´¯/…./´¯\\………../¯ `\\….\\¯`\\\r\n.././…/…./…./.|_……_| .\\….\\….\\…\\.\\..\r\n(.(….(….(…./.)..)..(..(. \\….)….)….).)\r\n.\\…………….\\/…/….\\. ..\\/………\n \r```\n "
replace: "$|$\n……..…../´¯/)……….. (\\¯`\\\r\n…………/….//……….. …\\\\….\\\r\n………../….//………… ….\\\\….\\\r\n…../´¯/…./´¯\\………../¯ `\\….\\¯`\\\r\n.././…/…./…./.|_……_| .\\….\\….\\…\\.\\..\r\n(.(….(….(…./.)..)..(..(. \\….)….)….).)\r\n.\\…………….\\/…/….\\. ..\\/………"
trigger: ;tnc
- label: 'Snippet: Create a default import based on lib'
replace: '{{imp}}'
trigger: ;imp
vars:
- name: name
params:
layout: 'name [[name]]'
type: form
- name: imp
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts snippets --variables
["\"name={{name.name}}\""] --json
"eyJibG9jayI6eyJ0eXBlIjoiY29kZV9ibG9jayIsImNvZGUiOiJpbXBvcnQgJHt7bmFtZXxjYXBpdGFsaXplfX0gZnJvbSBcIiR7e25hbWV9fVwiOyIsImxhbmd1YWdlIjoidHlwZXNjcmlwdCJ9LCJmcm9udG1hdHRlciI6eyJ0aXRsZSI6ImltcG9ydERlZmF1bHRUeXBlc2NyaXB0IiwiZGVzY3JpcHRpb24iOiJDcmVhdGUgYSBkZWZhdWx0IGltcG9ydCBiYXNlZCBvbiBsaWIiLCJzaG9ydGN1dCI6ImltcCIsInRhZ3MiOlsidHlwZXNjcmlwdCIsImphdmFzY3JpcHQiXX0sIm1hdGNoZXMiOlsibmFtZXxjYXBpdGFsaXplIiwibmFtZSJdfQ=="
shell: bash
type: shell
- label: 'Snippet: Create a named import'
replace: '{{inm}}'
trigger: ;inm
vars:
- name: name
params:
layout: 'name [[name]]'
type: form
- name: inm
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts snippets --variables
["\"name={{name.name}}\""] --json
"eyJibG9jayI6eyJ0eXBlIjoiY29kZV9ibG9jayIsImNvZGUiOiJpbXBvcnQgeyAkfCQgfSBmcm9tIFwiJHt7bmFtZX19XCI7IiwibGFuZ3VhZ2UiOiJ0eXBlc2NyaXB0In0sImZyb250bWF0dGVyIjp7InRpdGxlIjoibmFtZWRJbXBvcnQiLCJkZXNjcmlwdGlvbiI6IkNyZWF0ZSBhIG5hbWVkIGltcG9ydCIsInNob3J0Y3V0IjoiaW5tIiwidGFncyI6WyJ0eXBlc2NyaXB0IiwiamF2YXNjcmlwdCJdfSwibWF0Y2hlcyI6WyJuYW1lIl19"
shell: bash
type: shell
- label: 'Snippet: Create a functional component using correct types'
replace: '{{rfc}}'
trigger: ;rfc
vars:
- name: name
params:
layout: 'name [[name]]'
type: form
- name: rfc
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts snippets --variables
["\"name={{name.name}}\""] --json
"eyJibG9jayI6eyJ0eXBlIjoiY29kZV9ibG9jayIsImNvZGUiOiJ0eXBlIFByb3BzID0ge307XG5cbmNvbnN0ICR7e25hbWV8Y2FwaXRhbGl6ZX19ID0gKHByb3BzOiBQcm9wc1dpdGhDaGlsZHJlbjxQcm9wcz4pID0+IHtcbiAgICByZXR1cm4gJHwkIDtcbn0iLCJsYW5ndWFnZSI6InR5cGVzY3JpcHQifSwiZnJvbnRtYXR0ZXIiOnsidGl0bGUiOiJuZXctY29tcG9uZW50IiwiZGVzY3JpcHRpb24iOiJDcmVhdGUgYSBmdW5jdGlvbmFsIGNvbXBvbmVudCB1c2luZyBjb3JyZWN0IHR5cGVzIiwic2hvcnRjdXQiOiJyZmMiLCJ0YWdzIjpbInJlYWN0IiwidHlwZXNjcmlwdCJdfSwibWF0Y2hlcyI6WyJuYW1lfGNhcGl0YWxpemUiXX0="
shell: bash
type: shell
- label: 'Snippet: Check if key exists in object'
replace: '{{has}}'
trigger: ;has
vars:
- name: has
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts snippets --variables []
--json
"eyJibG9jayI6eyJ0eXBlIjoiY29kZV9ibG9jayIsImNvZGUiOiJleHBvcnQgY29uc3QgaGFzID0gPFQgZXh0ZW5kcyB7fSwgSyBleHRlbmRzIGtleW9mIFQ+KG86IFQsIGs6IEspOiBrIGlzIEsgPT4gT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG8sIGspOyIsImxhbmd1YWdlIjoidHlwZXNjcmlwdCJ9LCJmcm9udG1hdHRlciI6eyJ0aXRsZSI6Im9iamVjdC1oYXMiLCJkZXNjcmlwdGlvbiI6IkNoZWNrIGlmIGtleSBleGlzdHMgaW4gb2JqZWN0Iiwic2hvcnRjdXQiOiJoYXMiLCJ0YWdzIjpbInR5cGVzY3JpcHQiLCJqYXZhc2NyaXB0Il19LCJtYXRjaGVzIjpbXX0="
shell: bash
type: shell
- label: 'Snippet: Override properties in A using B type'
replace: '{{override}}'
trigger: ;override
vars:
- name: override
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts snippets --variables []
--json
"eyJibG9jayI6eyJ0eXBlIjoiY29kZV9ibG9jayIsImNvZGUiOiJleHBvcnQgdHlwZSBPdmVycmlkZTxTb3VyY2UsIE5ldz4gPSBPbWl0PFNvdXJjZSwga2V5b2YgTmV3PiAmIE5ldzsiLCJsYW5ndWFnZSI6InR5cGVzY3JpcHQifSwiZnJvbnRtYXR0ZXIiOnsidGl0bGUiOiJvdmVycmlkZSIsImRlc2NyaXB0aW9uIjoiT3ZlcnJpZGUgcHJvcGVydGllcyBpbiBBIHVzaW5nIEIgdHlwZSIsInNob3J0Y3V0Ijoib3ZlcnJpZGUiLCJ0YWdzIjpbInR5cGVzY3JpcHQiXX0sIm1hdGNoZXMiOltdfQ=="
shell: bash
type: shell
- label: 'Snippet: Merge types in a beautiful way'
replace: '{{tsmerge}}'
trigger: ;tsmerge
vars:
- name: tsmerge
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts snippets --variables []
--json
"eyJibG9jayI6eyJ0eXBlIjoiY29kZV9ibG9jayIsImNvZGUiOiJ0eXBlIE1lcmdlPFQ+ID0geyBbSyBpbiBrZXlvZiBUXTogVFtLXSB9ICYge307IiwibGFuZ3VhZ2UiOiJ0eXBlc2NyaXB0In0sImZyb250bWF0dGVyIjp7InRpdGxlIjoicHJldHR5LXRzIiwiZGVzY3JpcHRpb24iOiJNZXJnZSB0eXBlcyBpbiBhIGJlYXV0aWZ1bCB3YXkiLCJzaG9ydGN1dCI6InRzbWVyZ2UiLCJ0YWdzIjpbInR5cGVzY3JpcHQiXX0sIm1hdGNoZXMiOltdfQ=="
shell: bash
type: shell
- label: 'Snippet: Create a utility type that limit the size of array'
replace: '{{arrs}}'
trigger: ;arrs
vars:
- name: arrs
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts snippets --variables []
--json
"eyJibG9jayI6eyJ0eXBlIjoiY29kZV9ibG9jayIsImNvZGUiOiJ0eXBlIEFycmF5U2l6ZTxULCBTaXplIGV4dGVuZHMgbnVtYmVyLCBBIGV4dGVuZHMgVFtdID0gW10+ID0gQVtcImxlbmd0aFwiXSBleHRlbmRzIFNpemUgPyBBIDogQXJyYXlTaXplPFQsIFNpemUsIFsuLi5BLCBUXT47IiwibGFuZ3VhZ2UiOiJ0eXBlc2NyaXB0In0sImZyb250bWF0dGVyIjp7InRpdGxlIjoidHlwZS1hcnJheS1zaXplIiwiZGVzY3JpcHRpb24iOiJDcmVhdGUgYSB1dGlsaXR5IHR5cGUgdGhhdCBsaW1pdCB0aGUgc2l6ZSBvZiBhcnJheSIsInNob3J0Y3V0IjoiYXJycyIsInRhZ3MiOlsidHlwZXNjcmlwdCIsImhhY2tzIl19LCJtYXRjaGVzIjpbXX0="
shell: bash
type: shell
- label: 'Snippet: Create a inline useState using $name as parameter'
replace: '{{ush}}'
trigger: ;ush
vars:
- name: state
params:
layout: 'state [[state]]'
type: form
- name: ush
params:
cmd: >-
$($HOME/.local/bin/mise which deno) run --allow-read
$HOME/dotfiles/espanso/main.ts snippets --variables
["\"state={{state.state}}\""] --json
"eyJibG9jayI6eyJ0eXBlIjoiY29kZV9ibG9jayIsImNvZGUiOiJjb25zdCBbJHt7c3RhdGV9fSwgc2V0JHt7c3RhdGV8Y2FwaXRhbGl6ZX19XSA9IHVzZVN0YXRlKCR8JCk7IiwibGFuZ3VhZ2UiOiJ0eXBlc2NyaXB0In0sImZyb250bWF0dGVyIjp7InRpdGxlIjoidXNlU3RhdGUiLCJkZXNjcmlwdGlvbiI6IkNyZWF0ZSBhIGlubGluZSB1c2VTdGF0ZSB1c2luZyAkbmFtZSBhcyBwYXJhbWV0ZXIiLCJzaG9ydGN1dCI6InVzaCIsInRhZ3MiOlsicmVhY3QiLCJ0eXBlc2NyaXB0IiwiZnJvbnRlbmQiXX0sIm1hdGNoZXMiOlsic3RhdGUiLCJzdGF0ZXxjYXBpdGFsaXplIl19"
shell: bash
type: shell
@smeech
Copy link

smeech commented Jan 20, 2025

The extension will need to be .yml (not .yaml) for it to work in Espanso, I'm afraid.
espanso/espanso#2184

Best wishes,

@g4rcez
Copy link
Author

g4rcez commented Jan 21, 2025

Thank you @smeech. This file was generated using a deno script in my dotfiles - https://github.com/g4rcez/dotfiles/blob/master/espanso.config.ts

@smeech
Copy link

smeech commented Jan 21, 2025

That's an impressive set of tools!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment