Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion enhanced-voice-typing.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def type_text(self, text):
"""Type the text using ydotool or xdotool"""
try:
# Try ydotool first
subprocess.run(['ydotool', '--socket-path', '/run/ydotoold/socket', 'type', text + ' '],
subprocess.run(['ydotool', 'type', '-d1', '-H1', text + ' '],
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why ydotool has changed its interface to not require a socket path param, but require an env variable. Anyway, this worked for me. I'm on 1.0.4, which I believe is the latest, in NixOS unstable.

capture_output=True, text=True, check=True)
print(f"✓ {text}")
except:
Expand Down
4 changes: 2 additions & 2 deletions voice
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ elif [ "$XDG_SESSION_TYPE" = "x11" ]; then
fi

# Run enhanced version (with pre-buffer to capture initial words)
cd /home/jordan/voice-typing-nix
exec nix-shell shell.nix --run "python enhanced-voice-typing.py $DEFAULT_ARGS $*"
cd "$(dirname "$0")"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the correct way to CD into the folder that the script is running from. It looked like there might be some more comprehensive options, but this works fine for me.

YDOTOOL_SOCKET=/run/ydotoold/socket exec nix-shell shell.nix --run "python enhanced-voice-typing.py $DEFAULT_ARGS $*"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the other side of the Python code change above. It looks like there was a change in the env or param for ydotool? This environment variable matches up with one that is set in your nix service definition file.