Skip to content

Commit

Permalink
profiles: anki: allow lua
Browse files Browse the repository at this point in the history
Anki uses mpv to play media, which requires the lua interpreter.

Without this, anki displays this error in the console and falls back to
mplayer:

    mpv: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: Permission denied
    Traceback (most recent call last):
    File "/usr/lib/python3.12/site-packages/aqt/sound.py", line 854, in setup_audio
    mpvManager = MpvManager(base_folder, media_folder)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.12/site-packages/aqt/sound.py", line 408, in __init__
    super().__init__(window_id=None, debug=False)
    File "/usr/lib/python3.12/site-packages/aqt/mpv.py", line 442, in __init__
    super().__init__(*args, **kwargs)
    File "/usr/lib/python3.12/site-packages/aqt/mpv.py", line 104, in __init__
    self._start_socket()
    File "/usr/lib/python3.12/site-packages/aqt/mpv.py", line 194, in _start_socket
    raise MPVProcessError("unable to start process")
    aqt.mpv.MPVProcessError: unable to start process

    mpv too old or failed to open, reverting to mplayer
  • Loading branch information
Fidel Ramos authored and kmk3 committed Nov 19, 2024
1 parent 3a03bcd commit 3ec523f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions etc/profile-a-l/anki.profile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ include anki.local
# Persistent global definitions
include globals.local

# Add the following to anki.local if you don't need media playing/recording
# (lua is needed by mpv):
#ignore include allow-lua.inc

noblacklist ${DOCUMENTS}
noblacklist ${HOME}/.config/mpv
noblacklist ${HOME}/.local/share/Anki2
noblacklist ${HOME}/.mplayer

# Allow lua (blacklisted by disable-interpreters.inc)
include allow-lua.inc

# Allow python (blacklisted by disable-interpreters.inc)
include allow-python2.inc
include allow-python3.inc
Expand Down

0 comments on commit 3ec523f

Please sign in to comment.