We obtain the exchange parameter of hybrid functionals by imposing the fundamental condition of a piecewise linear total energy with respect to electron number. For the Perdew-Burke-Ernzerhof (PBE) hybrid family of exchange-correlation functionals (i.e., for an approximate generalized Kohn-Sham theory) this implies that (i) the highest occupied molecular orbital corresponds to the ionization potential (I), (ii) the energy of the lowest unoccupied molecular orbital corresponds to the electron affinity (A), and (iii) the energies of the frontier orbitals are constant as a function of their occupation. In agreement with a previous study [N. Sai, Phys. Rev. Lett. 106, 226403 (2011)10.1103/PhysRevLett.106.226403], we find that these conditions are met for high values of the exact exchange admixture α and illustrate their importance for the tetrathiafulvalene-tetracyanoquinodimethane complex for which standard density functional theory functionals predict artificial electron transfer. We further assess the performance for atomization energies and weak interaction energies. We find that atomization energies are significantly underestimated compared to PBE or PBE0, whereas the description of weak interaction energies improves significantly if a 1/R6 van der Waals correction scheme is employed.