From b532890a9d00baf1f7ed202aafa4dfffa15b88cc Mon Sep 17 00:00:00 2001 From: thee veventh Date: Sun, 5 Dec 2021 09:51:36 -0500 Subject: [PATCH] Added ability to insert generate dynamically generated text. --- texpander.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/texpander.sh b/texpander.sh index 5e7e9ca..91e9454 100755 --- a/texpander.sh +++ b/texpander.sh @@ -36,12 +36,20 @@ then # Preserve the current value of the clipboard clipboard=$(xsel -b -o) - # Put text in primary buffer for Shift+Insert pasting - echo -n "$(cat "$path")" | xsel -p -i - - # Put text in clipboard selection for apps like Firefox that - # insist on using the clipboard for all pasting - echo -n "$(cat "$path")" | xsel -b -i + if [ "${path: -4}" == ".cmd" ] + then + # Put text in primary buffer for Shift+Insert pasting + echo -n $($(cat "$path")) | xsel -p -i + # Put text in clipboard selection for apps like Firefox that + # insist on using the clipboard for all pasting + echo -n $($(cat "$path")) | xsel -b -i + else + # Put text in primary buffer for Shift+Insert pasting + echo -n "$(cat "$path")" | xsel -p -i + # Put text in clipboard selection for apps like Firefox that + # insist on using the clipboard for all pasting + echo -n "$(cat "$path")" | xsel -b -i + fi # Paste text into current active window sleep 0.3