{"id":20060504,"url":"https://github.com/eshrh/ames","last_synced_at":"2025-05-11T21:04:15.694Z","repository":{"id":38273655,"uuid":"335494062","full_name":"eshrh/ames","owner":"eshrh","description":"Anki Media Extractor Script: Update anki cards with desktop audio and image on gnu/linux","archived":false,"fork":false,"pushed_at":"2024-12-18T07:05:39.000Z","size":86,"stargazers_count":54,"open_issues_count":1,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-11T21:01:56.860Z","etag":null,"topics":["anki","language-learning"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eshrh.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":"2021-02-03T03:17:28.000Z","updated_at":"2025-03-02T10:36:05.000Z","dependencies_parsed_at":"2024-12-18T08:29:12.012Z","dependency_job_id":null,"html_url":"https://github.com/eshrh/ames","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshrh%2Fames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshrh%2Fames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshrh%2Fames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshrh%2Fames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eshrh","download_url":"https://codeload.github.com/eshrh/ames/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253633008,"owners_count":21939388,"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":["anki","language-learning"],"created_at":"2024-11-13T13:14:57.726Z","updated_at":"2025-05-11T21:04:15.561Z","avatar_url":"https://github.com/eshrh.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ames\n\nAnki media extractor script (ames): Update Anki cards with\ndesktop audio, screenshots, and clipboard sentences on GNU/Linux.\n\names automates the process of adding information and media to your latest\nadded Anki card, making immersion mining smoother and more efficient.\n\n## Requirements\n\n+ A Bash interpreter.\n+ Anki and [AnkiConnect](https://ankiweb.net/shared/info/2055492159).\n  *Note that Anki must be running*.\n+ X11: Wayland version (wlroots) in `contrib/wayland`\n+ `pactl`: detecting and recording from audio monitors\n  (`pulseaudio` and `pipewire-pulse` tested).\n+ `ffmpeg`: encoding desktop audio.\n+ `maim`: screenshots.\n+ `xdotool`: detecting active windows.\n+ `libnotify`: sending notifications.\n+ `xclip`: pasting clipboard content (`xsel` is supported, but may be\n  removed in the future)\n\n## Installation\n\n### General\n\n1. Download the [ames.sh](./ames.sh) script somewhere safe.\n2. Edit the script and change the first two lines to match\n   the names of your Anki model image and audio fields.\n3. Bind the following commands to any key\n   in your DE, WM, sxhkd, xbindkeysrc, etc.\n    * `bash ~/path/to/ames.sh -r`: press once to start recording, and again\n       to stop and export the audio clip to your latest-created Anki card.\n    * `bash ~/path/to/ames.sh -s`: prompt for an interactive\n       screenshot selection.\n    * `bash ~/path/to/ames.sh -a`: repeat the previous screenshot selection.\n      If there is no previous selection, default to `-s`.\n    * `bash ~/path/to/ames.sh -w`: screenshot the currently active window\n      (requires xdotool).\n    * `bash ~/path/to/ames.sh -c`: exports the currently copied\n       text in the clipboard to the sentence field (requires xclip).\n\n### Arch users\n\n1. Install the `ames` package from the AUR.\n2. Copy the default config:\n```bash\nmkdir -p ~/.config/ames/ \u0026\u0026 cp /usr/share/ames/config ~/.config/ames/config\n```\n3. Edit the config file however you like, but make\n   sure your Anki image and audio fields are correct.\n4. Bind the same commands however you want, but now the `ames`\n   command should be in your `PATH`, so you can bind, for\n   example, `ames -s` instead of `bash ~/path/to/ames.sh -s`.\n\n### GNU Make\n\n1. Move `contrib/Makefile.contrib` to the root of the project:\n```bash\ncp contrib/Makefile.contrib Makefile\n```\n2. `sudo make install`.\n3. See [Arch users](#arch-users).\n\n## Notes\n\n+ You may also define config options in `~/.config/ames/config`.\n  These must be Bash variable declarations, with no spaces like\n  in the script or in the [sample configuration](./config).\n+ The aforementioned file is read after all functions have been\n  defined at runtime. This means that you can change any behavior of\n  ames by redefining a function in Bash. See the source code for\n  function names and some caveats for redefined functions to work. For\n  example custom configs, see the contrib directory.\n+ ames tries to pick the right output monitor automatically. If this doesn't\n  work for you, you can first list monitor sinks with `pactl list | grep -A2\n  '^Source #'` and then redefine the `OUTPUT_MONITOR` variable with the name\n  of the correct sink.\n+ By default, images are scaled to a height of 300px.\n+ Prefix your ames command with `LANG=ja` for\n  Japanese notifications to achieve *maximum immersion*.\n\n## Contrib\n\nThe `contrib` directory stores some custom configurations that modify\nthe functionality of `ames`.\n\n+ `wayland`: replace X11-dependent tools with wayland (wlroots)\n  compatible tools\n+ `python`: replace command line tools with python programs, which\n  should work cross-platform. Also deals with ffmpeg's\n  recording/encoding delay.\n+ `jq`: replace regex-based response parsing with `jq`, leading to\n  better error messages.\n\nPlease see the README files in each of their respective directories\nfor more information about usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshrh%2Fames","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feshrh%2Fames","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshrh%2Fames/lists"}