Advertisement
smeech

Prefix clipboard content lines

Dec 7th, 2024 (edited)
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.48 KB | None | 0 0
  1.   # Prefix clipboard content lines with (A), (B), etc. using Zsh
  2.   # Espanso
  3.   - trigger: :test
  4.     replace: '{{output}}'
  5.     vars:
  6.       - name: clipb
  7.         type: clipboard
  8.       - name: output
  9.         type: shell
  10.         params:
  11.           shell: bash
  12.           cmd: |
  13.            setopt KSH_ARRAYS
  14.             prefixes=({A..Z}); i=0
  15.             echo "{{clipb}}" | while read -r line; do
  16.               echo "(${prefixes[i]}) $line"
  17.               ((i++))
  18.             done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement