def _create_autostart_entry(autostart_data: AutostartSettings, autostart_file: Path):
try:<EOL><INDENT>source_desktop_file = get_source_desktop_file(autostart_data.desktop_file_name)<EOL><DEDENT>except FileNotFoundError:<EOL><INDENT>_logger.exception("<STR_LIT>".format(<EOL>autostart_data.desktop_file_name))<EOL><DEDENT>else:<EOL><INDENT>_logger.debug("<STR_LIT>".format(<EOL>source_desktop_file))<EOL>with open(str(source_desktop_file), "<STR_LIT:r>") as opened_source_desktop_file:<EOL><INDENT>desktop_file_content = opened_source_desktop_file.read()<EOL><DEDENT>desktop_file_content = "<STR_LIT:\n>".join(_manage_autostart_desktop_file_launch_flags(<EOL>desktop_file_content, autostart_data.switch_show_configure<EOL>)) + "<STR_LIT:\n>"<EOL>with open(str(autostart_file), "<STR_LIT:w>", encoding="<STR_LIT>") as opened_autostart_file:<EOL><INDENT>opened_autostart_file.write(desktop_file_content)<EOL><DEDENT>_logger.debug("<STR_LIT>".format(autostart_file))<EOL><DEDENT>
Create an autostart .desktop file in the autostart directory, if possible.