Accessibility Tweak: How to prevent accidentally selected text from getting replaced when typing?

The selected text is copied to PRIMARY selection buffer. You could monitor it and send Right arrow key if it changes, to move to the end of the selected text. This works with any application, not only LibreOffice/Thunderbird, at least on X11+GNOME.

# Install dependencies
sudo apt install xdotool  git build-essential libx11-dev libxtst-dev

# Compile clipnotify
git clone https://github.com/cdown/clipnotify.git
cd clipnotify
make

# Run the monitor, could be on ~/.xprofile, or under ~/.config/autostart/
while ./clipnotify;do xdotool key Right; done

# Optional: To kill the monitor on any other Terminal
killall clipnotify

Probably are better ways to do this, maybe using Dbus.

Inspiration and useful links:

  • bash - Detect clipboard copy/paste event and modify clipboard contents - Ask Ubuntu.
  • Arch Wiki