Try using xdg stuff.