This command-line tool is designed to be used with a global keyboard shortcut. When executing the tool, it shows the characters, words, and lines of the currently-selected text as a popup.
xsel
orxclip
to get the currently-selected text (both are supported)zenity
orkdialog
to display the popup. One of them should be installed by default on every system with GNOME or KDE.