While looking for a way to activate an X window from the command line, I found two particularly relevant results. One on AskUbuntu and the other on SuperUser.
The answers given in both questions didn't really work for my particular use case, so I posted my own solution on both sites. According to meta stackexchange, crossposting answers shouldn't really be an issue. But I wanted to be sure it was really the case here.
Here are the corresponding links to both answers: