Use current system state to select xsession hack behavior

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>