aegisub hotkeys and scripts
This commit is contained in:
parent
d2df53804c
commit
210e7273c5
72
.aegisub/automation/autoload/karaoke-adjust-1sec.lua
Normal file
72
.aegisub/automation/autoload/karaoke-adjust-1sec.lua
Normal file
|
@ -0,0 +1,72 @@
|
|||
local tr = aegisub.gettext
|
||||
|
||||
script_name = tr"Karaoke 1sec adjust lead-in"
|
||||
script_description = tr"Adjust karaoke leadin to 1sec"
|
||||
script_author = "Flore"
|
||||
script_version = "1.00"
|
||||
|
||||
include("cleantags.lua")
|
||||
|
||||
leadinmsec = 1000 --lead in time can be changed here
|
||||
|
||||
ktag = "\\[kK][fo]?%d+" --pattern used to detect karaoke tags
|
||||
|
||||
function adjust_1sec(subs, sel)
|
||||
|
||||
function hasleadin(line)--check if there is an existing lead in (2 consecutive bracket with karaoke tags at the start of the line)
|
||||
return line.text:find("^{[^{}]-" .. ktag .. "[^{}]-}{[^{}]-" .. ktag .. "[^{}]-}")
|
||||
end
|
||||
|
||||
function removeleadin(line)
|
||||
if not hasleadin(line) then
|
||||
return line
|
||||
end
|
||||
|
||||
leadin = tonumber( line.text:match("^{[^{}]-\\[kK][fo]?(%d+)[^{}]-}{[^{}]-" .. ktag .. "[^{}]-}") ) --read lead-in value
|
||||
line.text = line.text:gsub("^({[^{}]-)\\[kK][fo]?%d+(.-}{[^{}]-" .. ktag .. ".-})","%1%2") --remove lead in
|
||||
|
||||
line.text = cleantags(line.text) --clean tags
|
||||
|
||||
line.start_time = line.start_time + leadin*10 --adjust start time
|
||||
|
||||
--aegisub.log(line.text)
|
||||
|
||||
return line
|
||||
end
|
||||
|
||||
|
||||
for _, i in ipairs(sel) do
|
||||
local line = subs[i]
|
||||
|
||||
line.text = cleantags(line.text)
|
||||
|
||||
if( line.text:find(ktag)) then--don't do anything if there is no ktags in this line
|
||||
|
||||
|
||||
--start by removing existing lead-in
|
||||
while hasleadin(line) do
|
||||
if aegisub.progress.is_cancelled() then return end
|
||||
line = removeleadin(line)
|
||||
end
|
||||
|
||||
|
||||
--then add our lead in
|
||||
|
||||
|
||||
if line.start_time >= leadinmsec then
|
||||
line.text = string.format("{\\k%d}%s",leadinmsec/10, line.text)
|
||||
line.start_time = line.start_time - leadinmsec
|
||||
|
||||
else --if line starts too early to put the needed lead in, make the line start at time 0 and fill with appropriate lead in
|
||||
line.text = string.format("{\\k%d}%s",line.start_time/10, line.text)
|
||||
line.start_time = 0
|
||||
end
|
||||
|
||||
|
||||
subs[i] = line
|
||||
end
|
||||
end
|
||||
aegisub.set_undo_point(tr"1sec adjust lead-in")
|
||||
end
|
||||
|
||||
aegisub.register_macro(script_name, script_description, adjust_1sec)
|
1
.aegisub/automation/autoload/ua.BlurAndGlow.lua
Symbolic link
1
.aegisub/automation/autoload/ua.BlurAndGlow.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.BlurAndGlow.lua
|
1
.aegisub/automation/autoload/ua.ChangeCase.lua
Symbolic link
1
.aegisub/automation/autoload/ua.ChangeCase.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.ChangeCase.lua
|
1
.aegisub/automation/autoload/ua.Colorize.lua
Symbolic link
1
.aegisub/automation/autoload/ua.Colorize.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.Colorize.lua
|
1
.aegisub/automation/autoload/ua.Cycles.lua
Symbolic link
1
.aegisub/automation/autoload/ua.Cycles.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.Cycles.lua
|
1
.aegisub/automation/autoload/ua.EncodeHardsub.lua
Symbolic link
1
.aegisub/automation/autoload/ua.EncodeHardsub.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.EncodeHardsub.lua
|
1
.aegisub/automation/autoload/ua.FadeWorks.lua
Symbolic link
1
.aegisub/automation/autoload/ua.FadeWorks.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.FadeWorks.lua
|
1
.aegisub/automation/autoload/ua.HYDRA.lua
Symbolic link
1
.aegisub/automation/autoload/ua.HYDRA.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.HYDRA.lua
|
1
.aegisub/automation/autoload/ua.JoinSplitSnap.lua
Symbolic link
1
.aegisub/automation/autoload/ua.JoinSplitSnap.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.JoinSplitSnap.lua
|
1
.aegisub/automation/autoload/ua.JumpToNext.lua
Symbolic link
1
.aegisub/automation/autoload/ua.JumpToNext.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.JumpToNext.lua
|
1
.aegisub/automation/autoload/ua.LineBreaker.lua
Symbolic link
1
.aegisub/automation/autoload/ua.LineBreaker.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.LineBreaker.lua
|
1
.aegisub/automation/autoload/ua.Masquerade.lua
Symbolic link
1
.aegisub/automation/autoload/ua.Masquerade.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.Masquerade.lua
|
1
.aegisub/automation/autoload/ua.MultiCopy.lua
Symbolic link
1
.aegisub/automation/autoload/ua.MultiCopy.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.MultiCopy.lua
|
1
.aegisub/automation/autoload/ua.MultiLineEditor.lua
Symbolic link
1
.aegisub/automation/autoload/ua.MultiLineEditor.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.MultiLineEditor.lua
|
1
.aegisub/automation/autoload/ua.Multiplexer.lua
Symbolic link
1
.aegisub/automation/autoload/ua.Multiplexer.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.Multiplexer.lua
|
1
.aegisub/automation/autoload/ua.NecrosCopy.lua
Symbolic link
1
.aegisub/automation/autoload/ua.NecrosCopy.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.NecrosCopy.lua
|
1
.aegisub/automation/autoload/ua.QC.lua
Symbolic link
1
.aegisub/automation/autoload/ua.QC.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.QC.lua
|
1
.aegisub/automation/autoload/ua.Recalculator.lua
Symbolic link
1
.aegisub/automation/autoload/ua.Recalculator.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.Recalculator.lua
|
1
.aegisub/automation/autoload/ua.Relocator.lua
Symbolic link
1
.aegisub/automation/autoload/ua.Relocator.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.Relocator.lua
|
1
.aegisub/automation/autoload/ua.ScriptCleanup.lua
Symbolic link
1
.aegisub/automation/autoload/ua.ScriptCleanup.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.ScriptCleanup.lua
|
1
.aegisub/automation/autoload/ua.Selectrix.lua
Symbolic link
1
.aegisub/automation/autoload/ua.Selectrix.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.Selectrix.lua
|
1
.aegisub/automation/autoload/ua.ShiftCut.lua
Symbolic link
1
.aegisub/automation/autoload/ua.ShiftCut.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.ShiftCut.lua
|
1
.aegisub/automation/autoload/ua.Significance.lua
Symbolic link
1
.aegisub/automation/autoload/ua.Significance.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.Significance.lua
|
1
.aegisub/automation/autoload/ua.TimeSigns.lua
Symbolic link
1
.aegisub/automation/autoload/ua.TimeSigns.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.TimeSigns.lua
|
1
.aegisub/automation/autoload/ua.iBus.lua
Symbolic link
1
.aegisub/automation/autoload/ua.iBus.lua
Symbolic link
|
@ -0,0 +1 @@
|
|||
../unanimated/ua.iBus.lua
|
1
.aegisub/automation/unanimated
Submodule
1
.aegisub/automation/unanimated
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit efc98e26dacf08cd67234c5e569032581ed4849c
|
365
.aegisub/hotkey.json
Normal file
365
.aegisub/hotkey.json
Normal file
|
@ -0,0 +1,365 @@
|
|||
{
|
||||
"Always" : {
|
||||
"audio/commit" : [
|
||||
"KP_Enter"
|
||||
],
|
||||
"audio/play/selection" : [
|
||||
"KP_5"
|
||||
],
|
||||
"audio/play/selection/after" : [
|
||||
"KP_3"
|
||||
],
|
||||
"audio/play/selection/before" : [
|
||||
"KP_1"
|
||||
],
|
||||
"audio/stop" : [
|
||||
"KP_8"
|
||||
],
|
||||
"time/length/decrease" : [
|
||||
"KP_7"
|
||||
],
|
||||
"time/length/increase" : [
|
||||
"KP_9"
|
||||
],
|
||||
"time/next" : [
|
||||
"KP_2"
|
||||
],
|
||||
"time/prev" : [
|
||||
"KP_0"
|
||||
],
|
||||
"time/start/decrease" : [
|
||||
"KP_4"
|
||||
],
|
||||
"time/start/increase" : [
|
||||
"KP_6"
|
||||
]
|
||||
},
|
||||
"Audio" : {
|
||||
"app/toggle/global_hotkeys" : [
|
||||
"Ctrl-KP_Multiply"
|
||||
],
|
||||
"audio/commit" : [
|
||||
"Enter",
|
||||
"G"
|
||||
],
|
||||
"audio/commit/default" : [
|
||||
"Shift-G"
|
||||
],
|
||||
"audio/play/line" : [
|
||||
"R"
|
||||
],
|
||||
"audio/play/selection" : [
|
||||
"E",
|
||||
"Space"
|
||||
],
|
||||
"audio/play/selection/after" : [
|
||||
"F"
|
||||
],
|
||||
"audio/play/selection/before" : [
|
||||
"Q"
|
||||
],
|
||||
"audio/play/selection/begin" : [
|
||||
"S"
|
||||
],
|
||||
"audio/play/selection/end" : [
|
||||
"D"
|
||||
],
|
||||
"audio/play/to_end" : [
|
||||
"T"
|
||||
],
|
||||
"audio/play/toggle" : [
|
||||
"B"
|
||||
],
|
||||
"audio/scroll/left" : [
|
||||
"A"
|
||||
],
|
||||
"audio/scroll/right" : [
|
||||
"F"
|
||||
],
|
||||
"audio/stop" : [
|
||||
"H"
|
||||
],
|
||||
"time/lead/in" : [
|
||||
"C"
|
||||
],
|
||||
"time/lead/out" : [
|
||||
"V"
|
||||
],
|
||||
"time/length/decrease" : [
|
||||
"KP_Subtract"
|
||||
],
|
||||
"time/length/decrease/shift" : [
|
||||
"Shift-KP_Subtract"
|
||||
],
|
||||
"time/length/increase" : [
|
||||
"KP_Add"
|
||||
],
|
||||
"time/length/increase/shift" : [
|
||||
"Shift-KP_Add"
|
||||
],
|
||||
"time/next" : [
|
||||
"Right",
|
||||
"X"
|
||||
],
|
||||
"time/prev" : [
|
||||
"Left",
|
||||
"Z"
|
||||
]
|
||||
},
|
||||
"Default" : {
|
||||
"app/exit" : [
|
||||
"Ctrl-Q"
|
||||
],
|
||||
"app/options" : [
|
||||
"Alt-O"
|
||||
],
|
||||
"automation/lua/karaoke-adjust-1sec/Karaoke 1sec adjust lead-in" : [
|
||||
"Ctrl-K"
|
||||
],
|
||||
"edit/find_replace" : [
|
||||
"Ctrl-H"
|
||||
],
|
||||
"edit/line/copy" : [
|
||||
"Ctrl-C"
|
||||
],
|
||||
"edit/line/cut" : [
|
||||
"Ctrl-X"
|
||||
],
|
||||
"edit/line/delete" : [
|
||||
"Ctrl-Delete"
|
||||
],
|
||||
"edit/line/paste" : [
|
||||
"Ctrl-V"
|
||||
],
|
||||
"edit/line/paste/over" : [
|
||||
"Ctrl-Shift-V"
|
||||
],
|
||||
"edit/line/split/after" : [
|
||||
"Ctrl-Shift-D"
|
||||
],
|
||||
"edit/line/split/before" : [
|
||||
"Ctrl-D"
|
||||
],
|
||||
"edit/redo" : [
|
||||
"Ctrl-Y"
|
||||
],
|
||||
"edit/undo" : [
|
||||
"Ctrl-Z"
|
||||
],
|
||||
"grid/line/next" : [
|
||||
"Ctrl-KP_2"
|
||||
],
|
||||
"grid/line/prev" : [
|
||||
"Ctrl-KP_8"
|
||||
],
|
||||
"grid/move/down" : [
|
||||
"Alt-Down"
|
||||
],
|
||||
"grid/move/up" : [
|
||||
"Alt-Up"
|
||||
],
|
||||
"help/contents" : [
|
||||
"F1"
|
||||
],
|
||||
"subtitle/find" : [
|
||||
"Ctrl-F"
|
||||
],
|
||||
"subtitle/find/next" : [
|
||||
"F3"
|
||||
],
|
||||
"subtitle/new" : [
|
||||
"Ctrl-N"
|
||||
],
|
||||
"subtitle/open" : [
|
||||
"Ctrl-O"
|
||||
],
|
||||
"subtitle/save" : [
|
||||
"Ctrl-S",
|
||||
"F2"
|
||||
],
|
||||
"subtitle/save/as" : [
|
||||
"Ctrl-Shift-S"
|
||||
],
|
||||
"time/frame/current" : [
|
||||
"Ctrl-6"
|
||||
],
|
||||
"time/shift" : [
|
||||
"Ctrl-I"
|
||||
],
|
||||
"time/snap/end_video" : [
|
||||
"Ctrl-4"
|
||||
],
|
||||
"time/snap/scene" : [
|
||||
"Ctrl-5"
|
||||
],
|
||||
"time/snap/start_video" : [
|
||||
"Ctrl-3"
|
||||
],
|
||||
"video/focus_seek" : [
|
||||
"Ctrl-Space"
|
||||
],
|
||||
"video/frame/next" : [
|
||||
"Ctrl-KP_6"
|
||||
],
|
||||
"video/frame/prev" : [
|
||||
"Ctrl-KP_4"
|
||||
],
|
||||
"video/jump" : [
|
||||
"Ctrl-G"
|
||||
],
|
||||
"video/jump/end" : [
|
||||
"Ctrl-2"
|
||||
],
|
||||
"video/jump/start" : [
|
||||
"Ctrl-1"
|
||||
],
|
||||
"video/play" : [
|
||||
"Ctrl-P"
|
||||
],
|
||||
"video/zoom/in" : [
|
||||
"Ctrl-KP_Add"
|
||||
],
|
||||
"video/zoom/out" : [
|
||||
"Ctrl-KP_Subtract"
|
||||
]
|
||||
},
|
||||
"Styling Assistant" : {
|
||||
"audio/play/selection" : [
|
||||
"End"
|
||||
],
|
||||
"grid/line/next" : [
|
||||
"PageDown"
|
||||
],
|
||||
"grid/line/prev" : [
|
||||
"PageUp"
|
||||
],
|
||||
"tool/styling_assistant/commit" : [
|
||||
"Enter",
|
||||
"KP_Enter"
|
||||
],
|
||||
"tool/styling_assistant/preview" : [
|
||||
"F8"
|
||||
],
|
||||
"video/play/line" : [
|
||||
"Home"
|
||||
]
|
||||
},
|
||||
"Subtitle Edit Box" : {
|
||||
"edit/color/outline" : [
|
||||
"Alt-3"
|
||||
],
|
||||
"edit/color/primary" : [
|
||||
"Alt-1"
|
||||
],
|
||||
"edit/color/secondary" : [
|
||||
"Alt-2"
|
||||
],
|
||||
"edit/color/shadow" : [
|
||||
"Alt-4"
|
||||
],
|
||||
"grid/line/next/create" : [
|
||||
"Enter",
|
||||
"KP_Enter"
|
||||
]
|
||||
},
|
||||
"Subtitle Grid" : {
|
||||
"subtitle/select/all" : [
|
||||
"Ctrl-A"
|
||||
],
|
||||
"video/frame/next" : [
|
||||
"Right"
|
||||
],
|
||||
"video/frame/next/boundary" : [
|
||||
"Ctrl-Right"
|
||||
],
|
||||
"video/frame/next/keyframe" : [
|
||||
"Shift-Right"
|
||||
],
|
||||
"video/frame/next/large" : [
|
||||
"Alt-Right"
|
||||
],
|
||||
"video/frame/prev" : [
|
||||
"Left"
|
||||
],
|
||||
"video/frame/prev/boundary" : [
|
||||
"Ctrl-Left"
|
||||
],
|
||||
"video/frame/prev/keyframe" : [
|
||||
"Shift-Left"
|
||||
],
|
||||
"video/frame/prev/large" : [
|
||||
"Alt-Left"
|
||||
]
|
||||
},
|
||||
"Translation Assistant" : {
|
||||
"audio/play/selection" : [
|
||||
"End"
|
||||
],
|
||||
"tool/translation_assistant/commit" : [
|
||||
"Enter",
|
||||
"KP_Enter"
|
||||
],
|
||||
"tool/translation_assistant/insert_original" : [
|
||||
"Insert"
|
||||
],
|
||||
"tool/translation_assistant/next" : [
|
||||
"PageDown"
|
||||
],
|
||||
"tool/translation_assistant/prev" : [
|
||||
"PageUp"
|
||||
],
|
||||
"tool/translation_assistant/preview" : [
|
||||
"F8"
|
||||
],
|
||||
"video/play/line" : [
|
||||
"Home"
|
||||
]
|
||||
},
|
||||
"Video" : {
|
||||
"video/frame/next" : [
|
||||
"Right"
|
||||
],
|
||||
"video/frame/next/boundary" : [
|
||||
"Ctrl-Right"
|
||||
],
|
||||
"video/frame/next/keyframe" : [
|
||||
"Shift-Right"
|
||||
],
|
||||
"video/frame/next/large" : [
|
||||
"Alt-Right"
|
||||
],
|
||||
"video/frame/prev" : [
|
||||
"Left"
|
||||
],
|
||||
"video/frame/prev/boundary" : [
|
||||
"Ctrl-Left"
|
||||
],
|
||||
"video/frame/prev/keyframe" : [
|
||||
"Shift-Left"
|
||||
],
|
||||
"video/frame/prev/large" : [
|
||||
"Alt-Left"
|
||||
],
|
||||
"video/tool/clip" : [
|
||||
"H"
|
||||
],
|
||||
"video/tool/cross" : [
|
||||
"A"
|
||||
],
|
||||
"video/tool/drag" : [
|
||||
"S"
|
||||
],
|
||||
"video/tool/rotate/xy" : [
|
||||
"F"
|
||||
],
|
||||
"video/tool/rotate/z" : [
|
||||
"D"
|
||||
],
|
||||
"video/tool/scale" : [
|
||||
"G"
|
||||
],
|
||||
"video/tool/vector_clip" : [
|
||||
"J"
|
||||
]
|
||||
}
|
||||
}
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -99,3 +99,8 @@ Cache
|
|||
# dunst
|
||||
!/.config/dunst
|
||||
|
||||
# aegisub
|
||||
!/.aegisub
|
||||
/.aegisub/*
|
||||
!/.aegisub/hotkey.json
|
||||
!/.aegisub/automation
|
||||
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -59,3 +59,6 @@
|
|||
[submodule ".vim/bundle/vim-repeat"]
|
||||
path = .vim/bundle/vim-repeat
|
||||
url = https://github.com/tpope/vim-repeat.git
|
||||
[submodule ".aegisub/automation/unanimated"]
|
||||
path = .aegisub/automation/unanimated
|
||||
url = https://github.com/unanimated/luaegisub.git
|
||||
|
|
Loading…
Reference in a new issue