Stypox / dicio-android

Dicio assistant app for Android
GNU General Public License v3.0
644 stars 63 forks source link

Feature request: Intent and/or keyboard shortcut (Ctrl +c?) to copy text from SttServiceActivity #212

Open sudomain opened 3 months ago

sudomain commented 3 months ago

EDIT (a few days later): On second thought, maybe an option to automatically copy to the clipboard once the speaking is done would be more maintainable?

Hello,

A keyboard shortcut or intent to copy the text in SttServiceActivity would be very useful to me. I would use it programmatically to get text into Termux using SttServiceActivity. Something along the lines of:

#!/bin/bash

# Start dicio STT
am start -n org.stypox.dicio/.input.stt_service.SttServiceActivity

# Intent to copy STT text here. alternatively an intent can be sent through Key Mapper to trigger the keyboard shortcut

# Make sure Termux is in foreground so that termux-get-clipboard works
am start -n com.termux/com.termux.app.TermuxActivity

# Get clipboard content
response=$(termux-clipboard-get)

if [[ $response == *"some value"* ]]; then

...

Incidentally this pattern could be used to extend the set of Dicio skills using tools in Termux, Termux:API, and intent recieving apps via Termux's version of am