Skip to content

Instantly share code, notes, and snippets.

@GwyndolynMarchant
Last active September 10, 2020 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GwyndolynMarchant/26999fd44602e96b01ef1067f8d35fd6 to your computer and use it in GitHub Desktop.
Save GwyndolynMarchant/26999fd44602e96b01ef1067f8d35fd6 to your computer and use it in GitHub Desktop.
Script to automate replacing text with w i d e text
#!/bin/bash
# Author: Gwyndolyn Marchant <gwyn@shadenexus.com>
#
# Bind this to a keyboard shortcut and it should (hopefully) replace selected text with a w i d e version
windowid=$(xdotool getwindowfocus)
text=`xsel -o | sed -e 's/\(.\)/\1 /g'`
xdotool windowactivate --sync "$windowid" key Delete && xdotool type " ${text}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment