diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-11 09:58:33 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-11 09:58:33 -0400 |
| commit | c78124b3ed907e0cad2be47124fad081efe12332 (patch) | |
| tree | 2ccfdd1fdd7a3e4c86d9b46dc74e74817ba90e74 /main.py | |
| parent | a40e4ee5d25aecb9b86f63ca78e1a51e534ed035 (diff) | |
| download | decky-lsfg-vk-c78124b3ed907e0cad2be47124fad081efe12332.tar.gz decky-lsfg-vk-c78124b3ed907e0cad2be47124fad081efe12332.zip | |
rm mod files on plugin uninstall, clean up after ourselves
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -186,6 +186,35 @@ class Plugin: # plugin that may remain on the system async def _uninstall(self): decky.logger.info("lsfg-vk Installer uninstalled") + + # Clean up lsfg-vk files when the plugin is uninstalled + try: + user_home = os.path.expanduser("~") + lib_file = os.path.join(user_home, ".local", "lib", "liblsfg-vk.so") + json_file = os.path.join(user_home, ".local", "share", "vulkan", "implicit_layer.d", "VkLayer_LS_frame_generation.json") + + removed_files = [] + + # Remove library file if it exists + if os.path.exists(lib_file): + os.remove(lib_file) + removed_files.append(lib_file) + decky.logger.info(f"Removed {lib_file}") + + # Remove JSON file if it exists + if os.path.exists(json_file): + os.remove(json_file) + removed_files.append(json_file) + decky.logger.info(f"Removed {json_file}") + + if removed_files: + decky.logger.info(f"Cleaned up {len(removed_files)} lsfg-vk files during plugin uninstall") + else: + decky.logger.info("No lsfg-vk files found to clean up during plugin uninstall") + + except Exception as e: + decky.logger.error(f"Error cleaning up lsfg-vk files during uninstall: {str(e)}") + pass # Migrations that should be performed before entering `_main()`. |
