Update more scripts to be just scripts
This commit is contained in:
		
							parent
							
								
									163debc8a0
								
							
						
					
					
						commit
						611a41562e
					
				
					 12 changed files with 167 additions and 183 deletions
				
			
		
							
								
								
									
										49
									
								
								scripts/screenshotsh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								scripts/screenshotsh
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,49 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
export XCURSOR_SIZE=40
 | 
			
		||||
export XCURSOR_THEME='capitaine-cursors-light'
 | 
			
		||||
 | 
			
		||||
screenshot="grim"
 | 
			
		||||
copy="wl-copy -t image/png"
 | 
			
		||||
 | 
			
		||||
if which xdg-user-dir >/dev/null 2>&1; then
 | 
			
		||||
    DESTFOLDER="$(xdg-user-dir PICTURES)"
 | 
			
		||||
else
 | 
			
		||||
    for i in Images Imagens Pictures Fotos ""; do
 | 
			
		||||
        DESTFOLDER="$HOME/$i"
 | 
			
		||||
        test -d "$DESTFOLDER" &&
 | 
			
		||||
            break
 | 
			
		||||
    done
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
DESTFOLDER="$DESTFOLDER/Screenshots"
 | 
			
		||||
mkdir -p "$DESTFOLDER"
 | 
			
		||||
DESTFILE="$DESTFOLDER/$(date +'%Y-%m-%d-%H%M%S_screenshot.png')"
 | 
			
		||||
 | 
			
		||||
case $1 in
 | 
			
		||||
    def)
 | 
			
		||||
        # Screenshot to file
 | 
			
		||||
        $screenshot "$DESTFILE"
 | 
			
		||||
        echo "$DESTFILE"
 | 
			
		||||
        ;;
 | 
			
		||||
 | 
			
		||||
    area)
 | 
			
		||||
        # Screen area to file
 | 
			
		||||
        $screenshot -g "$(slurp -d -b 30303088)" "$DESTFILE"
 | 
			
		||||
        echo "$DESTFILE"
 | 
			
		||||
        ;;
 | 
			
		||||
    area-clip)
 | 
			
		||||
        # Screen area to clipboard
 | 
			
		||||
        $screenshot -g "$(slurp -d -b 30303088)" - | $copy
 | 
			
		||||
        ;;
 | 
			
		||||
 | 
			
		||||
    clip)
 | 
			
		||||
        # Focused monitor to clipboard
 | 
			
		||||
        cur_output=$(swaymsg -t get_outputs |
 | 
			
		||||
            jq -r '.[] | select(.focused) | .name')
 | 
			
		||||
 | 
			
		||||
        test -n "$cur_output" &&
 | 
			
		||||
            $screenshot -o "$cur_output" - | $copy ||
 | 
			
		||||
            $screenshot - | $copy
 | 
			
		||||
        ;;
 | 
			
		||||
esac
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue