code: def on_gtk_prefer_dark_theme_toggled(self, chk):
          
          self.settings.general.set_boolean('gtk-prefer-dark-theme', chk.get_active())
          select_gtk_theme(self.settings)
docs: Set the `gtk_prefer_dark_theme' property in dconf