fix(monitor): resolve incorrect paste mode in notification key

This commit is contained in:
Prad Nukala
2026-07-13 12:25:38 -04:00
parent 13fcc50f36
commit b69d0f8fd1
2 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ local function finishSession(exitCode)
end end
if exitCode == "0" then if exitCode == "0" then
if intent.notify then if intent.notify then
local key = intent.mode == "clipboard" and "notify.done_clipboard" or "notify.done_paste" local key = intent.mode == "paste" and "notify.done_paste" or "notify.done_clipboard"
noctalia.notify(noctalia.tr("title"), noctalia.tr(key)) noctalia.notify(noctalia.tr("title"), noctalia.tr(key))
end end
elseif exitCode ~= nil then elseif exitCode ~= nil then
+8 -7
View File
@@ -13,9 +13,10 @@
-- contract: SIGUSR1 finishes the recording and runs transcription (the same -- contract: SIGUSR1 finishes the recording and runs transcription (the same
-- mechanism `ostt launch` uses for hotkey toggling). -- mechanism `ostt launch` uses for hotkey toggling).
-- --
-- Output defaults to `ostt --paste`: the transcript is pasted straight into -- Output defaults to the clipboard (`ostt -c`); the settings can switch it to
-- the focused app. State/phase comes from the monitor service via -- `ostt --paste` (paste into the focused app — needs working wtype/ydotool key
-- noctalia.state (see monitor.luau for the status/intent contract). -- injection). State/phase comes from the monitor service via noctalia.state
-- (see monitor.luau for the status/intent contract).
local function shq(s) local function shq(s)
return "'" .. (s:gsub("'", "'\\''")) .. "'" return "'" .. (s:gsub("'", "'\\''")) .. "'"
@@ -27,7 +28,7 @@ local osttRuntimeDir = runtime and (runtime .. "/ostt") or ("/tmp/ostt-" .. user
local pidFile = osttRuntimeDir .. "/recording.pid" local pidFile = osttRuntimeDir .. "/recording.pid"
local exitFile = (runtime or "/tmp") .. "/noctalia-ostt-exit" local exitFile = (runtime or "/tmp") .. "/noctalia-ostt-exit"
local outputMode = barWidget.getConfig("output_mode") or "paste" local outputMode = barWidget.getConfig("output_mode") or "clipboard"
local model = barWidget.getConfig("model") or "" local model = barWidget.getConfig("model") or ""
local processAction = barWidget.getConfig("process_action") or "" local processAction = barWidget.getConfig("process_action") or ""
local showElapsed = barWidget.getConfig("show_elapsed") local showElapsed = barWidget.getConfig("show_elapsed")
@@ -90,10 +91,10 @@ end)
local function buildRecordCmd() local function buildRecordCmd()
local parts = { "ostt", "record" } local parts = { "ostt", "record" }
if outputMode == "clipboard" then if outputMode == "paste" then
parts[#parts + 1] = "-c"
else
parts[#parts + 1] = "--paste" parts[#parts + 1] = "--paste"
else
parts[#parts + 1] = "-c"
end end
if model ~= "" then if model ~= "" then
parts[#parts + 1] = "-m " .. shq(model) parts[#parts + 1] = "-m " .. shq(model)