From dc8cbca8ce421a5bf7f70c482d893a3daa3499f6 Mon Sep 17 00:00:00 2001 From: Nigel1992 Date: Thu, 20 Mar 2025 23:43:01 +0100 Subject: [PATCH] fix: Update Linux machineId path to use lowercase cursor/machineid --- README.md | 1 + config.py | 6 +++--- reset_machine_manual.py | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 104cc99..6a8e480 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ storage_path = /Users/username/Library/Application Support/Cursor/User/globalSto sqlite_path = /Users/username/Library/Application Support/Cursor/User/globalStorage/state.vscdb # Machine ID Path | 機器ID路徑 machine_id_path = /Users/username/Library/Application Support/Cursor/machineId +# For Linux users: ~/.config/cursor/machineid [Timing] # Min Random Time | 最小隨機時間 diff --git a/config.py b/config.py index 9e522bc..8720412 100644 --- a/config.py +++ b/config.py @@ -64,9 +64,9 @@ def setup_config(translator=None): actual_home = f"/home/{sudo_user}" if sudo_user else os.path.expanduser("~") default_config['LinuxPaths'] = { - 'storage_path': os.path.abspath(os.path.join(actual_home, ".config/Cursor/User/globalStorage/storage.json")), - 'sqlite_path': os.path.abspath(os.path.join(actual_home, ".config/Cursor/User/globalStorage/state.vscdb")), - 'machine_id_path': os.path.expanduser("~/.config/Cursor/machineId"), + 'storage_path': os.path.abspath(os.path.join(actual_home, ".config/cursor/User/globalStorage/storage.json")), + 'sqlite_path': os.path.abspath(os.path.join(actual_home, ".config/cursor/User/globalStorage/state.vscdb")), + 'machine_id_path': os.path.expanduser("~/.config/cursor/machineid"), 'cursor_path': get_linux_cursor_path(), 'updater_path': os.path.expanduser("~/.config/cursor-updater") } diff --git a/reset_machine_manual.py b/reset_machine_manual.py index 0fb8a4a..975c6bd 100644 --- a/reset_machine_manual.py +++ b/reset_machine_manual.py @@ -96,7 +96,7 @@ def get_cursor_machine_id_path(translator=None) -> str: if not config.has_section('LinuxPaths'): config.add_section('LinuxPaths') config.set('LinuxPaths', 'machine_id_path', - os.path.expanduser("~/.config/Cursor/machineId")) + os.path.expanduser("~/.config/cursor/machineid")) return config.get('LinuxPaths', 'machine_id_path') elif sys.platform == "darwin": # macOS @@ -451,11 +451,11 @@ class MachineIDResetter: config.set('LinuxPaths', 'storage_path', os.path.abspath(os.path.join( actual_home, - ".config/Cursor/User/globalStorage/storage.json" + ".config/cursor/User/globalStorage/storage.json" ))) config.set('LinuxPaths', 'sqlite_path', os.path.abspath(os.path.join( actual_home, - ".config/Cursor/User/globalStorage/state.vscdb" + ".config/cursor/User/globalStorage/state.vscdb" ))) self.db_path = config.get('LinuxPaths', 'storage_path')