{"id":50798511,"url":"https://github.com/algebrain/xed-autosave-module","last_synced_at":"2026-06-12T17:03:24.376Z","repository":{"id":353573555,"uuid":"1219706648","full_name":"algebrain/xed-autosave-module","owner":"algebrain","description":"Autosave plugin for Xed editor. Saves changes after inactivity, creates backups for existing files.","archived":false,"fork":false,"pushed_at":"2026-04-24T12:52:25.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T14:37:25.646Z","etag":null,"topics":["autosave","backup","gedit","linux-mint","python","text-editor","xed-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/algebrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-24T06:26:43.000Z","updated_at":"2026-04-24T13:00:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/algebrain/xed-autosave-module","commit_stats":null,"previous_names":["algebrain/xed-autosave-module"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/algebrain/xed-autosave-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algebrain%2Fxed-autosave-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algebrain%2Fxed-autosave-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algebrain%2Fxed-autosave-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algebrain%2Fxed-autosave-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/algebrain","download_url":"https://codeload.github.com/algebrain/xed-autosave-module/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algebrain%2Fxed-autosave-module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34253943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autosave","backup","gedit","linux-mint","python","text-editor","xed-plugin"],"created_at":"2026-06-12T17:03:18.700Z","updated_at":"2026-06-12T17:03:19.453Z","avatar_url":"https://github.com/algebrain.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hadron Autosave\n\n\u003e **Warning!**\n\u003e\n\u003e This plugin can be dangerous. If you accidentally change a file, the change\n\u003e may be saved to disk automatically before you notice it. Use it only if you\n\u003e are comfortable with automatic in-place saves.\n\nHadron Autosave plugin for [Xed](https://github.com/linuxmint/xed), the Linux\nMint text editor.\n\nThe plugin saves changed documents shortly after editing stops. Before an\nexisting file is autosaved, the previous on-disk version is copied to a private\nbackup directory. New, unnamed documents are written to a private autosave\ndirectory and can be restored on the next Xed start.\n\n## Features\n\n- Saves changed documents after 500 ms of inactivity.\n- Saves existing files in place only after creating a backup of the previous\n  on-disk version.\n- Shows a warning bar for autosaved existing files.\n- Lets you restore the previous version or accept the current autosaved version.\n- Stores new unsaved documents in `~/.xed/hadron-autosave`.\n- Restores autosaved unsaved documents when the plugin starts.\n- Deletes an autosaved unsaved document when its tab is explicitly closed.\n- Keeps autosaved unsaved documents when the whole Xed window is closed, so\n  they can be restored later.\n- Optional file-based debug logging for manual testing.\n\n## Installation\n\nCopy the plugin metadata file and package directory into Xed's user plugin\ndirectory:\n\n```bash\nmkdir -p ~/.local/share/xed/plugins\ncp hadron-autosave.plugin ~/.local/share/xed/plugins/\ncp -r hadron_autosave ~/.local/share/xed/plugins/\n```\n\nThen restart Xed and enable the plugin:\n\n```text\nEdit -\u003e Preferences -\u003e Extensions -\u003e Hadron Autosave\n```\n\nDepending on the desktop language, the plugin may appear as `Hadron Autosave`\nor `Адронное автосохранение`.\n\n## Usage\n\nAfter the plugin is enabled, no extra action is required.\n\nFor an existing file, edit the document and stop typing. After 500 ms, the\nplugin creates a backup of the current file on disk, then asks Xed to save the\nedited document.\n\nThe backup is stored under:\n\n```text\n~/.xed/hadron-autosave/backups\n```\n\nAfter autosave, a warning bar appears above the text. It shows when the backup\nwas last modified and provides two actions:\n\n- `Restore` restores the previous version from the backup, removes the backup,\n  and hides the warning bar.\n- `Accept Changes` keeps the current autosaved file, removes the backup, and\n  hides the warning bar.\n\nIf the current Xed/GTK environment supports confirmation dialogs, both actions\nask for confirmation first. If a backup exists when Xed starts, the original\nfile is opened again and the warning bar is shown. If the file is opened\nmanually while the backup still exists, the warning bar is shown as well.\n\nFor a new unnamed document, edit the document and stop typing. After 500 ms, the\nplugin writes an autosaved copy to:\n\n```text\n~/.xed/hadron-autosave\n```\n\nThe autosave index is stored in:\n\n```text\n~/.xed/hadron-autosave/index.json\n```\n\n## Debug Logging\n\nDebug logging is disabled by default. To enable it:\n\n```bash\nXED_AUTOSAVE_DEBUG=1 xed --standalone\n```\n\nThe default log file is:\n\n```text\n~/.xed/hadron-autosave/debug.log\n```\n\nYou can choose another log file:\n\n```bash\nXED_AUTOSAVE_DEBUG=1 XED_AUTOSAVE_DEBUG_LOG=/tmp/hadron-autosave-debug.log xed --standalone\n```\n\nThis repository also includes a helper script for local testing:\n\n```bash\n./xed-debug.sh\n```\n\nIt starts Xed in standalone mode with debug logging enabled.\n\n## Manual Checks\n\nUseful checks after changing the plugin:\n\n1. Start Xed through `./xed-debug.sh`.\n2. Create a new unnamed document, type text, wait briefly, and confirm that an\n   `unsaved-*.txt` file appears in `~/.xed/hadron-autosave`.\n3. Close only that tab and confirm that the corresponding `unsaved-*.txt` file\n   and `index.json` entry are removed.\n4. Create another unnamed document, wait for autosave, close the whole Xed\n   window, and confirm that the document is restored on the next start.\n5. Open a normal saved file, edit it, wait briefly, and confirm that a backup\n   appears in `~/.xed/hadron-autosave/backups`.\n6. Confirm that the warning bar shows the backup time and has `Restore` and\n   `Accept Changes` buttons.\n7. Use `Restore` and confirm that the previous file contents return and the\n   backup is removed.\n8. Repeat the edit and use `Accept Changes`; confirm that the backup is removed\n   and the next edit creates a new backup.\n9. Leave a backup unresolved, close Xed, start Xed again, and confirm that the\n   original file opens with the warning bar.\n\n## Development\n\nRun the test suite with the standard library test runner:\n\n```bash\npython3 -m unittest discover -s tests -q\n```\n\nRun the test suite with coverage:\n\n```bash\n.venv/bin/python -m coverage run -m unittest discover -s tests -q\n.venv/bin/python -m coverage report -m\n```\n\nThe tests cover storage behavior, backup behavior, delayed scheduling, debug\nlogging, document identity tracking, configuration, and the Xed save wrapper.\n\n## Notes\n\nXed's Python plugin API does not expose every internal save operation directly.\nFor already saved files, this plugin calls Xed's native save command from\n`libxed.so`. If that native command cannot be loaded, the plugin falls back to a\ndirect file write as a last resort.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgebrain%2Fxed-autosave-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falgebrain%2Fxed-autosave-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgebrain%2Fxed-autosave-module/lists"}