Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantiusBenignus committed Feb 8, 2024
1 parent 09beeb2 commit f95cb5f
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,47 @@ import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';

export default class BlurtExtension extends Extension {

enable() {

this._siButton = new St.Button(
{
style_class : "panel-button"
});
this._siLabel = new St.Label({
text: '\u{0181}',
style_class: 'si-label',
});
this._siButton.set_child(this._siLabel);
this._siButton.connect('clicked', () => this.openPreferences());
Main.panel._rightBox.insert_child_at_index(this._siButton, 1);
this._settings = this.getSettings();
let homeDir = GLib.getenv('HOME');
let asr_path = this._settings.get_string('whisper-path');
Main.wm.addKeybinding("speech-input",
this._settings,
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL,
async() => { try {
this._siLabel.set_style_class_name('i-label');
const proc = Gio.Subprocess.new([homeDir+"/"+asr_path],
Gio.SubprocessFlags.NONE);
const success = await proc.wait_check_async(null);
this._siLabel.set_style_class_name(success ? 'si-label' : 'e-label');
} catch (e) {
logError(e);
}
}
);
}

disable() {
this._settings = null;
Main.wm.removeKeybinding("speech-input");
Main.panel._rightBox.remove_child(this._siButton);
this._siLabel = null;
this._siButton = null;
}

enable() {
this._siButton = new St.Button(
{
style_class : "panel-button"
});
this._siLabel = new St.Label({
text: '\u{0181}',
style_class: 'si-label',
});
this._siButton.set_child(this._siLabel);
this._siButton.connect('clicked', () => this.openPreferences());
Main.panel._rightBox.insert_child_at_index(this._siButton, 1);
this._settings = this.getSettings();
let homeDir = GLib.getenv('HOME');
let asr_path = this._settings.get_string('whisper-path');
Main.wm.addKeybinding("speech-input",
this._settings,
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL,
async() => { try {
this._siLabel.set_style_class_name('i-label');
const proc = Gio.Subprocess.new([homeDir+"/"+asr_path],
Gio.SubprocessFlags.NONE);
const success = await proc.wait_check_async(null);
this._siLabel.set_style_class_name(success ? 'si-label' : 'e-label');
} catch (e) {
logError(e);
}
}
);
}
disable() {
Main.wm.removeKeybinding("speech-input");
Main.panel._rightBox.remove_child(this._siButton);
this._siLabel = null;
this._siButton = null;
this._settings = null;
}
}

0 comments on commit f95cb5f

Please sign in to comment.