half working sway lock cleaning old stuff
This commit is contained in:
		
							parent
							
								
									3d6ba185af
								
							
						
					
					
						commit
						811307c06c
					
				
							
								
								
									
										16
									
								
								bin/swaylock-blur
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								bin/swaylock-blur
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,16 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
LOCK=~/.config/sway/lock.png
 | 
			
		||||
 | 
			
		||||
# go over each output and ss/blur then add to img
 | 
			
		||||
for OUTPUT in $(swaymsg -t get_outputs | gojq '.[].name' | tr -d '"')
 | 
			
		||||
do
 | 
			
		||||
    IMAGE="${OUTPUT}_img.jpg"
 | 
			
		||||
    grim -t jpeg -o $OUTPUT $IMAGE
 | 
			
		||||
    convert $IMAGE -blur 5x3 - | composite -gravity center $LOCK - $IMAGE
 | 
			
		||||
    LOCKARGS="${LOCKARGS} --image ${OUTPUT}:${IMAGE}"
 | 
			
		||||
    IMAGES="${IMAGES} ${IMAGE}"
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
swaylock $LOCKARGS
 | 
			
		||||
rm $IMAGES
 | 
			
		||||
@ -5,20 +5,16 @@ finder="rofi-dmenu Wallpaper"
 | 
			
		||||
 | 
			
		||||
cd "$wallpapers_dir"
 | 
			
		||||
 | 
			
		||||
# fzf selector
 | 
			
		||||
if [ "$1" == '-s' ] ; then
 | 
			
		||||
    # follows links and omits the env file
 | 
			
		||||
if [ "$1" == "-s" ] ; then
 | 
			
		||||
    selection=$(find -L -type f -printf '%P\n' | $finder)
 | 
			
		||||
    if [ -n "$selection" ] ; then
 | 
			
		||||
        # didnt exit
 | 
			
		||||
        swaybg --mode fill -i "$selection"
 | 
			
		||||
        # didnt exit, overwrite wallpaper
 | 
			
		||||
        ln -sf "$wallpapers_dir/$selection" "$HOME/.wallpaper"
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# feh slideshow selector
 | 
			
		||||
if [ "$1" == '-p' ] ; then
 | 
			
		||||
    # follows links and omits the env file
 | 
			
		||||
    # find -L -type f -printf '%P\n' | feh -A "echo '%f';"
 | 
			
		||||
    echo "BROKEN">&2
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
# fill in wallpaper on each dispaly
 | 
			
		||||
for display in $(swaymsg -t get_outputs | gojq '.[].name' | tr -d '"')
 | 
			
		||||
do
 | 
			
		||||
    swaymsg output "$display" bg "$HOME/.wallpaper" fill '#000000'
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user