From aff435a0fb3a56b1d7b738c7dede363440884b3a Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Thu, 17 Sep 2026 15:05:36 +0100 Subject: Add the Canonical laptop profile and setup workflows --- dot_local/bin/executable_dictate | 4 +++- dot_local/bin/executable_linkhandler | 3 +++ dot_local/bin/executable_ocr | 3 +++ dot_local/bin/executable_record | 3 +++ dot_local/bin/executable_wqr | 8 +++++++- 5 files changed, 19 insertions(+), 2 deletions(-) (limited to 'dot_local/bin') 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 -- cgit v1.3.1