1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Follow symlink before writing config file. Fixes #884

This commit is contained in:
Rasmus Steinke 2018-12-22 09:36:48 +01:00
parent 8ea484349b
commit 5d50ae45cd

View file

@ -171,14 +171,16 @@ function set_theme()
fi
if [ -f "${CDIR}/config.rasi" ]
then
${SED} -i "/@import.*/d" "${CDIR}/config.rasi"
echo "@import \"${1}\"" >> "${CDIR}/config.rasi"
get_link=$(readlink -f "${CDIR}/config.rasi")
${SED} -i "/@import.*/d" "${get_link}"
echo "@import \"${1}\"" >> "${get_link}"
else
if [ -f "${CDIR}/config" ]
then
${SED} -i "/rofi\.theme: .*\.rasi$/d" "${CDIR}/config"
get_link=$(readlink -f "${CDIR}/config")
${SED} -i "/rofi\.theme: .*\.rasi$/d" "${get_link}"
fi
echo "rofi.theme: ${1}" >> "${CDIR}/config"
echo "rofi.theme: ${1}" >> "${get_link}"
fi
}