Text this: Mechanical Foundations of the Generalized Second Law and the Irreversibility Principle