Linux port: first run, packaging, single instance, privacy and wiring
CI / test (push) Has been cancelled
CI / test (push) Has been cancelled
First run and backend - The companion opens without Ollama or a model (OFFLINE / SETUP REQUIRED), opens Settings > Language model and picks the model up once downloaded. - Model, provider and GPU changes apply without restarting (Ollama is restarted when launch settings change); no silent fallback from API mode. - Fatal startup errors are shown in a window; the fallback avatar loads again; the shipped Capri artwork is used when nothing was imported. Packaging and tooling - packaging/arch/PKGBUILD, capri.desktop (KWin ScreenShot2 key), icons, artwork under /usr/share/capri/assets, Gitea Actions CI. - xtask: `icons` and `release-check` (no private data or credentials). Runtime - One instance per data folder (flock + control socket): second launch shows the window; capri stop / restart / toggle / status (JSON, starts nothing) / doctor / setup / diagnostics export / purge. - A foreign program on the Ollama port is refused; an Ollama left behind by Capri is replaced. Privacy and security - No raw Ollama log on disk; API keys are never saved in plaintext (old ones move to the keyring); refused credential notes are stored as [Credentials omitted]; launched apps get an allow-listed environment. Fixes - Stop/Escape silence the voice; saved voice effects apply to replies; settings_control glitch settings apply; distinct KWin cursor scripts; KDE window capture authorized for source builds; Linux wording. - Voice pack references zipped with Windows separators are found. Wired features - Initiatives, request router, resource monitor, "clip that", questions about a snapshot, sleep mode, tap reactions, stopwatch, attachments, Internet mode button, voice-synced subtitles, wake visuals, dictation draft, tray switches, Spotify seek/shuffle/repeat; computer-control planner and classifier follow model switches and API mode. - Approval cards: one shown, 8 queued, deduplicated, cancelled on stop, failure, lock or pause; one Application access switch. Desktop - Compositor detection (no black overlay on i3 without picom), i3lock detection, unsupported desktops reported at startup, screenshot-only control without AT-SPI, fontconfig fallbacks, translatable feature pages with French translations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
73 files changed
+4834
-517
No files matched your search
@@ -4,6 +4,7 @@ use capri_core::{Section, SettingsStore};
|
||||
use crate::install::Phase;
|
||||
use crate::settings::{CallSettings, MusicSettings, SPEECH_LANGUAGES, SpeechSettings, VoiceEffects, VoiceSettings};
|
||||
use crate::{VoiceHandle, effects};
|
||||
use capri_core::i18n::t;
|
||||
|
||||
// TODO: saves on every slider step; debounce if disk writes start to matter.
|
||||
/// Saves a section when the page changed it.
|
||||
@@ -47,12 +48,12 @@ pub fn settings_ui(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle
|
||||
ui.colored_label(ui.visuals().error_fg_color, error);
|
||||
}
|
||||
install_status(ui, voice);
|
||||
egui::CollapsingHeader::new("Speech").default_open(true).show(ui, |ui| speech(ui, store, voice));
|
||||
egui::CollapsingHeader::new("Microphone").default_open(true).show(ui, |ui| microphone(ui, store, voice));
|
||||
egui::CollapsingHeader::new("Voice model").show(ui, |ui| voice_model(ui, store, voice));
|
||||
egui::CollapsingHeader::new("Voice effects").show(ui, |ui| voice_effects(ui, store, voice));
|
||||
egui::CollapsingHeader::new("Music listening").show(ui, |ui| music(ui, store, voice));
|
||||
egui::CollapsingHeader::new("Call audio").show(ui, |ui| call(ui, store, voice));
|
||||
egui::CollapsingHeader::new(t("Speech")).default_open(true).show(ui, |ui| speech(ui, store, voice));
|
||||
egui::CollapsingHeader::new(t("Microphone")).default_open(true).show(ui, |ui| microphone(ui, store, voice));
|
||||
egui::CollapsingHeader::new(t("Voice model")).show(ui, |ui| voice_model(ui, store, voice));
|
||||
egui::CollapsingHeader::new(t("Voice effects")).show(ui, |ui| voice_effects(ui, store, voice));
|
||||
egui::CollapsingHeader::new(t("Music listening")).show(ui, |ui| music(ui, store, voice));
|
||||
egui::CollapsingHeader::new(t("Call audio")).show(ui, |ui| call(ui, store, voice));
|
||||
}
|
||||
|
||||
fn install_status(ui: &mut egui::Ui, voice: &VoiceHandle) {
|
||||
@@ -61,7 +62,7 @@ fn install_status(ui: &mut egui::Ui, voice: &VoiceHandle) {
|
||||
Phase::Installing => {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label(format!("Installing: {} {}", status.stage, status.detail));
|
||||
if ui.button("Cancel").clicked() {
|
||||
if ui.button(t("Cancel")).clicked() {
|
||||
voice.cancel_install();
|
||||
}
|
||||
});
|
||||
@@ -71,7 +72,7 @@ fn install_status(ui: &mut egui::Ui, voice: &VoiceHandle) {
|
||||
ui.colored_label(ui.visuals().warn_fg_color, status.error.unwrap_or_default());
|
||||
}
|
||||
Phase::Ready => {
|
||||
ui.label("Speech components are installed.");
|
||||
ui.label(t("Speech components are installed."));
|
||||
}
|
||||
Phase::Idle => {}
|
||||
}
|
||||
@@ -80,42 +81,42 @@ fn install_status(ui: &mut egui::Ui, voice: &VoiceHandle) {
|
||||
fn speech(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle) {
|
||||
edit::<SpeechSettings>(store, ui, |ui, s| {
|
||||
language_combo(ui, "Recognition language", &mut s.recognition_language, &["follow", "auto"], SPEECH_LANGUAGES);
|
||||
egui::ComboBox::from_label("Recognition model").selected_text(s.asr_model.as_str()).show_ui(ui, |ui| {
|
||||
egui::ComboBox::from_label(t("Recognition model")).selected_text(s.asr_model.as_str()).show_ui(ui, |ui| {
|
||||
for (id, label, ..) in crate::asr::MODELS {
|
||||
ui.selectable_value(&mut s.asr_model, id.to_string(), *label);
|
||||
}
|
||||
});
|
||||
ui.add(egui::Slider::new(&mut s.trailing_silence_seconds, 0.5..=5.0).step_by(0.1).suffix(" s").text("End-of-speech pause"));
|
||||
if ui.button("Reset pause").clicked() {
|
||||
ui.add(egui::Slider::new(&mut s.trailing_silence_seconds, 0.5..=5.0).step_by(0.1).suffix(" s").text(t("End-of-speech pause")));
|
||||
if ui.button(t("Reset pause")).clicked() {
|
||||
s.trailing_silence_seconds = 1.0;
|
||||
}
|
||||
ui.checkbox(&mut s.wake_word, "Wake phrase: Capri / Hey, Capri");
|
||||
ui.checkbox(&mut s.auto_send, "Send recognized speech automatically");
|
||||
ui.checkbox(&mut s.barge_in, "Interrupt Capri by speaking");
|
||||
ui.checkbox(&mut s.follow_up, "Keep listening after Capri asks a question");
|
||||
ui.add_enabled(s.follow_up, egui::Slider::new(&mut s.follow_up_seconds, 5..=30).suffix(" s").text("Follow-up window"));
|
||||
egui::ComboBox::from_label("Wake sound").selected_text(s.wake_sound.as_str()).show_ui(ui, |ui| {
|
||||
ui.checkbox(&mut s.wake_word, t("Wake phrase: Capri / Hey, Capri"));
|
||||
ui.checkbox(&mut s.auto_send, t("Send recognized speech automatically"));
|
||||
ui.checkbox(&mut s.barge_in, t("Interrupt Capri by speaking"));
|
||||
ui.checkbox(&mut s.follow_up, t("Keep listening after Capri asks a question"));
|
||||
ui.add_enabled(s.follow_up, egui::Slider::new(&mut s.follow_up_seconds, 5..=30).suffix(" s").text(t("Follow-up window")));
|
||||
egui::ComboBox::from_label(t("Wake sound")).selected_text(s.wake_sound.as_str()).show_ui(ui, |ui| {
|
||||
ui.selectable_value(&mut s.wake_sound, "tone".to_string(), "Tone");
|
||||
ui.selectable_value(&mut s.wake_sound, "off".to_string(), "Off");
|
||||
});
|
||||
ui.add(egui::Slider::new(&mut s.wake_volume, 0.0..=1.0).text("Wake volume"));
|
||||
ui.checkbox(&mut s.asr_gpu, "Use the GPU for recognition (needs a CUDA build)");
|
||||
ui.add(egui::Slider::new(&mut s.cpu_threads, 1..=8).text("CPU threads"));
|
||||
ui.add(egui::Slider::new(&mut s.wake_volume, 0.0..=1.0).text(t("Wake volume")));
|
||||
ui.checkbox(&mut s.asr_gpu, t("Use the GPU for recognition (needs a CUDA build)"));
|
||||
ui.add(egui::Slider::new(&mut s.cpu_threads, 1..=8).text(t("CPU threads")));
|
||||
});
|
||||
let installed = voice.recognition_installed();
|
||||
ui.label(if installed { "Recognition model installed." } else { "Recognition model not installed." });
|
||||
if !installed && ui.button("Install speech recognition").clicked() {
|
||||
if !installed && ui.button(t("Install speech recognition")).clicked() {
|
||||
report(ui, voice.install_speech(true, false));
|
||||
}
|
||||
}
|
||||
|
||||
fn microphone(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle) {
|
||||
let mut on = voice.microphone_on();
|
||||
if ui.checkbox(&mut on, "Microphone (off at every launch)").changed() {
|
||||
if ui.checkbox(&mut on, t("Microphone (off at every launch)")).changed() {
|
||||
report(ui, voice.set_microphone(on));
|
||||
}
|
||||
ui.add(egui::ProgressBar::new(voice.microphone_level()).desired_width(160.0).text("Level"));
|
||||
if ui.button("Refresh devices").clicked() {
|
||||
ui.add(egui::ProgressBar::new(voice.microphone_level()).desired_width(160.0).text(t("Level")));
|
||||
if ui.button(t("Refresh devices")).clicked() {
|
||||
voice.refresh_devices();
|
||||
}
|
||||
let devices = voice.input_devices();
|
||||
@@ -127,8 +128,8 @@ fn microphone(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle) {
|
||||
} else {
|
||||
format!("Unavailable — {}", s.microphone_label)
|
||||
};
|
||||
egui::ComboBox::from_label("Input device").selected_text(selected).show_ui(ui, |ui| {
|
||||
if ui.selectable_label(s.microphone_device.is_empty(), "System default").clicked() {
|
||||
egui::ComboBox::from_label(t("Input device")).selected_text(selected).show_ui(ui, |ui| {
|
||||
if ui.selectable_label(s.microphone_device.is_empty(), t("System default")).clicked() {
|
||||
(s.microphone_device, s.microphone_label) = (String::new(), String::new());
|
||||
}
|
||||
for d in &devices {
|
||||
@@ -138,35 +139,35 @@ fn microphone(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle) {
|
||||
}
|
||||
});
|
||||
});
|
||||
ui.label("Changing the device or pause applies the next time the microphone starts.");
|
||||
ui.label(t("Changing the device or pause applies the next time the microphone starts."));
|
||||
}
|
||||
|
||||
fn voice_model(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle) {
|
||||
let mut on = voice.voice_enabled();
|
||||
if ui.checkbox(&mut on, "Speak replies (off at every launch)").changed() {
|
||||
if ui.checkbox(&mut on, t("Speak replies (off at every launch)")).changed() {
|
||||
report(ui, voice.set_voice_enabled(on));
|
||||
}
|
||||
edit::<VoiceSettings>(store, ui, |ui, v| {
|
||||
language_combo(ui, "Voice language", &mut v.speech_language, &["follow"], SPEECH_LANGUAGES);
|
||||
egui::ComboBox::from_label("Quality").selected_text(v.quality.as_str()).show_ui(ui, |ui| {
|
||||
egui::ComboBox::from_label(t("Quality")).selected_text(v.quality.as_str()).show_ui(ui, |ui| {
|
||||
ui.selectable_value(&mut v.quality, "balanced".to_string(), "Balanced (quantized, ~1.2 GB)");
|
||||
ui.selectable_value(&mut v.quality, "full".to_string(), "Full (float32, ~3.3 GB)");
|
||||
});
|
||||
ui.add(egui::Slider::new(&mut v.cpu_threads, 1..=16).text("CPU threads"));
|
||||
ui.add(egui::Slider::new(&mut v.cpu_threads, 1..=16).text(t("CPU threads")));
|
||||
});
|
||||
ui.label("English: Chatterbox Turbo. Other languages: Chatterbox Multilingual. Both use Capri's reference voice.");
|
||||
ui.label(t("English: Chatterbox Turbo. Other languages: Chatterbox Multilingual. Both use Capri's reference voice."));
|
||||
if voice.voice_installed() {
|
||||
ui.label("Voice installed for this language.");
|
||||
} else if ui.button("Install Capri's voice for this language").clicked() {
|
||||
ui.label(t("Voice installed for this language."));
|
||||
} else if ui.button(t("Install Capri's voice for this language")).clicked() {
|
||||
report(ui, voice.install_speech(false, true));
|
||||
}
|
||||
}
|
||||
|
||||
fn voice_effects(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle) {
|
||||
edit::<VoiceEffects>(store, ui, |ui, e| {
|
||||
ui.checkbox(&mut e.enabled, "Effects");
|
||||
ui.checkbox(&mut e.enabled, t("Effects"));
|
||||
let mut preset = e.preset.clone();
|
||||
egui::ComboBox::from_label("Preset").selected_text(preset.as_str()).show_ui(ui, |ui| {
|
||||
egui::ComboBox::from_label(t("Preset")).selected_text(preset.as_str()).show_ui(ui, |ui| {
|
||||
for p in effects::PRESETS.iter().chain(&["custom"]) {
|
||||
ui.selectable_value(&mut preset, p.to_string(), *p);
|
||||
}
|
||||
@@ -188,15 +189,15 @@ fn voice_effects(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle)
|
||||
] {
|
||||
ui.add(egui::Slider::new(value, 0..=max).text(label));
|
||||
}
|
||||
ui.add(egui::Slider::new(&mut e.carrier_hz, 20..=200).suffix(" Hz").text("Carrier"));
|
||||
ui.add(egui::Slider::new(&mut e.carrier_hz, 20..=200).suffix(" Hz").text(t("Carrier")));
|
||||
if *e != before {
|
||||
e.preset = "custom".into();
|
||||
}
|
||||
if ui.button("Reset").clicked() {
|
||||
if ui.button(t("Reset")).clicked() {
|
||||
*e = VoiceEffects::default();
|
||||
}
|
||||
});
|
||||
if ui.button("Preview voice").clicked() {
|
||||
if ui.button(t("Preview voice")).clicked() {
|
||||
report(ui, voice.preview_voice(None));
|
||||
}
|
||||
}
|
||||
@@ -216,40 +217,40 @@ fn music(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle) {
|
||||
};
|
||||
ui.label(label);
|
||||
if state.listening {
|
||||
if ui.button("Stop music listening").clicked() {
|
||||
if ui.button(t("Stop music listening")).clicked() {
|
||||
voice.set_music(false);
|
||||
}
|
||||
} else if ui.button("Start music listening").clicked() {
|
||||
} else if ui.button(t("Start music listening")).clicked() {
|
||||
voice.set_music(true);
|
||||
}
|
||||
edit::<MusicSettings>(store, ui, |ui, m| {
|
||||
if ui.checkbox(&mut m.enabled, "Music animations").changed() && m.enabled && !state.listening {
|
||||
if ui.checkbox(&mut m.enabled, t("Music animations")).changed() && m.enabled && !state.listening {
|
||||
voice.set_music(true);
|
||||
}
|
||||
ui.checkbox(&mut m.notes, "Floating notes");
|
||||
ui.checkbox(&mut m.motion, "Beat motion");
|
||||
ui.checkbox(&mut m.auto_bpm, "Follow the detected tempo (off: 110 BPM)");
|
||||
ui.checkbox(&mut m.notes, t("Floating notes"));
|
||||
ui.checkbox(&mut m.motion, t("Beat motion"));
|
||||
ui.checkbox(&mut m.auto_bpm, t("Follow the detected tempo (off: 110 BPM)"));
|
||||
});
|
||||
ui.label("System playback is analysed in memory only; nothing is recorded or sent.");
|
||||
ui.label(t("System playback is analysed in memory only; nothing is recorded or sent."));
|
||||
}
|
||||
|
||||
fn call(ui: &mut egui::Ui, store: &SettingsStore, voice: &VoiceHandle) {
|
||||
if voice.call_active() {
|
||||
ui.label("Virtual cable active: choose \"Capri-call-microphone\" as the microphone in your call app.");
|
||||
ui.label(t("Virtual cable active: choose \"Capri-call-microphone\" as the microphone in your call app."));
|
||||
let mut share = voice.share_replies();
|
||||
if ui.checkbox(&mut share, "Share Capri's replies in the call").changed() {
|
||||
if ui.checkbox(&mut share, t("Share Capri's replies in the call")).changed() {
|
||||
voice.set_share_replies(share);
|
||||
}
|
||||
if ui.button("Remove the virtual cable").clicked() {
|
||||
if ui.button(t("Remove the virtual cable")).clicked() {
|
||||
voice.remove_call_cable();
|
||||
}
|
||||
} else if ui.button("Create the virtual call cable").clicked() {
|
||||
} else if ui.button(t("Create the virtual call cable")).clicked() {
|
||||
report(ui, voice.create_call_cable());
|
||||
}
|
||||
edit::<CallSettings>(store, ui, |ui, c| {
|
||||
ui.checkbox(&mut c.mix_microphone, "Mix my microphone into the call");
|
||||
ui.checkbox(&mut c.allow_model, "Allow model-selected replies in calls");
|
||||
ui.add(egui::Slider::new(&mut c.call_voice_volume, 0..=100).text("Capri's level in the call"));
|
||||
ui.checkbox(&mut c.mix_microphone, t("Mix my microphone into the call"));
|
||||
ui.checkbox(&mut c.allow_model, t("Allow model-selected replies in calls"));
|
||||
ui.add(egui::Slider::new(&mut c.call_voice_volume, 0..=100).text(t("Capri's level in the call")));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user