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

9 lines
271 B
Bash
Raw Normal View History

2023-05-17 03:50:02 -07:00
#!/usr/bin/env zsh
2023-05-18 01:19:56 -07:00
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"