mirror of
				https://github.com/davatorium/rofi.git
				synced 2025-10-30 23:47:19 -04:00 
			
		
		
		
	Follow symlink before writing config file. Fixes #884
This commit is contained in:
		
							parent
							
								
									8ea484349b
								
							
						
					
					
						commit
						5d50ae45cd
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
					@ -171,14 +171,16 @@ function set_theme()
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
    if [ -f "${CDIR}/config.rasi" ]
 | 
					    if [ -f "${CDIR}/config.rasi" ]
 | 
				
			||||||
    then
 | 
					    then
 | 
				
			||||||
        ${SED} -i "/@import.*/d" "${CDIR}/config.rasi"
 | 
					    	get_link=$(readlink -f "${CDIR}/config.rasi")
 | 
				
			||||||
        echo "@import \"${1}\"" >> "${CDIR}/config.rasi"
 | 
					        ${SED} -i "/@import.*/d" "${get_link}"
 | 
				
			||||||
 | 
					        echo "@import \"${1}\"" >> "${get_link}"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        if [ -f "${CDIR}/config" ]
 | 
					        if [ -f "${CDIR}/config" ]
 | 
				
			||||||
        then
 | 
					        then
 | 
				
			||||||
            ${SED} -i "/rofi\.theme: .*\.rasi$/d" "${CDIR}/config"
 | 
					    		get_link=$(readlink -f "${CDIR}/config")
 | 
				
			||||||
 | 
					            ${SED} -i "/rofi\.theme: .*\.rasi$/d" "${get_link}"
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
        echo "rofi.theme: ${1}" >> "${CDIR}/config"
 | 
					        echo "rofi.theme: ${1}" >> "${get_link}"
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue