From be52ce98a61441a8f5e4fd2e8647d49e3106bb5f Mon Sep 17 00:00:00 2001 From: Mohamed Elbanna Date: Thu, 3 Apr 2025 15:20:38 +0200 Subject: [PATCH] Improve Linux cursor path detection to include extracted AppImage with correct usr structure and add debug output for found paths --- reset_machine_manual.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/reset_machine_manual.py b/reset_machine_manual.py index 1db8625..b539c65 100644 --- a/reset_machine_manual.py +++ b/reset_machine_manual.py @@ -51,14 +51,22 @@ def get_cursor_paths(translator=None) -> Tuple[str, str]: } if system == "Linux": - # Look for any AppImage mounts of Cursor - appimage_paths = glob.glob("/tmp/.mount_Cursor*/resources/app") - # Look for extracted AppImage directories - extracted_paths = glob.glob(os.path.expanduser("~/squashfs-root/resources/app")) + # Look for extracted AppImage with correct usr structure + extracted_usr_paths = glob.glob(os.path.expanduser("~/squashfs-root/usr/share/cursor/resources/app")) + # Also check current directory for extraction without home path prefix + current_dir_paths = glob.glob("squashfs-root/usr/share/cursor/resources/app") # Add any found paths to the Linux paths list - default_paths["Linux"].extend(appimage_paths) - default_paths["Linux"].extend(extracted_paths) + default_paths["Linux"].extend(extracted_usr_paths) + default_paths["Linux"].extend(current_dir_paths) + + # Print debug information + print(f"{Fore.CYAN}{EMOJI['INFO']} Available paths found:{Style.RESET_ALL}") + for path in default_paths["Linux"]: + if os.path.exists(path): + print(f"{Fore.GREEN}{EMOJI['SUCCESS']} {path} (exists){Style.RESET_ALL}") + else: + print(f"{Fore.RED}{EMOJI['ERROR']} {path} (not found){Style.RESET_ALL}") # If config doesn't exist, create it with default paths