-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nerd-dictation: init at unstable-2023-04-19
Co-Authored-By: Reuben Steenekamp <[email protected]>
- Loading branch information
1 parent
809e888
commit 9367ac0
Showing
3 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
pkgs/applications/accessibility/nerd-dictation/default.nix
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,56 @@ | ||
{ fetchFromGitHub | ||
, substituteAll | ||
, lib | ||
, stdenv | ||
, python3 | ||
, pulseaudio | ||
, xdotool | ||
, ydotool | ||
, unstableGitUpdater | ||
}: | ||
|
||
python3.pkgs.buildPythonApplication rec { | ||
pname = "nerd-dictation"; | ||
version = "unstable-2023-04-19"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "ideasman42"; | ||
repo = "nerd-dictation"; | ||
rev = "96ef5ce64d37c7ebe9a704315665096ac4a697d4"; | ||
hash = "sha256-w8EG6x0ieb9PwetNHkRHDE1FjVEH7QvjxPasaQwOAkg="; | ||
}; | ||
|
||
patches = [ | ||
(substituteAll { | ||
src = ./fix-paths.patch; | ||
parec = "${pulseaudio}/bin/parec"; | ||
xdotool = "${xdotool}/bin/xdotool"; | ||
ydotool = "${ydotool}/bin/ydotool"; | ||
}) | ||
]; | ||
|
||
propagatedBuildInputs = with python3.pkgs; [ | ||
vosk-python | ||
]; | ||
|
||
postPatch = '' | ||
cd package/python | ||
''; | ||
|
||
# No tests. | ||
doCheck = false; | ||
|
||
# Broken for some reason. | ||
dontUsePythonCatchConflicts = true; | ||
|
||
passthru = { | ||
updateScript = unstableGitUpdater { }; | ||
}; | ||
|
||
meta = with lib; { | ||
description = "Simple, hackable offline speech to text"; | ||
homepage = "https://github.com/ideasman42/nerd-dictation"; | ||
license = licenses.gpl2Plus; | ||
maintainers = with maintainers; [ ]; | ||
}; | ||
} |
31 changes: 31 additions & 0 deletions
31
pkgs/applications/accessibility/nerd-dictation/fix-paths.patch
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,31 @@ | ||
diff --git a/nerd-dictation b/nerd-dictation | ||
index 9f4d1ad..f972c4f 100755 | ||
--- a/nerd-dictation | ||
+++ b/nerd-dictation | ||
@@ -138,7 +138,7 @@ def execfile(filepath: str, mod: Optional[ModuleType] = None) -> Optional[Module | ||
# Simulate Input: XDOTOOL | ||
# | ||
def simulate_typing_with_xdotool(delete_prev_chars: int, text: str) -> None: | ||
- cmd = "xdotool" | ||
+ cmd = "@xdotool@" | ||
|
||
# No setup/tear-down. | ||
if delete_prev_chars == SIMULATE_INPUT_CODE_COMMAND: | ||
@@ -169,7 +169,7 @@ def simulate_typing_with_xdotool(delete_prev_chars: int, text: str) -> None: | ||
# Simulate Input: YDOTOOL | ||
# | ||
def simulate_typing_with_ydotool(delete_prev_chars: int, text: str) -> None: | ||
- cmd = "ydotool" | ||
+ cmd = "@ydotool@" | ||
|
||
# No setup/tear-down. | ||
if delete_prev_chars == SIMULATE_INPUT_CODE_COMMAND: | ||
@@ -873,7 +873,7 @@ def recording_proc_with_non_blocking_stdout( | ||
) -> "Tuple[subprocess.Popen[bytes], IO[bytes]]": | ||
if input_method == "PAREC": | ||
cmd = ( | ||
- "parec", | ||
+ "@parec@", | ||
"--record", | ||
"--rate=%d" % sample_rate, | ||
"--channels=1", |
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