Debian Codegraph @

docs/user.md

raw
1 # Fenrir User Manual
2
3 Fenrir is a modern command line screen reader written in Python 3.
4
5 It has a modular structure, a flexible driver-based architecture, is highly configurable and easy to customize and extend.
6
7 **Current maintainer:** Storm Dragon
8 **Previous developer:** Chrys
9
10 ## Quick Start
11
12 1. **Installation**: See the [README.md](../README.md) for installation instructions
13 2. **First run**: `sudo fenrir` (or `sudo systemctl start fenrir` if installed)
14 3. **Tutorial mode**: Press `Fenrir + H` to learn all commands interactively
15 4. **Basic navigation**: Use numeric keypad for review (desktop layout)
16 5. **Stop speech**: Press `Ctrl` at any time
17 6. **Quit**: Press `Fenrir + Q`
18
19 ## Key Concepts
20
21 ### Fenrir Key
22 The Fenrir Key is used to invoke screen reader commands. By default:
23 - Insert
24 - Keypad Insert
25 - Meta (Super/Windows key)
26
27 You can configure multiple Fenrir keys to suit your preference.
28
29 ### Keyboard Layouts
30 - **Desktop Layout**: Uses numeric keypad (recommended for desktop users)
31 - **Laptop Layout**: Alternative bindings for keyboards without numeric keypad
32
33 ### Review Mode
34 Navigate the screen without moving the text cursor. Essential for examining content without disrupting your workflow.
35
36 ## Essential Commands
37
38 ### Navigation (Desktop Layout)
39 - `Ctrl` - Stop speech (shut up)
40 - `Fenrir + H` - Tutorial mode
41 - `Fenrir + Ctrl + H` - Speech history
42 - `Fenrir + Q` - Quit Fenrir
43 - `Fenrir + Keypad 5` - Read current screen
44 - `Keypad 8` - Read current line
45 - `Keypad 5` - Read current word
46 - `Keypad 2` - Read current character
47
48 ### Review Commands
49 - `Keypad 7/9` - Previous/next line
50 - `Keypad 4/6` - Previous/next word
51 - `Keypad 1/3` - Previous/next character
52 - `Fenrir + Keypad dot` - Exit review mode
53
54 ### Table Navigation
55 - `Fenrir + Keypad *` - Toggle table mode / highlight tracking
56 - `Keypad 4/6` - Previous/next column (in table mode)
57 - `Fenrir + Keypad 4/6` - First/last column (in table mode)
58 - `Fenrir + X` - Set column headers (in table mode)
59
60 ### Information
61 - `Fenrir + T` - Announce time
62 - `Fenrir + T T` - Announce date
63 - `Keypad dot` - Cursor position
64
65 ### Clipboard
66 - `Fenrir + X` - Set mark
67 - `Fenrir + C` - Copy marked text
68 - `Fenrir + V` - Paste clipboard
69 - `Fenrir + Shift + C` - Read current clipboard
70
71 ### Settings (Runtime Changes)
72 - `Fenrir + F3` - Toggle sound
73 - `Fenrir + F4` - Toggle speech
74 - `Fenrir + Up/Down` - Speech volume
75 - `Fenrir + Right/Left` - Speech rate
76 - `Fenrir + Ctrl + P` - Punctuation level
77
78 ## Configuration
79
80 ### Settings File
81 Main configuration:
82 - **System-wide**: `/etc/fenrirscreenreader/settings/settings.conf`
83 - **User-local**: `~/.local/share/stormux/fenrirscreenreader/settings/settings.conf`
84
85 When Fenrir runs as a regular user, including `fenrir -x`, it loads the user-local settings file if it exists. If it does not exist, Fenrir falls back to the system settings file, but saving settings creates or updates the user-local file. When Fenrir runs as root, settings save to the system-wide file by default.
86
87 User sound themes are loaded before system themes from `~/.local/stormux/fenrir/sounds/`. User scripts are loaded before configured system scripts from `~/.local/stormux/fenrir/`.
88
89 ### Key Sections
90 - `[speech]` - Speech synthesis settings
91 - `[sound]` - Sound output and icons
92 - `[keyboard]` - Input and key bindings
93 - `[screen]` - Screen reading configuration
94 - `[general]` - General settings
95
96 ### Common Settings
97 ```ini
98 [speech]
99 enabled=True
100 driver=speechdDriver
101 rate=0.5
102 pitch=0.5
103 volume=1.0
104 hardware_device=/dev/ttyS0
105 hardware_baud_rate=9600
106 history_size=50
107
108 [sound]
109 enabled=True
110 driver=genericDriver
111 volume=0.7
112
113 [keyboard]
114 driver=evdevDriver
115 keyboard_layout=desktop
116
117 [screen]
118 driver=vcsaDriver
119 ignore_screen=
120
121 [remote]
122 enable=True
123 driver=unixDriver
124 enable_settings_remote=True
125 enable_command_remote=True
126 ```
127
128 ## Remote Control
129
130 Fenrir includes a powerful remote control system for automation and integration with external applications.
131
132 ### Configuration
133 Enable remote control in settings:
134 ```ini
135 [remote]
136 enable=True
137 driver=unixDriver # or tcpDriver
138 port=22447 # for TCP driver
139 enable_settings_remote=True # allow settings changes
140 enable_command_remote=True # allow command execution
141 ```
142
143 ### Basic Usage with socat
144
145 #### Instance Discovery
146 ```bash
147 # List registered Fenrir instances and their socket paths
148 echo "ls" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
149 ```
150
151 In X terminal mode (`fenrir -x`), multiple Fenrir instances can run at the same
152 time. Each instance has a private socket at `/tmp/fenrirscreenreader-<pid>.sock`,
153 and one instance may also own the standard control socket. Use `ls` or
154 `command ls` on the standard socket to find the private socket for a specific
155 instance. Commands sent to the standard socket are handled by its owner when
156 possible; otherwise they are forwarded to a registered private socket,
157 preferring the sender's Fenrir ancestor when one can be found.
158
159 #### Speech Control
160 ```bash
161 # Interrupt current speech
162 echo "command interrupt" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
163
164 # Speak custom text
165 echo "command say Hello, this is a test" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
166
167 # Temporarily disable speech
168 echo "command tempdisablespeech" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
169 ```
170
171 #### Settings Control
172 ```bash
173 # Enable highlight tracking
174 echo "setting set focus#highlight=True" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
175
176 # Change speech parameters
177 echo "setting set speech#rate=0.8" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
178 echo "setting set speech#pitch=0.6" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
179 echo "setting set speech#volume=0.9" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
180
181 # Change punctuation level (none/some/most/all)
182 echo "setting set general#punctuation_level=all" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
183
184 # Voice and TTS control
185 echo "setting set speech#voice=en-us+f3" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
186 echo "setting set speech#module=espeak-ng" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
187
188 # Multiple settings at once
189 echo "setting set speech#rate=0.8;sound#volume=0.7;general#punctuation_level=most" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
190
191 # Reset all settings
192 echo "setting reset" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
193
194 # Save settings
195 echo "setting save" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
196 echo "setting saveas /tmp/my-settings.conf" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
197 ```
198
199 #### Clipboard Operations
200 ```bash
201 # Add text to clipboard
202 echo "command clipboard Text to copy" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
203
204 # Export clipboard to file
205 echo "command exportclipboard" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
206 ```
207
208 #### Application Control
209 ```bash
210 # Quit Fenrir
211 echo "command quitapplication" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
212 ```
213
214 ### Command Reference
215
216 **Speech Commands:**
217 - `command say <text>` - Speak text
218 - `command interrupt` - Stop speech
219 - `command tempdisablespeech` - Disable until next key
220 - `ls` / `list` / `command ls` / `command list` - List registered Fenrir instances
221
222 **Settings Commands:**
223 - `setting set <section>#<key>=<value>` - Change setting
224 - `setting reset` - Reset to defaults
225 - `setting save` - Save current settings
226
227 **Other Commands:**
228 - `command clipboard <text>` - Add to clipboard
229 - `command exportclipboard` - Export clipboard to file
230 - `command window <x1> <y1> <x2> <y2>` - Define window
231 - `command resetwindow` - Reset window
232 - `command vmenu <menu_path>` - Set virtual menu
233 - `command resetvmenu` - Reset virtual menu
234
235 **Key Settings You Can Change:**
236 - Punctuation level: `setting set general#punctuation_level=all`
237 - Speech parameters: `setting set speech#rate=0.8;speech#pitch=0.6`
238 - Voice selection: `setting set speech#voice=en-us+f3`
239 - Character echo: `setting set keyboard#char_echo_mode=1`
240 - Screen ignore: `setting set screen#ignore_screen=1,2,3`
241
242 ### Scripting Integration
243
244 #### Bash Helper Function
245 ```bash
246 fenrir_say() {
247 echo "command say $1" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-daemon.sock
248 }
249
250 # Usage
251 fenrir_say "Build completed"
252 ```
253
254 #### Python Integration
255 ```python
256 import socket
257 import os
258
259 def send_fenrir_command(command):
260 socket_path = "/tmp/fenrirscreenreader-daemon.sock"
261 if os.path.exists(socket_path):
262 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
263 try:
264 sock.connect(socket_path)
265 sock.send(command.encode('utf-8'))
266 finally:
267 sock.close()
268
269 send_fenrir_command("command say Process complete")
270 ```
271
272 ## Advanced Features
273
274 ### Table Navigation Mode
275
276 Fenrir includes advanced table navigation capabilities for working with tabular data in terminal applications, CSV files, and formatted text output.
277
278 #### Entering Table Mode
279 1. Press `Fenrir + Keypad *` (desktop) or `Fenrir + Y` (laptop)
280 2. Cycle through: Highlight tracking → Cursor tracking → Table mode
281 3. Listen for "table mode enabled" announcement
282
283 #### Table Navigation Commands
284 - **Column navigation**: `Keypad 4/6` - Move between columns
285 - **Row boundaries**: `Fenrir + Keypad 4/6` - Jump to first/last column
286 - **Cell characters**: `Fenrir + Keypad 1/3` - First/last character in cell
287 - **Set headers**: `Fenrir + X` - Mark current line as column headers
288
289 #### Table Features
290 - **Automatic detection**: Supports CSV, pipe-separated, space-aligned columns
291 - **Column headers**: Set and announce headers for better context
292 - **Boundary feedback**: Audio cues when reaching row boundaries
293 - **Cell-by-cell navigation**: Precise positioning within tables
294
295 ### Progress Bar Monitoring
296
297 Fenrir automatically detects and provides audio feedback for progress indicators.
298
299 #### Progress Detection
300 - **Percentage**: 45%, 67.5%, 100%
301 - **Fractions**: 15/100, 3 of 10, Step 7/15
302 - **Progress bars**: [#### ], [====> ]
303 - **Activity indicators**: Loading..., Processing...
304
305 #### Audio Feedback
306 - **Progress tones**: Ascending 400Hz-1200Hz frequency range
307 - **Activity beeps**: 800Hz tone every 2 seconds
308 - **Non-intrusive**: Doesn't interrupt speech or other audio
309
310 #### Usage
311 - **Enable**: Use `progress_bar_monitor` command (assign key binding)
312 - **Automatic**: Works with downloads, compilations, installations
313 - **Remote control**: Enable via socket commands
314
315 Fenrir detects stable progress structures rather than application-specific
316 status formats, which change too frequently to support reliably.
317
318 ### Spell Checking
319 - `Fenrir + S` - Spell check current word
320 - `Fenrir + S S` - Add word to dictionary
321 - `Fenrir + Shift + S` - Remove word from dictionary
322
323 ### Bookmarks (1-10)
324 - `Fenrir + Shift + [1-0]` - Set bookmark
325 - `Fenrir + [1-0]` - Go to bookmark
326 - `Fenrir + Ctrl + [1-0]` - Clear bookmark
327
328 ### Multiple Clipboards
329 - `Fenrir + Home/End` - First/last clipboard
330 - `Fenrir + PageUp/PageDown` - Previous/next clipboard
331
332 ### Window Mode
333 1. Set marks to define window area
334 2. `Fenrir + Keypad /` - Set window
335 3. `Fenrir + Keypad / /` - Clear window
336
337 ## Drivers
338
339 ### Speech Drivers
340 - **speechdDriver** - Speech-dispatcher (recommended)
341 - **genericDriver** - Command-line TTS (espeak, etc.)
342 - **dectalkDriver** - Serial DECtalk-compatible hardware speech
343 - **dectalkUsbDriver** - Native Access Solutions DECtalk USB (`0dd0:2001`)
344 - **litetalkDriver** - Serial LiteTalk-compatible hardware speech
345 - **doubletalkDriver** - Serial DoubleTalk LT-compatible hardware speech
346 - **tripletalkDriver** - Serial TripleTalk-compatible hardware speech
347
348 For serial hardware speech, set `speech#hardware_device` to an explicit path.
349 RPITalk gadget mode usually appears as `/dev/ttyACM0`; USB serial adapters
350 usually appear as `/dev/ttyUSB0`; built-in serial ports may be `/dev/ttyS0`.
351 The default baud rate is `9600`. `doubletalkDriver` targets
352 DoubleTalk LT-style serial devices, not the internal DoubleTalk PC ISA card.
353 The `dectalkUsbDriver` autodetects the native Access Solutions DECtalk USB and
354 ignores both serial settings. It requires PyUSB and a libusb backend. From a
355 source checkout, install them with
356 `python3 -m pip install '.[dectalk_usb]'`. A non-root Fenrir process also needs
357 a local udev rule granting its account read/write access to USB ID
358 `0dd0:2001`; do not make the device world-writable. USB TripleTalk devices work
359 only if Linux exposes them as a serial tty such as `/dev/ttyACM0` or
360 `/dev/ttyUSB0`.
361
362 ### Sound Drivers
363 - **genericDriver** - Sox-based (default)
364 - **gstreamerDriver** - GStreamer-based
365
366 ### Input Drivers
367 - **evdevDriver** - Linux evdev (recommended for Linux)
368 - **x11Driver** - X11 terminal-scoped input for `fenrir -x`
369
370 ### Screen Drivers
371 - **vcsaDriver** - Linux VCSA devices (TTY)
372 - **ptyDriver** - Terminal emulation
373
374 ### Remote Drivers
375 - **unixDriver** - Unix socket remote control (recommended)
376 - **tcpDriver** - TCP socket remote control (localhost only)
377
378 ## Command Line Options
379
380 ```
381 fenrir [OPTIONS]
382 ```
383
384 - `-h, --help` - Show help
385 - `-v, --version` - Show version
386 - `-f, --foreground` - Run in foreground
387 - `-s, --setting FILE` - Custom settings file
388 - `-o, --options SECTION#SETTING=VALUE;..` - Override settings
389 - `-d, --debug` - Enable debug mode
390 - `-p, --print` - Print debug to screen
391 - `-x, --x11` - PTY + X11 keyboard input scoped to the terminal window
392 - `--x11-window-id WINDOWID` - X11 window id to use for `--x11` terminal mode
393 - `-F, --force-all-screens` - Ignore ignore_screen setting
394 - `-i, -I, --ignore-screen SCREEN` - Ignore specific screen(s), can be used multiple times
395
396 ### X11 Terminal Mode
397
398 Use `fenrir -x` to run Fenrir in an X11 terminal as a normal user:
399
400 ```bash
401 fenrir -x
402 ```
403
404 This mode uses PTY screen monitoring and X11 keyboard input. It is intended for GUI terminals such as xterm and VTE-based terminals, while keeping Fenrir key handling scoped to that terminal window. Desktop screen readers keep their global bindings outside the focused terminal.
405
406 Fenrir normally detects the target terminal from `WINDOWID` or the active X11 window. If needed, pass a window id explicitly:
407
408 ```bash
409 fenrir -x --x11-window-id 0x123456
410 ```
411
412 X11 terminal mode uses the same keyboard layout files as TTY Fenrir. Supported Fenrir keys include numpad Insert/`KEY_KP0`, CapsLock/`KEY_CAPSLOCK`, Insert/`KEY_INSERT`, and Super/Windows/`KEY_META`. Compose script keys are exposed as `KEY_COMPOSE`.
413
414 In this mode Fenrir runs as a regular user. Settings are loaded from `~/.local/share/stormux/fenrirscreenreader/settings/settings.conf` when present, otherwise from `/etc/fenrirscreenreader/settings/settings.conf`; saving settings creates or updates the user-local file. User sound themes and scripts are read first from `~/.local/stormux/fenrir/sounds/` and `~/.local/stormux/fenrir/`.
415
416 This mode requires `python-xlib`.
417
418 For a dedicated PTY/terminal screen reader, see TDSR: https://github.com/tspivey/tdsr
419
420 ## Troubleshooting
421
422 ### No Speech
423 1. Test speech-dispatcher: `sudo spd-say "hello"`
424 2. Check driver setting in configuration
425 3. Verify speech-dispatcher is running
426
427 ### No Sound
428 1. Run audio configuration script: `configure_pulse.sh` or `configure_pipewire.sh`
429 2. Check sound driver setting
430 3. Verify sox installation
431
432 ### No Input Response
433 1. Check permissions: `/dev/input/*` and `/dev/uinput`
434 2. Verify evdev driver setting
435 3. Run as root for testing
436
437 ### Debug Mode
438 ```bash
439 sudo fenrir -f -d
440 # Debug output goes to /tmp/fenrir.log
441 ```
442
443 ## Getting Help
444
445 - **Tutorial Mode**: `Fenrir + H` (interactive help)
446 - **Wiki**: https://git.stormux.org/storm/fenrir/wiki
447 - **Email**: [email protected]
448 - **IRC**: irc.stormux.org #stormux
449
450 ## See Also
451
452 - [README.md](../README.md) - Installation and basic setup
453 - [diff_review_mode.md](./diff_review_mode.md) - Diff review workflow and key bindings
454 - [settings.conf](../config/settings/settings.conf) - Configuration reference
455 - `man fenrir` - Manual page