Heat the butter in a large skillet over medium heat. Add the onions with a big pinch of salt. Cook, stirring often, over medium heat, just until the onions start to soften, for 10 to 15 minutes. Reduce the heat to low and cook, stirring often, until the onions are golden and caramelized, about 45 to 60 minutes, or even longer. Don’t get them too dark, as they will cook more in the oven. Look at my photos above for reference. While the onions cook, prepare the crust.
Add the flour, sugar, salt and thyme to a food processor and pulse just until combined. In a small bowl, whisk together the egg, vinegar and water. Add the cold butter pieces and grated cheese into the food processor and pulse until small coarse crumbs remain. Sprinkle the water/egg mixture over the flour and pulse again until the dough comes together.
Remove the dough and wrap it in plastic wrap. Refrigerate one dough for 30 minutes.
Preheat the oven to 400 degrees F.
Remove the crust from the fridge. Roll the crust into a… “rustic” shape – no shape necessary really – until it is about ¼ inch thick. Place the dough on a parchment-lined baking sheet. Sprinkle the other 4 ounces of gruyere to the crust, leaving a 2 inch border at the edges. Sprinkle on some dried thyme. Top with the caramelized onions. Fold the edges of the crust up. Brush the crust with the beaten egg wash.
Bake the galette until the crust is golden, about 40 to 45 minutes. Remove, let cool slightly and sprinkle with thyme. Serve immediately.