mirror of
				https://github.com/ItsDrike/dotfiles.git
				synced 2025-11-04 09:16:36 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
	
		
			421 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
	
		
			421 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/bin/bash
 | 
						|
set -euo pipefail
 | 
						|
 | 
						|
id=$(tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w 6 | head -n 1 || true)
 | 
						|
echo "Image ID: $id"
 | 
						|
 | 
						|
echo "Taking screenshot..."
 | 
						|
grim -g "$(slurp -w 0)" /tmp/ocr-"$id".png
 | 
						|
 | 
						|
echo "Running OCR..."
 | 
						|
tesseract /tmp/ocr-"$id".png - | wl-copy
 | 
						|
echo -en "File saved to /tmp/ocr-'$id'.png\n"
 | 
						|
 | 
						|
 | 
						|
echo "Sending notification..."
 | 
						|
notify-send "OCR " "Text copied!"
 | 
						|
 | 
						|
echo "Cleaning up..."
 | 
						|
rm /tmp/ocr-"$id".png -vf
 |