mirror of
				https://codeberg.org/dwl/dwl-patches.git
				synced 2025-10-26 17:54:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			473 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			473 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| # Get client info
 | |
| read -r PID
 | |
| read -r TITLE
 | |
| read -r APPID
 | |
| read -r TAGS
 | |
| read -r GEOMETRY
 | |
| 
 | |
| [ -n "$GEOMETRY" ] || exit 1
 | |
| 
 | |
| tempdir="/tmp/screenshots"
 | |
| mkdir -p "$tempdir"
 | |
| file="$(mktemp -p "$tempdir" "XXXXXX.png")"
 | |
| 
 | |
| # Grab the screenshot! Very conviniently, GEOMETRY format matches the one
 | |
| # expected by grim
 | |
| grim -g "$GEOMETRY" "$file" || exit
 | |
| 
 | |
| wl-copy -t image/png < "$file"
 | |
| notify-send -i "$file" "Screenshot taken!" "Image copied to clipboard and saved to $file"
 | 
