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"
 | 
					cd "$wallpapers_dir"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# fzf selector
 | 
					if [ "$1" == "-s" ] ; then
 | 
				
			||||||
if [ "$1" == '-s' ] ; then
 | 
					 | 
				
			||||||
    # follows links and omits the env file
 | 
					 | 
				
			||||||
    selection=$(find -L -type f -printf '%P\n' | $finder)
 | 
					    selection=$(find -L -type f -printf '%P\n' | $finder)
 | 
				
			||||||
    if [ -n "$selection" ] ; then
 | 
					    if [ -n "$selection" ] ; then
 | 
				
			||||||
        # didnt exit
 | 
					        # didnt exit, overwrite wallpaper
 | 
				
			||||||
        swaybg --mode fill -i "$selection"
 | 
					        ln -sf "$wallpapers_dir/$selection" "$HOME/.wallpaper"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# feh slideshow selector
 | 
					# fill in wallpaper on each dispaly
 | 
				
			||||||
if [ "$1" == '-p' ] ; then
 | 
					for display in $(swaymsg -t get_outputs | gojq '.[].name' | tr -d '"')
 | 
				
			||||||
    # follows links and omits the env file
 | 
					do
 | 
				
			||||||
    # find -L -type f -printf '%P\n' | feh -A "echo '%f';"
 | 
					    swaymsg output "$display" bg "$HOME/.wallpaper" fill '#000000'
 | 
				
			||||||
    echo "BROKEN">&2
 | 
					done
 | 
				
			||||||
    exit 1
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user