-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
183 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
title: /https://chat.openai.com/ | ||
|
||
- | ||
Open new chat: key(ctrl-shift-o) | ||
Focus chat input: key(shift-esc) | ||
Copy last code block: key(ctrl-shift-;) | ||
Copy last response: key(ctrl-shift-c) | ||
|
||
speak [last] ( response | output | chat ): | ||
key(ctrl-shift-c) | ||
sleep(0.3) | ||
user.tts(clip.text()) | ||
|
||
speak last code [block]: | ||
key(ctrl-shift-;) | ||
sleep(0.3) | ||
user.tts(clip.text()) | ||
|
||
Set custom instructions: key(ctrl-shift-i) | ||
Toggle sidebar: key(ctrl-shift-s) | ||
Delete chat: key(ctrl-shift-delete) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import os, configparser | ||
from talon import actions, Module, Context | ||
|
||
PATH = os.path.expanduser("~\\AppData\\Roaming\\nvda\\nvda.ini") | ||
|
||
""" | ||
Read in and parse the nvda.ini file, then write back to it. | ||
We need to skip the first line of the file, which is a schema version | ||
and would otherwise cause the configparser to fail since it isn't valid ini | ||
""" | ||
|
||
|
||
mod = Module() | ||
@mod.action_class | ||
class Actions: | ||
def nvda_set_setting(setting: str, value: bool): | ||
"""Sets an NVDA setting to a given value""" | ||
|
||
ctx = Context() | ||
ctx.matches = r""" | ||
os: windows | ||
""" | ||
|
||
@ctx.action_class("user") | ||
class UserActions: | ||
def nvda_set_setting(setting: str, value: bool): | ||
|
||
# Load the nvda.ini file, skipping the first line | ||
with open(PATH, 'r') as f: | ||
next(f) # Skip the first line | ||
config_string = f.read() | ||
|
||
config = configparser.RawConfigParser() | ||
config.optionxform = str | ||
config.read_string(config_string) | ||
|
||
# Search for the speakTypedWords setting in all sections | ||
for section in config.sections(): | ||
if setting in config[section]: | ||
config[section][setting] = str(value) | ||
|
||
# Save the changes back to the nvda.ini file, preserving the first line | ||
with open(PATH, 'r') as f: | ||
first_line = next(f) # Save the first line | ||
|
||
with open(PATH, 'w') as configfile: | ||
configfile.write(first_line) # Write the first line back to the file | ||
config.write(configfile) # Write the rest of the config | ||
print(f"Set NVDA setting: {setting} to {value}") | ||
actions.user.with_nvda_mod_press("ctrl-r") | ||
|
||
|
||
# cron.after then refresh after the dictation is done. Hard to figure out | ||
# how to do this though since we don't have a callback for when the dictatio | ||
# is done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# speak typed words: user.nvda_set_setting("speakTypedWords", True) | ||
# computer: user.nvda_set_setting("speakTypedCharacters", false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters