| 
									
										
										
										
											2021-09-05 10:45:01 +01:00
										 |  |  | #!/usr/bin/env bash | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bgdir="$HOME/pic/bg" | 
					
						
							|  |  |  | cache="$HOME/.cache/wal" | 
					
						
							|  |  |  | config="$HOME/.config" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | dir=$bgdir | 
					
						
							|  |  |  | if [ $# -eq 1 ]; then | 
					
						
							|  |  |  |     dir=$1 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-17 22:22:36 +00:00
										 |  |  | file=$(sxiv -o "$dir") | 
					
						
							| 
									
										
										
										
											2021-09-05 10:45:01 +01:00
										 |  |  | if [ $# -eq 1 ]; then | 
					
						
							| 
									
										
										
										
											2022-01-17 22:22:36 +00:00
										 |  |  |     cp "$file" "$bgdir"/"$(basename "$file")" | 
					
						
							| 
									
										
										
										
											2021-09-05 10:45:01 +01:00
										 |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # generate terminal colors with wal | 
					
						
							| 
									
										
										
										
											2022-01-17 22:22:36 +00:00
										 |  |  | wal -i "$file" | 
					
						
							| 
									
										
										
										
											2021-09-05 10:45:01 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | # move temporary files to config in case .cache gets nuked hee hoo | 
					
						
							|  |  |  | cp "$cache/colors-kitty.conf" "$config/kitty/colors-kitty.conf" | 
					
						
							|  |  |  | cp "$cache/colors-rofi-light.rasi" "$config/rofi/colors-rofi-light.rasi" | 
					
						
							|  |  |  | cp "$cache/colors-rofi-dark.rasi" "$config/rofi/colors-rofi-dark.rasi" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # update x resources | 
					
						
							|  |  |  | xrdb "$cache/colors.Xresources" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # set system theme with wpg | 
					
						
							|  |  |  | #wpg -a $file -l | 
					
						
							|  |  |  | #wpg -s $file -l | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # reload bspwm | 
					
						
							| 
									
										
										
										
											2022-01-17 22:22:36 +00:00
										 |  |  | "$HOME"/.config/bspwm/bspwmrc reload |