Created
June 15, 2023 13:45
-
-
Save kugelblitzz/e546021dc68d7fd34f027ad7f3f1f901 to your computer and use it in GitHub Desktop.
MyEspansoConfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# espanso match file | |
# For a complete introduction, visit the official docs at: https://espanso.org/docs/ | |
# You can use this file to define the base matches (aka snippets) | |
# that will be available in every application when using espanso. | |
# Matches are substitution rules: when you type the "trigger" string | |
# it gets replaced by the "replace" string. | |
matches: | |
# Simple text replacement | |
- trigger: ":espanso" | |
replace: "Hi there!" | |
# NOTE: espanso uses YAML to define matches, so pay attention to the indentation! | |
# But matches can also be dynamic: | |
# Print the current date | |
- trigger: ":date" | |
replace: "{{mydate}}" | |
vars: | |
- name: mydate | |
type: date | |
params: | |
format: "%m/%d/%Y" | |
# Print the output of a shell command | |
- trigger: ":shell" | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: shell | |
params: | |
cmd: "echo 'Hello from your shell'" | |
- trigger: ":puppet" | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: shell | |
params: | |
cmd: "echo 'puppet agent --enable; puppet agent -vt; puppet agent --disable;'" | |
- trigger: ":noop" | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: shell | |
params: | |
cmd: "echo 'puppet agent --enable; puppet agent -vt --noop; puppet agent --disable;'" | |
- trigger: ":ticket" | |
replace: | | |
Hi, | |
We have received the ticket, We will check and get back to you | |
Best regards, | |
Jonathan | |
- trigger: ":bkpdir" | |
replace: "mkdir -p /mnt/backups/{{mydate}}" | |
vars: | |
- name: mydate | |
type: date | |
params: | |
format: "%Y-%m-%d" | |
- trigger: ":cpybkp" | |
replace: "cp -rp $(find /mnt/ -iname config.json | grep -v backup | grep updates | cut -d/ -f 1-3 ) /mnt/backups/{{mydate}}" | |
vars: | |
- name: mydate | |
type: date | |
params: | |
format: "%Y-%m-%d" | |
- trigger: ":log" | |
replace: "tail -200f $(find /mnt/ -iname wso2carbon.log | grep -v backup )" | |
vars: | |
- name: mydate | |
type: date | |
params: | |
format: "%Y-%m-%d" | |
- trigger: ":k8s" | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: shell | |
params: | |
cmd: "echo 'alias k=kubectl'" | |
- trigger: ":u2" | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: shell | |
params: | |
cmd: "echo 'cat $(find /mnt/ -iname config.json | grep -v backup | grep updates )'" | |
# And much more! For more information, visit the docs: https://espanso.org/docs/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment