private void OnSettingsClick(object sender, RoutedEventArgs e)
        {
            Topmost = false;
            var sw = new SettingsWindow(config);

            if (sw.ShowDialog() ?? true)
            {
                config = sw.Configuration;
                Connect();
                UpdateDisplaySettings();
            }

            Topmost = true;
        }
        private void LoadConfig()
        {
            try
            {
                config = Configuration.Load();
            }
            catch (Exception ex)
            {
                config = default;
                MessageBox.Show($"Can't parse config, generating new one instead.\n\n--- EXCEPTION ---\n{ex}");
            }

            if (!config.Valid)
            {
                WriteDefaultConfig();
            }

            UpdateDisplaySettings();
        }