Using CPU heat to generate electricity
The issue with thermoelectric generators is they are horrendously inefficient. 

For a CPU you HAVE to get rid of the heat they produce or they melt down. 

You could hook up a peltier module and extract a small amount of electricity from them but you would still need to dissipate the remainder of the heat via a classical heat exchange method. The amount of electricity generated would likely not be significant enough to warrant the cost of the setup.

You CAN also use peltiers as coolers. However, you need to ADD power to pump out the heat. That power then needs to be dissipated along with the heat you are removing via the heat-exchanger. In the end the latter needs to be larger so your net effect is worse.

Heat to power is a "holy grail" idea and is up there with cold fusion as a theoretical dream.

EDITED FOR CLARITY

Efficient DIRECT conversion from heat to electricity is a "holy grail" idea and is up there with cold fusion as a theoretical dream.