John Hughes has departed Livingston to take over as Hartlepool first-team coach, the League One club have confirmed.