scribe-cli 0.6.1__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {scribe_cli-0.6.1/scribe_cli.egg-info → scribe_cli-0.7.0}/PKG-INFO +29 -5
  2. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/README.md +28 -5
  3. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/pyproject.toml +2 -1
  4. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/_version.py +2 -2
  5. scribe_cli-0.6.1/scribe/streamer.py → scribe_cli-0.7.0/scribe/app.py +56 -6
  6. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/keyboard.py +0 -1
  7. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/models.py +7 -7
  8. {scribe_cli-0.6.1 → scribe_cli-0.7.0/scribe_cli.egg-info}/PKG-INFO +29 -5
  9. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe_cli.egg-info/SOURCES.txt +1 -1
  10. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe_cli.egg-info/entry_points.txt +1 -1
  11. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe_cli.egg-info/requires.txt +1 -0
  12. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/.github/workflows/pypi.yml +0 -0
  13. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/.gitignore +0 -0
  14. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/LICENSE +0 -0
  15. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/__init__.py +0 -0
  16. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/audio.py +0 -0
  17. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/install_desktop.py +0 -0
  18. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/models.toml +0 -0
  19. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/saverecording.py +0 -0
  20. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/testpynput.py +0 -0
  21. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe/util.py +0 -0
  22. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe_cli.egg-info/dependency_links.txt +0 -0
  23. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe_cli.egg-info/top_level.txt +0 -0
  24. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe_data/__init__.py +0 -0
  25. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe_data/share/icon.jpg +0 -0
  26. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/scribe_data/templates/scribe.desktop +0 -0
  27. {scribe_cli-0.6.1 → scribe_cli-0.7.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: scribe-cli
3
- Version: 0.6.1
3
+ Version: 0.7.0
4
4
  Summary: scribe is a local speech recognition tool that provides real-time transcription using vosk and whisper AI.
5
5
  Author-email: Mahé Perrette <mahe.perrette@gmail.com>
6
6
  License: MIT License
@@ -44,6 +44,7 @@ Requires-Dist: sounddevice
44
44
  Requires-Dist: tqdm
45
45
  Requires-Dist: requests
46
46
  Requires-Dist: pyperclip
47
+ Requires-Dist: pystray
47
48
  Provides-Extra: keyboard
48
49
  Requires-Dist: pynput; extra == "keyboard"
49
50
  Provides-Extra: whisper
@@ -109,6 +110,7 @@ there is a maximum duration after which it will stop by itself, which is setup t
109
110
 
110
111
  The `vosk` backend is good at
111
112
  doing real-time transcription for one language, but tended to make more mistakes in my tests and it does not do punctuation.
113
+ Use mainly for longer typing session with the [keyboard](#virtual-keyboard-advanced) option, e.g. to make notes.
112
114
  There are many [vosk models](https://alphacephei.com/vosk/models) available, and here a few are associated to [a handful of languages](scribe/models.toml) `en`, `fr`, `it`, `de` (so far).
113
115
 
114
116
  To skip the initial selection menu you can do:
@@ -117,9 +119,9 @@ scribe --backend whisper --model small --no-prompt
117
119
  ```
118
120
  where `--no-prompt` jumps right to the recording (after the first interruption, you can still choose to change the backend and model).
119
121
 
120
- ### Advanced usage as keyboard replacement
122
+ ### Virtual keyboard (experimental)
121
123
 
122
- By default the content of the transcription is paster to the clipboard, but is not propagated further.
124
+ By default the content of the transcription is pasted to the clipboard, and it is up to the user to paste (e.g. Ctrl + V).
123
125
  With the `--keyboard` option `scribe` will attempt to simulate a keyboard and send transcribed characters to the applcation under focus:
124
126
 
125
127
  ```bash
@@ -128,10 +130,32 @@ scribe --keyboard
128
130
 
129
131
  It relies on the optional `pynput` dependency (installed together with `scribe` if you used the `[all]` or `[keyboard]` option).
130
132
 
131
- `pynput` may require [some configuration](https://pynput.readthedocs.io/en/latest/limitations.html) (I *think* got it to work with `xhost +SI:localuser:$(whoami)` as far as the display is concerned). It has [limitations]((https://pynput.readthedocs.io/en/latest/limitations.html)). In my Ubuntu + Wayland system it works in chromium based applications (including vscode) but it does not in firefox and sublime text and any of the rest (not even in a terminal !).
132
- Workarounds include using the Xorg version of GNOME... Suggestions welcome.
133
+ `pynput` may require [some configuration](https://pynput.readthedocs.io/en/latest/limitations.html). It has [limitations]((https://pynput.readthedocs.io/en/latest/limitations.html)). In my Ubuntu + Wayland system it works in chromium based applications (including vscode) but it does not in firefox and sublime text and any of the rest (not even in a terminal !). Workarounds include using the Xorg version of GNOME: in `etc/gdm3/custom.conf` uncomment `# WaylandEnable=false` and restart.
134
+
135
+ ### System try icon (experimental)
136
+
137
+ To avoid switching back and forth with the terminal, it's possible to interact with the program via an icon tray.
138
+ To activate start with:
139
+ ```bash
140
+ scribe --app
141
+ ```
142
+ or toggle the app option in the interactive menu. The scribe icon will show, with Record or Quit options.
143
+ That option requires `pystray` to be installed. This is included with the `pip install ...[all]` option. In Ubuntu the following dependencies were required to make the menus appear:
144
+
145
+ ```bash
146
+ sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1
147
+ pip install PyGObject
148
+ ```
133
149
 
134
150
  ### Start as an application in Ubuntu
135
151
 
136
152
  If you run Ubuntu (or else?) with GNOME, the script `scribe-install [...]` will create a `scribe.desktop` file and place it under `$HOME/.local/share/applications`
137
153
  to make it available from the quick launch menu. Any option will be passed on to `scribe`.
154
+
155
+ e.g.
156
+
157
+ ```bash
158
+ scribe-install --backend whisper --model small
159
+ ```
160
+
161
+ After that just typing Cmd + scri... at any time from any where will conveniently start the app in its own terminal with the prescribed options.
@@ -52,6 +52,7 @@ there is a maximum duration after which it will stop by itself, which is setup t
52
52
 
53
53
  The `vosk` backend is good at
54
54
  doing real-time transcription for one language, but tended to make more mistakes in my tests and it does not do punctuation.
55
+ Use mainly for longer typing session with the [keyboard](#virtual-keyboard-advanced) option, e.g. to make notes.
55
56
  There are many [vosk models](https://alphacephei.com/vosk/models) available, and here a few are associated to [a handful of languages](scribe/models.toml) `en`, `fr`, `it`, `de` (so far).
56
57
 
57
58
  To skip the initial selection menu you can do:
@@ -60,9 +61,9 @@ scribe --backend whisper --model small --no-prompt
60
61
  ```
61
62
  where `--no-prompt` jumps right to the recording (after the first interruption, you can still choose to change the backend and model).
62
63
 
63
- ### Advanced usage as keyboard replacement
64
+ ### Virtual keyboard (experimental)
64
65
 
65
- By default the content of the transcription is paster to the clipboard, but is not propagated further.
66
+ By default the content of the transcription is pasted to the clipboard, and it is up to the user to paste (e.g. Ctrl + V).
66
67
  With the `--keyboard` option `scribe` will attempt to simulate a keyboard and send transcribed characters to the applcation under focus:
67
68
 
68
69
  ```bash
@@ -71,10 +72,32 @@ scribe --keyboard
71
72
 
72
73
  It relies on the optional `pynput` dependency (installed together with `scribe` if you used the `[all]` or `[keyboard]` option).
73
74
 
74
- `pynput` may require [some configuration](https://pynput.readthedocs.io/en/latest/limitations.html) (I *think* got it to work with `xhost +SI:localuser:$(whoami)` as far as the display is concerned). It has [limitations]((https://pynput.readthedocs.io/en/latest/limitations.html)). In my Ubuntu + Wayland system it works in chromium based applications (including vscode) but it does not in firefox and sublime text and any of the rest (not even in a terminal !).
75
- Workarounds include using the Xorg version of GNOME... Suggestions welcome.
75
+ `pynput` may require [some configuration](https://pynput.readthedocs.io/en/latest/limitations.html). It has [limitations]((https://pynput.readthedocs.io/en/latest/limitations.html)). In my Ubuntu + Wayland system it works in chromium based applications (including vscode) but it does not in firefox and sublime text and any of the rest (not even in a terminal !). Workarounds include using the Xorg version of GNOME: in `etc/gdm3/custom.conf` uncomment `# WaylandEnable=false` and restart.
76
+
77
+ ### System try icon (experimental)
78
+
79
+ To avoid switching back and forth with the terminal, it's possible to interact with the program via an icon tray.
80
+ To activate start with:
81
+ ```bash
82
+ scribe --app
83
+ ```
84
+ or toggle the app option in the interactive menu. The scribe icon will show, with Record or Quit options.
85
+ That option requires `pystray` to be installed. This is included with the `pip install ...[all]` option. In Ubuntu the following dependencies were required to make the menus appear:
86
+
87
+ ```bash
88
+ sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1
89
+ pip install PyGObject
90
+ ```
76
91
 
77
92
  ### Start as an application in Ubuntu
78
93
 
79
94
  If you run Ubuntu (or else?) with GNOME, the script `scribe-install [...]` will create a `scribe.desktop` file and place it under `$HOME/.local/share/applications`
80
- to make it available from the quick launch menu. Any option will be passed on to `scribe`.
95
+ to make it available from the quick launch menu. Any option will be passed on to `scribe`.
96
+
97
+ e.g.
98
+
99
+ ```bash
100
+ scribe-install --backend whisper --model small
101
+ ```
102
+
103
+ After that just typing Cmd + scri... at any time from any where will conveniently start the app in its own terminal with the prescribed options.
@@ -18,6 +18,7 @@ dependencies = [
18
18
  "tqdm",
19
19
  "requests",
20
20
  "pyperclip",
21
+ "pystray",
21
22
  ]
22
23
  optional-dependencies = { keyboard = ["pynput"], whisper = ["openai-whisper"], vosk = ["vosk"], all = ["pynput", "openai-whisper", "vosk"] }
23
24
 
@@ -49,5 +50,5 @@ write_to = "scribe/_version.py"
49
50
  Homepage = "https://github.com/perrette/scribe"
50
51
 
51
52
  [project.scripts]
52
- scribe = "scribe.streamer:main"
53
+ scribe = "scribe.app:main"
53
54
  scribe-install = "scribe.install_desktop:main"
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.6.1'
16
- __version_tuple__ = version_tuple = (0, 6, 1)
15
+ __version__ = version = '0.7.0'
16
+ __version_tuple__ = version_tuple = (0, 7, 0)
@@ -47,7 +47,7 @@ def get_transcriber(o, prompt=True):
47
47
  backend = o.backend
48
48
 
49
49
  elif not prompt:
50
- backend = choices[0]
50
+ backend = BACKENDS[0]
51
51
 
52
52
  else:
53
53
  checked_backend = False
@@ -113,14 +113,16 @@ def get_transcriber(o, prompt=True):
113
113
  samplerate=o.samplerate,
114
114
  timeout=None, # vosk keeps going (no timeout)
115
115
  silence_duration=None, # vosk handles silences internally
116
- model_kwargs={"data_folder": o.data_folder})
116
+ model_kwargs={"download_root": o.download_folder_vosk})
117
117
  except Exception as error:
118
118
  print(error)
119
119
  print(f"Failed to (down)load model {model}.")
120
120
  exit(1)
121
121
 
122
122
  elif backend == "whisper":
123
- transcriber = WhisperTranscriber(model_name=model, language=o.language, samplerate=o.samplerate, timeout=o.duration, silence_duration=o.silence)
123
+ transcriber = WhisperTranscriber(model_name=model, language=o.language, samplerate=o.samplerate,
124
+ timeout=o.duration, silence_duration=o.silence, restart_after_silence=o.restart_after_silence,
125
+ model_kwargs={"download_root": o.download_folder_whisper})
124
126
 
125
127
  else:
126
128
  raise ValueError(f"Unknown backend: {backend}")
@@ -142,6 +144,7 @@ def get_parser():
142
144
  help="An alias for preselected models when using the vosk backend, or 'en' for the English version of whisper models.")
143
145
 
144
146
  parser.add_argument("--no-prompt", action="store_false", dest="prompt", help="Disable prompts for backend and model selection and jump to recording")
147
+ parser.add_argument("--app", action="store_true", help="Start in app mode (relies on pystray)")
145
148
 
146
149
  parser.add_argument("--samplerate", default=16000, type=int, help=argparse.SUPPRESS)
147
150
  parser.add_argument("--keyboard", action="store_true")
@@ -153,7 +156,8 @@ def get_parser():
153
156
  group.add_argument("--silence", default=2, type=float, help="silence duration that prompt transcription (whisper) (default %(default)ss)")
154
157
  group.add_argument("--restart-after-silence", action="store_true", help="Restart the recording after a transcription triggered by a silence")
155
158
 
156
- parser.add_argument("--data-folder", help="Folder to store Vosk models.")
159
+ parser.add_argument("--download-folder-vosk", help="Folder to store Vosk models.")
160
+ parser.add_argument("--download-folder-whisper", help="Folder to store Whisper models.")
157
161
 
158
162
  return parser
159
163
 
@@ -208,6 +212,41 @@ def start_recording(micro, transcriber, clipboard=True, keyboard=False, latency=
208
212
  print("Copied to clipboard.")
209
213
 
210
214
 
215
+ def create_app(micro, transcriber, **kwargs):
216
+ import pystray
217
+ from pystray import Menu as pystrayMenu, MenuItem as Item
218
+ from PIL import Image
219
+ import PIL.ImageOps
220
+
221
+ import scribe_data
222
+
223
+ # Load an image from a file
224
+ image = Image.open(Path(scribe_data.__file__).parent / "share" / "icon.jpg")
225
+
226
+ def callback_quit(icon, item):
227
+ icon.visible = False
228
+ icon.stop()
229
+
230
+ def callback_record(icon, item):
231
+ print(f"Clicked {item}")
232
+ # icon.icon = PIL.ImageOps.invert(icon.icon)
233
+ # icon.icon = PIL.ImageOps.invert(image)
234
+ # icon.update_menu()
235
+ start_recording(micro, transcriber, **kwargs)
236
+ # icon.icon = image
237
+ # icon.update_menu()
238
+
239
+ # Create a menu
240
+ menu = pystrayMenu(
241
+ Item('Record', callback_record),
242
+ Item('Quit', callback_quit),
243
+ )
244
+
245
+ # Create the system tray icon
246
+ icon = pystray.Icon('name', image, "My App", menu)
247
+
248
+ return icon
249
+
211
250
 
212
251
  def main(args=None):
213
252
 
@@ -230,12 +269,13 @@ def main(args=None):
230
269
  print(f"Choose any of the following actions:")
231
270
  print(f"[q] quit")
232
271
  print(f"[e] change model")
272
+ print(f"[x] toggle app [{toggle[o.app]}] -> [{toggle[not o.app]}]")
233
273
  print(f"[k] toggle keyboard [{toggle[o.keyboard]}] -> [{toggle[not o.keyboard]}]")
234
274
  print(f"[c] toggle clipboard [{toggle[o.clipboard]}] -> [{toggle[not o.clipboard]}]")
235
275
  if transcriber.backend == "whisper":
236
276
  print(f"[t] change duration (currently {transcriber.timeout}s)")
237
277
  print(f"[b] change silence duration (currently {transcriber.silence_duration}s)")
238
- print(f"[a] toggle auto-restart after silence [{toggle[o.restart_after_silence]}] -> [{toggle[not o.restart_after_silence]}]")
278
+ print(f"[a] toggle auto-restart after silence [{toggle[transcriber.restart_after_silence]}] -> [{toggle[not transcriber.restart_after_silence]}]")
239
279
  print(colored(f"Press [Enter] or any other key to start recording.", "BOLD"))
240
280
 
241
281
  key = input()
@@ -250,6 +290,12 @@ def main(args=None):
250
290
  if key == "c":
251
291
  o.clipboard = not o.clipboard
252
292
  continue
293
+ if key == "x":
294
+ o.app = not o.app
295
+ continue
296
+ if key == "a":
297
+ transcriber.restart_after_silence = not transcriber.restart_after_silence
298
+ continue
253
299
  if key == "t":
254
300
  ans = input(f"Enter new duration in seconds (current: {transcriber.timeout}): ")
255
301
  try:
@@ -265,7 +311,11 @@ def main(args=None):
265
311
  print("Invalid duration. Must be an integer.")
266
312
  continue
267
313
 
268
- start_recording(micro, transcriber, clipboard=o.clipboard, keyboard=o.keyboard, latency=o.latency)
314
+ if o.app:
315
+ app = create_app(micro, transcriber, clipboard=o.clipboard, keyboard=o.keyboard, latency=o.latency)
316
+ app.run()
317
+ else:
318
+ start_recording(micro, transcriber, clipboard=o.clipboard, keyboard=o.keyboard, latency=o.latency)
269
319
 
270
320
  # if we arrived so far, that means we pressed Ctrl + C anyway, and need Enter to move on.
271
321
  # So we leave the wider range of options to change the model.
@@ -6,7 +6,6 @@ try:
6
6
 
7
7
  except ImportError:
8
8
  print("Please install pynput to use the keyboard feature.")
9
- print("Alternatively specify [keyboard] optional dependency to voskrealtime, e.g. `pip install -e .[keyboard]`")
10
9
  raise
11
10
 
12
11
  # Create a keyboard controller
@@ -95,16 +95,16 @@ class AbstractTranscriber:
95
95
  print(stop_message)
96
96
 
97
97
 
98
- def get_vosk_model(model, data_folder=None, url=None):
98
+ def get_vosk_model(model, download_root=None, url=None):
99
99
  """Load the Vosk recognizer"""
100
100
  import vosk
101
- if data_folder is None:
102
- data_folder = VOSK_MODELS_FOLDER
103
- model_path = os.path.join(data_folder, model)
101
+ if download_root is None:
102
+ download_root = VOSK_MODELS_FOLDER
103
+ model_path = os.path.join(download_root, model)
104
104
  if not os.path.exists(model_path):
105
105
  if url is None:
106
106
  url = f"https://alphacephei.com/vosk/models/{model}.zip"
107
- download_model(url, data_folder)
107
+ download_model(url, download_root)
108
108
  assert os.path.exists(model_path)
109
109
 
110
110
  return vosk.Model(model_path)
@@ -162,11 +162,11 @@ class WhisperTranscriber(AbstractTranscriber):
162
162
  def __init__(self, model_name, language=None, model=None, model_kwargs={}, **kwargs):
163
163
  import whisper
164
164
  if model is None:
165
- model = whisper.load_model(model_name)
165
+ model = whisper.load_model(model_name, **model_kwargs)
166
166
  super().__init__(model, model_name, language, model_kwargs=model_kwargs, **kwargs)
167
167
 
168
168
  def transcribe_audio(self, audio_bytes):
169
- print("Transcribing...")
169
+ print("\nTranscribing...")
170
170
  audio_array = np.frombuffer(audio_bytes, dtype=np.int16).flatten().astype(np.float32) / 32768.0
171
171
  return self.model.transcribe(audio_array, fp16=False, language=self.language)
172
172
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: scribe-cli
3
- Version: 0.6.1
3
+ Version: 0.7.0
4
4
  Summary: scribe is a local speech recognition tool that provides real-time transcription using vosk and whisper AI.
5
5
  Author-email: Mahé Perrette <mahe.perrette@gmail.com>
6
6
  License: MIT License
@@ -44,6 +44,7 @@ Requires-Dist: sounddevice
44
44
  Requires-Dist: tqdm
45
45
  Requires-Dist: requests
46
46
  Requires-Dist: pyperclip
47
+ Requires-Dist: pystray
47
48
  Provides-Extra: keyboard
48
49
  Requires-Dist: pynput; extra == "keyboard"
49
50
  Provides-Extra: whisper
@@ -109,6 +110,7 @@ there is a maximum duration after which it will stop by itself, which is setup t
109
110
 
110
111
  The `vosk` backend is good at
111
112
  doing real-time transcription for one language, but tended to make more mistakes in my tests and it does not do punctuation.
113
+ Use mainly for longer typing session with the [keyboard](#virtual-keyboard-advanced) option, e.g. to make notes.
112
114
  There are many [vosk models](https://alphacephei.com/vosk/models) available, and here a few are associated to [a handful of languages](scribe/models.toml) `en`, `fr`, `it`, `de` (so far).
113
115
 
114
116
  To skip the initial selection menu you can do:
@@ -117,9 +119,9 @@ scribe --backend whisper --model small --no-prompt
117
119
  ```
118
120
  where `--no-prompt` jumps right to the recording (after the first interruption, you can still choose to change the backend and model).
119
121
 
120
- ### Advanced usage as keyboard replacement
122
+ ### Virtual keyboard (experimental)
121
123
 
122
- By default the content of the transcription is paster to the clipboard, but is not propagated further.
124
+ By default the content of the transcription is pasted to the clipboard, and it is up to the user to paste (e.g. Ctrl + V).
123
125
  With the `--keyboard` option `scribe` will attempt to simulate a keyboard and send transcribed characters to the applcation under focus:
124
126
 
125
127
  ```bash
@@ -128,10 +130,32 @@ scribe --keyboard
128
130
 
129
131
  It relies on the optional `pynput` dependency (installed together with `scribe` if you used the `[all]` or `[keyboard]` option).
130
132
 
131
- `pynput` may require [some configuration](https://pynput.readthedocs.io/en/latest/limitations.html) (I *think* got it to work with `xhost +SI:localuser:$(whoami)` as far as the display is concerned). It has [limitations]((https://pynput.readthedocs.io/en/latest/limitations.html)). In my Ubuntu + Wayland system it works in chromium based applications (including vscode) but it does not in firefox and sublime text and any of the rest (not even in a terminal !).
132
- Workarounds include using the Xorg version of GNOME... Suggestions welcome.
133
+ `pynput` may require [some configuration](https://pynput.readthedocs.io/en/latest/limitations.html). It has [limitations]((https://pynput.readthedocs.io/en/latest/limitations.html)). In my Ubuntu + Wayland system it works in chromium based applications (including vscode) but it does not in firefox and sublime text and any of the rest (not even in a terminal !). Workarounds include using the Xorg version of GNOME: in `etc/gdm3/custom.conf` uncomment `# WaylandEnable=false` and restart.
134
+
135
+ ### System try icon (experimental)
136
+
137
+ To avoid switching back and forth with the terminal, it's possible to interact with the program via an icon tray.
138
+ To activate start with:
139
+ ```bash
140
+ scribe --app
141
+ ```
142
+ or toggle the app option in the interactive menu. The scribe icon will show, with Record or Quit options.
143
+ That option requires `pystray` to be installed. This is included with the `pip install ...[all]` option. In Ubuntu the following dependencies were required to make the menus appear:
144
+
145
+ ```bash
146
+ sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1
147
+ pip install PyGObject
148
+ ```
133
149
 
134
150
  ### Start as an application in Ubuntu
135
151
 
136
152
  If you run Ubuntu (or else?) with GNOME, the script `scribe-install [...]` will create a `scribe.desktop` file and place it under `$HOME/.local/share/applications`
137
153
  to make it available from the quick launch menu. Any option will be passed on to `scribe`.
154
+
155
+ e.g.
156
+
157
+ ```bash
158
+ scribe-install --backend whisper --model small
159
+ ```
160
+
161
+ After that just typing Cmd + scri... at any time from any where will conveniently start the app in its own terminal with the prescribed options.
@@ -5,13 +5,13 @@ pyproject.toml
5
5
  .github/workflows/pypi.yml
6
6
  scribe/__init__.py
7
7
  scribe/_version.py
8
+ scribe/app.py
8
9
  scribe/audio.py
9
10
  scribe/install_desktop.py
10
11
  scribe/keyboard.py
11
12
  scribe/models.py
12
13
  scribe/models.toml
13
14
  scribe/saverecording.py
14
- scribe/streamer.py
15
15
  scribe/testpynput.py
16
16
  scribe/util.py
17
17
  scribe_cli.egg-info/PKG-INFO
@@ -1,3 +1,3 @@
1
1
  [console_scripts]
2
- scribe = scribe.streamer:main
2
+ scribe = scribe.app:main
3
3
  scribe-install = scribe.install_desktop:main
@@ -3,6 +3,7 @@ sounddevice
3
3
  tqdm
4
4
  requests
5
5
  pyperclip
6
+ pystray
6
7
 
7
8
  [all]
8
9
  pynput
File without changes
File without changes
File without changes
File without changes
File without changes