In a large skillet, melt butter over medium-low heat.
Add sliced onions and stir well to combine with butter.
Season with salt and sugar.
Cover and cook over low heat, stirring occasionally, until dark brown and caramelized, about one hour.
Once caramelized, add thyme and stir to combine.
Add beer/broth/wine to deglaze the pan, using a wooden spatula to scrape up any bits.
Let beer/broth/wine cook off for about 1 minute.
Remove from heat.
Butter each slice of bread on one side.
In a skillet over medium heat, place 4 slices of the bread, buttered side down.
Top each slice with approximately 1/3 cup of cheese, then 1/4 of the onion mixture, and then top with remaining slices of bread.
Cover and cook about 4-5 minutes, until bottom slice of bread is golden brown.
Flip and repeat on second side.
Serve and enjoy!