Commit: 131502624b1176dcf5a15a6d60614ef885aa55ac
Parent: 7f7f2cc9b424ad3036570c3f97bb9c0b0a37a753
Author: Ren Tatsumoto
Date: Thu, 10 Sep 2020 02:41:37 +0300
this is more mpv-like
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -506,7 +506,14 @@ ankiconnect.append_media = function(note_id, audio_filename, snapshot_filename)
-- Ankiconnet will fail to update the note if the Anki Browser is open.
-- First, try to close the Anki Browser.
-- https://github.com/FooSoft/anki-connect/issues/82
- os.execute([[xdotool search --name 'Browse \([0-9]{1,} cards? shown; [0-9]{1,} selected\)' key Escape]])
+ subprocess {
+ 'xdotool',
+ 'search',
+ '--name',
+ [[Browse \([0-9]{1,} cards? shown; [0-9]{1,} selected\)]],
+ 'key',
+ 'Escape'
+ }
local args = {
action = "updateNoteFields",