eshrh / ames

Anki Media Extractor Script: Update anki cards with desktop audio and image on gnu/linux
GNU General Public License v3.0
47 stars 10 forks source link
anki language-learning

ames

Anki media extractor script (ames): Update Anki cards with desktop audio, screenshots, and clipboard sentences on GNU/Linux.

ames automates the process of adding information and media to your latest added Anki card, making immersion mining smoother and more efficient.

Requirements

Installation

General

  1. Download the ames.sh script somewhere safe.
  2. Edit the script and change the first two lines to match the names of your Anki model image and audio fields.
  3. Bind the following commands to any key in your DE, WM, sxhkd, xbindkeysrc, etc.
    • bash ~/path/to/ames.sh -r: press once to start recording, and again to stop and export the audio clip to your latest-created Anki card.
    • bash ~/path/to/ames.sh -s: prompt for an interactive screenshot selection.
    • bash ~/path/to/ames.sh -a: repeat the previous screenshot selection. If there is no previous selection, default to -s.
    • bash ~/path/to/ames.sh -w: screenshot the currently active window (requires xdotool).
    • bash ~/path/to/ames.sh -c: exports the currently copied text in the clipboard to the sentence field (requires xclip).

Arch users

  1. Install the ames package from the AUR.
  2. Copy the default config:
    mkdir -p ~/.config/ames/ && cp /usr/share/ames/config ~/.config/ames/config
  3. Edit the config file however you like, but make sure your Anki image and audio fields are correct.
  4. Bind the same commands however you want, but now the ames command should be in your PATH, so you can bind, for example, ames -s instead of bash ~/path/to/ames.sh -s.

GNU Make

  1. Move contrib/Makefile.contrib to the root of the project:
    cp contrib/Makefile.contrib Makefile
  2. sudo make install.
  3. See Arch users.

Notes

Contrib

The contrib directory stores some custom configurations that modify the functionality of ames.

Please see the README files in each of their respective directories for more information about usage.