GithubHelp home page GithubHelp logo

feripe-a / ames Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eshrh/ames

0.0 0.0 0.0 70 KB

Anki Media Extractor Script: Update anki cards with desktop audio and image on gnu/linux

License: GNU General Public License v3.0

Shell 100.00%

ames's Introduction

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

  • A bash interpreter
  • Anki and AnkiConnect. Note that Anki must be running.
  • X: Wayland version coming soon (?)
  • pulseaudio and pactl: detecting and recording from audio monitors
  • ffmpeg: encoding desktop audio
  • maim: screenshots
  • xdotool: detecting active windows
  • libnotify: sending notifications
  • xsel: pasting clipboard content

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.
    • sh ~/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.
    • sh ~/path/to/ames.sh -s: prompt for an interactive screenshot selection
    • sh ~/path/to/ames.sh -a: repeat the previous screenshot selection. If there is no previous selection, default to -s.
    • sh ~/path/to/ames.sh -w: screenshot the currently active window (requires xdotool)
    • sh ~/path/to/ames.sh -c: pasted the currently copied sentence in the clipboard (requires xsel)

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 sh ~/path/to/ames.sh -s

Notes

  • You may also define config options in ~/.config/ames/config. These must be bash variable declarations, with no spaces like in the script.
  • ames tries to pick the right output monitor automatically. If this doesn't work for you, you can first list monitor sinks with pactl list | grep -A2 '^Source #' and then redefine the OUTPUT_MONITOR variable in the script or a config file with the name of the correct sink.
  • By default, images are scaled to a height of 300px
  • Prefix your ames command with LANG=ja for japanese notifications to achieve maximum immersion

ames's People

Contributors

eshrh avatar tatsumoto-ren avatar eyalmazuz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.