{"id":15685626,"url":"https://github.com/dynobo/snippetstore","last_synced_at":"2025-05-07T17:29:32.400Z","repository":{"id":99583959,"uuid":"117130473","full_name":"dynobo/SnippetStore","owner":"dynobo","description":"Extension for Albert Launcher, used to store and retrieve coding snippets and other texts","archived":false,"fork":false,"pushed_at":"2019-01-23T20:14:09.000Z","size":281,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T12:21:32.849Z","etag":null,"topics":["albertlauncher"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dynobo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-01-11T17:24:58.000Z","updated_at":"2025-03-19T15:35:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"f291c76b-1f2e-43d7-907a-a2e9c29474ce","html_url":"https://github.com/dynobo/SnippetStore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynobo%2FSnippetStore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynobo%2FSnippetStore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynobo%2FSnippetStore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynobo%2FSnippetStore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dynobo","download_url":"https://codeload.github.com/dynobo/SnippetStore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252926204,"owners_count":21826265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["albertlauncher"],"created_at":"2024-10-03T17:27:59.821Z","updated_at":"2025-05-07T17:29:32.375Z","avatar_url":"https://github.com/dynobo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SnippetStore\nExtension for [Albert Launcher](https://albertlauncher.github.io/), used to store and retrieve code-snippets or other texts\n\nI coded this, because I like Albert and use it a lot, and I didn't find a nice tool for easy access to code snippets stored as plain text files on my drive.\n(imho plaintext files have the advantages over DBs or json/xml, that they are easier to sync e.g. with cloud and also accessible/readable without additional applications.)\n\n![screenshot](./snippet_store.png)\n\n## Features\n- Triggered by \"sn\"\n- Uses a directory with plain-text files as source\n- Search for text in those snippet-files\n- Rank results based on number, position and sourroundings of occurrences\n- Actions:\n   - Paste directly (default)\n   - Copy to clipboard\n   - Open in associated application\n   - Move to Trash bin\n   - Open Snippet-Folder (\"sn\" without searchterm)\n\n## Dependencies\n- [Send2Trash](https://pypi.python.org/pypi/Send2Trash): `pip install Send2Trash`\n- [xdotool](https://www.semicomplete.com/projects/xdotool) *search for it in your distro's repository*\n\n## Manual installation\nDownload [Snippet Store.py](https://github.com/dynobo/snippet_store/blob/master/Snippet%20Store.py) to one of Albert Launchers folders for python extensions:\n- ~/.local/share/albert/org.albert.extension.python/modules\n- /usr/local/share/albert/org.albert.extension.python/modules\n- /usr/share/albert/org.albert.extension.python/modules\n\nAdjust the configuration, which is currently hard coded:\n- `SNIPPET_PATH = '/home/holger/cumulus/Notes/snippets'` - Folder, where your snippet files are stored\n- `RECURSIVE = True` - Shall snippet folder be indexed recursively?\n- `SNIPPET_EXT = 'md'` - File extension of your snippet files\n- `iconPath = iconLookup('gedit')` - Icon file to be shown in Albert\n\nActivate in Albert:\n- Open Albert Launcher's Settings\n- Go to \"Extensions\"\n- Make sure the \"Python\"-Extension is activated\n- In the Python Extension settings, activate \"Snippet Store\"\n\n## Snippets\nThe first line of the snippet is always used as \"Text\" for Albert's results list. If the first line starts with '\u003e', this char is stripped.\n\nThe second line of the snippet is always used as \"Subtext\" for Albert's results list. If the first line starts with '\u003e', this char is stripped.\n\nAll text below 2nd line goes into the snippet and will be copied to clipboard.\n\nHowever, **if** the second line starts with a '\u003e', all text below the **3rd** line will be copied to clipboard.\n\n##### Examples:\n```\n\u003e mkconfig update grub\n\u003e Update grub configuration after kernel update to be sure that external keyboard works correctly.\nsudo grub-mkconfig -o /boot/grub/grub.cfg\n```\n\n```\n\u003e Show size of Directory\nsudo du -sh /data/mongodb\n```\n\nFor the results, see Screenshot above.\n\n## Roadmap\nNot sure if I ever do this, as I'm fine with the current state. But maybe if requested or of interest by others... *hint* *hint*\n- Create new snippet from clipboard\n- Move configuration out of source (not sure to where...)\n- Find a solution for \"Move to Trash\" without external dependencies\n- Test performance for many snippets\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynobo%2Fsnippetstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdynobo%2Fsnippetstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynobo%2Fsnippetstore/lists"}