random-scripts/old/x11/copy-screen-text.sh

9 lines
271 B
Bash
Executable File

#!/usr/bin/env zsh
local text="$(maim -k -s -f png | tesseract stdin stdout -l eng 2>/dev/null)"
let char_count="$(printf '%s' "${text}" | wc -c)"
printf '%s' "${text}" | xclip -selection clipboard
notify-send -t 5000 "Coppied Text" "Coppied ${char_count} characters"