1540s, "to trifle," of unknown origin; of the fingers, first recorded 1670s. Figurative phrase twiddle one's thumbs "have nothing to do" is recorded from 1846; to twirl one's thumbs in the same sense is recorded from 1816. Related: Twiddled; twiddling.
The tilde, a diacritical mark used especially in Spanish
To change something in a small way; tweak (1980s+ Computer)