Only handle links if HQ is running

and improved handling of duplicated text on clipboard