mirror of
				https://github.com/tiyn/dotfiles.git
				synced 2025-11-03 22:11:16 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
while read file
 | 
						|
do
 | 
						|
        case "$1" in
 | 
						|
        "w") wallpaper desktop "$file" & ;;
 | 
						|
        "l") wallpaper lock "$file" & ;;
 | 
						|
        "c")
 | 
						|
		[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
 | 
						|
		[ -z "$destdir" ] && exit
 | 
						|
		cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
 | 
						|
		;;
 | 
						|
        "m")
 | 
						|
		[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
 | 
						|
		[ -z "$destdir" ] && exit
 | 
						|
		mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
 | 
						|
		;;
 | 
						|
	"r")
 | 
						|
		convert -rotate 90 "$file" "$file" ;;
 | 
						|
	"R")
 | 
						|
		convert -rotate -90 "$file" "$file" ;;
 | 
						|
	"f")
 | 
						|
		convert -flop "$file" "$file" ;;
 | 
						|
	"y")
 | 
						|
		echo -n "$file" | xclip -selection clipboard &&
 | 
						|
		notify-send "$file copied to clipboard" & ;;
 | 
						|
	"Y")
 | 
						|
		echo -n "$(readlink -f "$file")" | xclip -selection clipboard &&
 | 
						|
			notify-send "$(readlink -f "$file") copied to clipboard" & ;;
 | 
						|
	"d")
 | 
						|
		[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
 | 
						|
	"g")	ifinstalled gimp && gimp "$file" & ;;
 | 
						|
        esac
 | 
						|
done
 |