Allow to change the agents name + Workspace files
Rolling release / release (push) Successful in 8m2s
Rolling release / release (push) Successful in 8m2s
This commit is contained in:
@@ -65,6 +65,7 @@ export default class JarvisExtension extends Extension {
|
||||
this._bindSurface(this.session.view);
|
||||
this._applyAccessibility();
|
||||
this._removeShellService = installShellService();
|
||||
this._assistantName = 'Jarvis';
|
||||
this._indicator = new PanelMenu.Button(0.0, 'Jarvis QVAC', false); this._indicator.accessible_name = 'Jarvis voice assistant';
|
||||
this._panelBox = new St.BoxLayout({ style_class: 'jarvis-panel-box', y_align: Clutter.ActorAlign.CENTER });
|
||||
this._mark = new St.Icon({ icon_name: 'audio-input-microphone-symbolic', icon_size: 16, style_class: 'jarvis-panel-mark', y_align: Clutter.ActorAlign.CENTER });
|
||||
@@ -257,11 +258,13 @@ export default class JarvisExtension extends Extension {
|
||||
const tts = Boolean(voice.tts || voice.speech);
|
||||
this._eachView((view) => view.setVoiceStatus({ tts, input, wake: voice.wake }));
|
||||
}
|
||||
const name = status.settings?.assistantName;
|
||||
if (name) this._applyAssistantName(name);
|
||||
} catch { this._eachView((view) => view.setConnectionStatus('voice-unavailable')); }
|
||||
}
|
||||
_call(name, signature, value) {
|
||||
if (!this.proxy?.owned?.()) {
|
||||
if (name !== 'PushToTalk') this._eachView((view) => view.setNotice('Jarvis is starting…'));
|
||||
if (name !== 'PushToTalk') this._eachView((view) => view.setNotice(`${this._assistantName || 'Jarvis'} is starting…`));
|
||||
this._connectDaemon();
|
||||
return;
|
||||
}
|
||||
@@ -272,11 +275,20 @@ export default class JarvisExtension extends Extension {
|
||||
this._eachView((view) => view.setNotice(fallback));
|
||||
});
|
||||
}
|
||||
_applyAssistantName(name) {
|
||||
const text = safeText(name).slice(0, 32) || 'Jarvis';
|
||||
this._assistantName = text;
|
||||
this._eachView((view) => view.setAssistantName?.(text));
|
||||
this._indicator.accessible_name = `${text} voice assistant`;
|
||||
this._glyph.accessible_name = `${text} idle`;
|
||||
if (this._glyph.visible !== false) this._glyph.text = text;
|
||||
}
|
||||
_setState(state) {
|
||||
const value = safeText(state);
|
||||
this._glyph.text = 'Jarvis';
|
||||
this._glyph.accessible_name = `Jarvis ${value.toLowerCase()}`;
|
||||
this._indicator.accessible_name = `Jarvis ${value.toLowerCase()}`;
|
||||
const name = this._assistantName || 'Jarvis';
|
||||
this._glyph.text = name;
|
||||
this._glyph.accessible_name = `${name} ${value.toLowerCase()}`;
|
||||
this._indicator.accessible_name = `${name} ${value.toLowerCase()}`;
|
||||
if (this._panelBox) {
|
||||
for (const name of ['armed', 'listening', 'speaking', 'thinking', 'sleeping']) {
|
||||
this._panelBox.remove_style_class_name(`jarvis-state-${name}`);
|
||||
|
||||
Reference in New Issue
Block a user