Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pls add support for gnome shell 45 🙏 #1

Closed
distbit0 opened this issue Feb 6, 2024 · 10 comments
Closed

pls add support for gnome shell 45 🙏 #1

distbit0 opened this issue Feb 6, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@distbit0
Copy link

distbit0 commented Feb 6, 2024

I have attempted to manually install despite not being able to from https://extensions.gnome.org/ however encountered the following error when running gnome-extensions prefs blurt@quantiusbenignus.local

The settings of extension blurt@quantiusbenignus.local had an error:

SyntaxError: import declarations may only appear at top level of a module @ resource:///org/gnome/Shell/Extensions/js/misc/extensionUtils.js:4:0

Stack trace:
  @file:///home/pimania/.local/share/gnome-shell/extensions/blurt@quantiusbenignus.local/prefs.js:2:24
  _init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

I am running fedora 39.

many thx

@QuantiusBenignus
Copy link
Owner

Yeah, the breaking changes of version 45.
It is in the plans. I am installing on a dedicated partition a Linux distribution that comes with version 45 just for this.
(Need to keep my production environment stable and don't want to fiddle with VMs for this project)
It will not happen right away but soon. Please, bear with me.

@QuantiusBenignus
Copy link
Owner

Hi @distBit, in regards to issue #1, please, feel free to try the dedicated code for version 45 of the GNOME shell.
You can either try a direct installation from the official GNOME extensions website or download the zip archive (with version 45 in the name) from the main branch of this repository, or check out branch "gshell_45".
Please, let me know if it works for you.

@distbit0
Copy link
Author

distbit0 commented Feb 8, 2024

Hmm it now installs however the icon remains yellow once I trigger it with ctrl+alt+z and does not go back to white. maybe it is because my environment is noisy.

I ended up writing my own utility for this in the interim though 😅
https://github.com/distbit0/whisper-simple-dictation/blob/main/voice.py

So I am afraid that at least for the time being I will not be using this extension, although maybe will return to it if it exceeds the usefulness of my script :)

Many thx

@QuantiusBenignus
Copy link
Owner

Thanks for checking it out. For the sake of convenience and minimum input device interaction, I settled for the built-in VAD (or silence detection) method in sox. So noise has been in the disclaimer from the get go.
I also checked your code and it looks nice, I too considered ydotool but GNOME guidelines say no. I am really interested in poking into spectral methods for speech absence detection, maybe add a filter to sox, or figure a better UI mode of interaction that guarantees convenient way to end a recording.
In any case I am going to close this issue, since it does now work under version 45 on my machine.
If you have the time to humor me, could you double check that the extension is not complaining itself for some local-environment reason.This can be done by starting a shell with:
journalctl -f -o cat /usr/bin/gnome-shell and then going through a recording.
Don't be alarmed by the unrelated multiple other warnings, there are bound to be some, especially with the still new version 45 of the shell.
Thanks for your feedback!

@QuantiusBenignus QuantiusBenignus added the enhancement New feature or request label Feb 8, 2024
@distbit0
Copy link
Author

distbit0 commented Feb 9, 2024

Looks like the problem might just be that I do not have wsi installed:

GLib.SpawnError: Failed to execute child process “/home/pimania/.local/bin/wsi” (No such file or directory)

Stack trace:
  enable/<@file:///home/pimania/.local/share/gnome-shell/extensions/blurt@quantiusbenignus.local/extension.js:34:45
  @resource:///org/gnome/shell/ui/init.js:21:20
  
GLib.SpawnError: Failed to execute child process “/home/pimania/.local/bin/wsi” (No such file or directory)

Stack trace:
  enable/<@file:///home/pimania/.local/share/gnome-shell/extensions/blurt@quantiusbenignus.local/extension.js:34:45
  @resource:///org/gnome/shell/ui/init.js:21:20

Btw I personally much prefer being able to specify when the recording is finished via pressing the same keyboard shortcit I used to start the recording, rather than having the recording automatically end upon detection of silence. This is the way my above linked utility works. The reason for this preference is that very often I want to pause and think when I am speaking, just as I often do when I am typing. So I do not want the recording to automatically end when I stop to think, as this forces me to speak even when I have not fully decided what to say, which is a significant UX issue, for me at least.

@QuantiusBenignus
Copy link
Owner

Yes, wsi must be installed, it does the mediation in the background. It is amazing how lean, fast and well behaved command-line tools (especially shell built-ins) are in comparison to GUI widgets. So yeah, you need that script. (It also gets rid of non-speech events in the transcribed text, such as [wind blowing] etc.)

In principle, I can pass along kill signals from Gio.subprocess to the underlying shell (bash or zsh) so the UI can be reworked to allow start/stop control. My desktop environment is quiet and it seems my webcam microphone is of a decent quality because the silence detection just works. I do prefer the minimal interaction with input devices, but I understand your preference too.
Let me think a bit about this.
Thanks for checking your setup for me! I am closing this issue now.

@jalberto
Copy link

jalberto commented Feb 9, 2024

I get this in 45

GLib.Error g-spawn-exit-error-quark: Child process exited with code 1

Stack trace:
  _promisify/proto[asyncFunc]/</<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:453:45
  @resource:///org/gnome/shell/ui/init.js:21:20
  ### Promise created here: ###
  enable/<@file:///home/ja/.local/share/gnome-shell/extensions/blurt@quantiusbenignus.local/extension.js:36:44
  @resource:///org/gnome/shell/ui/init.js:21:20

@QuantiusBenignus
Copy link
Owner

QuantiusBenignus commented Feb 9, 2024

Hi @jalberto. It seems to be the same error as above, so I would like to ask you if you followed the installation instructions and placed the script wsi from this repo into $HOME/.local/bin/? The async function seems to fail due to the absence of that script.
Please, confirm.

@jalberto
Copy link

jalberto commented Feb 9, 2024 via email

@QuantiusBenignus
Copy link
Owner

QuantiusBenignus commented Feb 9, 2024

Hi @jalberto . The only way I could reproduce the exact same error, was as expected when I made the wsi script return a code 1.
This can happen for many reasons as I make it do so when failing to find its dependencies.
It (wsi) should be run standalone first to check that the environment is configured well.
So, it is very puzzling that you can run it standalone with no complaints and yet get the error. A few questions:

  1. Do you indeed, get the clipboard loaded with your transcribed text after running wsi in CLI (i.e. it has reached EOF).
  2. If not, is "transcribe" in your path? is it finding the model files correctly? Does whisper.cpp transcribe?
  3. What is your (cli) shell environment? bash or zsh or something else. Have you set up any special mode of error handling?
  4. Any chance that the $PATH for your cli and your Gnome shell differ? Permission differences?

If you answer Yes to 1 (where CLI is a terminal window in GNOME). Then for now, I have no idea what it could be because wsi clearly exits gracefully and Gio should return success. Try replacing all relative paths with absolute ones in wsi.

Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants