caseChanger

caseChanger.sh: a shell script to change the case of text in editable controls

If you type or paste in UPPER CASE, but you want lower case, or Title Case, or slugged_lower_case, you may find this shell script and the menu that drives it useful.

The menu requires either gtkMenuPlus or myGtkMenu; it's included in the distribution archive for the former.

The script requires sed, tr, xclip and and xdotool, the latter two of which you'll have to fetch from repositories if you haven't already.

It also invokes zenity (if installed) for error messages, so you could fetch that too.

sudo apt-get install xclip xdotool zenity

will do the trick.

Put caseChanger.sh in a folder on your path (typically $HOME/bin);

Put the menu configuration file (clip_menu) anywhere.

Assign a keyboard shortcut or launcher in a panel to:

gtkMenuPlus path_to/clip_menu

Highlight text in any editable control.

Make sure the window containing that control has focus.

Hit the shortcut key, choose an option from the menu.

If you have no text selected when you trigger the menu, you'll get either a zenity message of an error, or if zenity isn't available, no behaviour.

You can comment out a line in caseChanger.sh (REQUIRE_SELECTION=1) if you want the contents of the clipboard to be case-changed if there's no selection.

As a special case, if you have a file selected in nautilus same script should work.

If you want to make the same feature work for another file manager, you'll have to edit caseChanger.sh at at least three points (all commented).

Latest version of caseChanger.sh in the distribution archive for gtkMenuPlus.