Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions texpander.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down