handle bang snippet and copyq
This commit is contained in:
		
							
								
								
									
										8
									
								
								snippy
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								snippy
									
									
									
									
									
								
							@@ -74,8 +74,14 @@ run(){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if [ -f "${DIR}/${FILE}" ]; then
 | 
					    if [ -f "${DIR}/${FILE}" ]; then
 | 
				
			||||||
        # Put the contents of the selected file into the paste buffer.
 | 
					        # Put the contents of the selected file into the paste buffer.
 | 
				
			||||||
 | 
					        # bang is a bash template, don't pass it to bashdown
 | 
				
			||||||
 | 
					        if [[ ${FILE} == "bang" ]]; then
 | 
				
			||||||
 | 
					            content="$(cat "${DIR}/${FILE}")"
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
            content="$(bashdown < "${DIR}/${FILE}")"
 | 
					            content="$(bashdown < "${DIR}/${FILE}")"
 | 
				
			||||||
        if [[ "${#content}" == 0 ]]; then
 | 
					        fi
 | 
				
			||||||
 | 
					        # clip launch copyq
 | 
				
			||||||
 | 
					        if [[ ! ${FILE} == "clip" ]] && [[ "${#content}" == 0 ]]; then
 | 
				
			||||||
            printf "%s" "${FILE}" > $TMPFILE
 | 
					            printf "%s" "${FILE}" > $TMPFILE
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            printf "%s" "$content" > $TMPFILE
 | 
					            printf "%s" "$content" > $TMPFILE
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user