def write_tmp_i3status_config(self, tmpfile):
        """
        Given a temporary file descriptor, write a valid i3status config file
        based on the parsed one from 'i3status_config_path'.
        """
        # order += ...
        for module in self.py3_config["i3s_modules"]:
            self.write_in_tmpfile(f'order += "{module}"\n', tmpfile)
        self.write_in_tmpfile("\n", tmpfile)
        # config params for general section and each module
        for section_name in ["general"] + self.py3_config["i3s_modules"]:
            section = self.py3_config[section_name]
            self.write_in_tmpfile(f"{section_name} {{\n", tmpfile)
            for key, value in section.items():
                # don't include color values except in the general section
                if key.startswith("color"):
                    if (
                        section_name.split(" ")[0] not in I3S_COLOR_MODULES
                        or key not in I3S_ALLOWED_COLORS
                    ):
                        continue
                # Set known fixed format for time and tztime so we can work
                # out the timezone
                if section_name.split()[0] in TIME_MODULES:
                    if key == "format":
                        value = TZTIME_FORMAT
                    if key == "format_time":
                        continue
                # Set output_format to i3bar in general section so that we
                # receive predictable output from i3status, regardless of our
                # own output_format configuration
                if section_name == "general":
                    if key == "output_format":
                        value = "i3bar"
                if isinstance(value, bool):
                    value = f"{value}".lower()
                self.write_in_tmpfile(f'    {key} = "{value}"\n', tmpfile)
            self.write_in_tmpfile("}\n\n", tmpfile)
        tmpfile.flush()

        Given a temporary file descriptor, write a valid i3status config file
        based on the parsed one from 'i3status_config_path'.
        
py3status/i3status.py