diff options
Diffstat (limited to 'dot_local/bin')
| -rw-r--r-- | dot_local/bin/executable_dictate | 4 | ||||
| -rwxr-xr-x | dot_local/bin/executable_linkhandler | 3 | ||||
| -rw-r--r-- | dot_local/bin/executable_ocr | 3 | ||||
| -rwxr-xr-x | dot_local/bin/executable_record | 3 | ||||
| -rwxr-xr-x | dot_local/bin/executable_wqr | 8 |
5 files changed, 19 insertions, 2 deletions
diff --git a/dot_local/bin/executable_dictate b/dot_local/bin/executable_dictate index 7ad80bb..3cd763e 100644 --- a/dot_local/bin/executable_dictate +++ b/dot_local/bin/executable_dictate @@ -77,7 +77,9 @@ stop_and_transcribe() { fi printf '%s' "$text" | wl-copy - wtype -- "$text" + if [ "$(cat "$HOME/.config/dotfiles/role" 2>/dev/null)" != canonical ]; then + wtype -- "$text" + fi notify-send -t 2500 "🎙️ Dictated" "$text" } diff --git a/dot_local/bin/executable_linkhandler b/dot_local/bin/executable_linkhandler index e44dcc1..1ca006f 100755 --- a/dot_local/bin/executable_linkhandler +++ b/dot_local/bin/executable_linkhandler @@ -1,4 +1,7 @@ #!/usr/bin/env dash +if [ "$(cat "$HOME/.config/dotfiles/role" 2>/dev/null)" = canonical ]; then + exec /usr/bin/xdg-open "$@" +fi resolve_url() { if [ -f "$1" ]; then diff --git a/dot_local/bin/executable_ocr b/dot_local/bin/executable_ocr index aeadb51..d770911 100644 --- a/dot_local/bin/executable_ocr +++ b/dot_local/bin/executable_ocr @@ -21,6 +21,9 @@ if [ "${1:-}" ]; then } text="$(tesseract "$1" - -l "$lang" 2>/dev/null || true)" else + if [ "$(cat "$HOME/.config/dotfiles/role" 2>/dev/null)" = canonical ]; then + exec flatpak run com.github.dynobo.normcap + fi region="$(slurp 2>/dev/null)" || exit 0 text="$(grim -g "$region" - | tesseract - - -l "$lang" 2>/dev/null || true)" fi diff --git a/dot_local/bin/executable_record b/dot_local/bin/executable_record index ac88771..2601f9d 100755 --- a/dot_local/bin/executable_record +++ b/dot_local/bin/executable_record @@ -1,4 +1,7 @@ #!/usr/bin/env dash +if [ "$(cat "$HOME/.config/dotfiles/role" 2>/dev/null)" = canonical ]; then + exec /usr/bin/python3 "$HOME/.local/lib/dotfiles/record.py" "$@" +fi pid_file="/tmp/recordpid" log_file="/tmp/record.log" diff --git a/dot_local/bin/executable_wqr b/dot_local/bin/executable_wqr index 5f9d36d..b4cc123 100755 --- a/dot_local/bin/executable_wqr +++ b/dot_local/bin/executable_wqr @@ -8,4 +8,10 @@ else text="$1" fi -printf '%s' "$text" | qrencode -t PNG -o - | imv - +if [ "$(cat "$HOME/.config/dotfiles/role" 2>/dev/null)" = canonical ]; then + image=$(mktemp "${XDG_RUNTIME_DIR:?}/dotfiles-qr-XXXXXX.png") + printf '%s' "$text" | qrencode -t PNG -o "$image" + /usr/bin/xdg-open "$image" +else + printf '%s' "$text" | qrencode -t PNG -o - | imv - +fi |
