Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Inspired by Andreas Thuresson here is an Espanso expansion that takes selected/highlighted text, triggered by :case, and offers a few manipulation options.
- - trigger: :case
- label: Modify and paste copied text
- replace: '{{output}}'
- vars:
- - name: clipb
- type: clipboard
- - name: script_choice
- type: choice
- params:
- values:
- - label: Uppercase
- id: echo ""{{clipb}}"" | tr [:lower:] [:upper:]
- - label: Lowercase
- id: echo ""{{clipb}}"" | tr [:upper:] [:lower:]
- - label: Initcase
- id: >-
- awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1))
- tolower(substr($i,2))}1' <<< "{{clipb}}"
- - label: Evaluate equation
- id: awk "BEGIN {print {{clipb}}}"
- - label: Word count
- id: echo "{{clipb}}" ; echo "{{clipb}}" | wc -w
- - label: Underline
- id: |
- input={{clipb}}
- output=""
- underline_char=$'\u0332'
- for ((i=0; i<${#input}; i++)); do
- output+="${input:$i:1}$underline_char"
- done
- echo "$output"
- - label: Email
- id: thunderbird -compose "to={{clipb}}"
- - name: output
- type: shell
- params:
- shell: bash
- cmd: '{{script_choice}}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement