Fix creating config file if none exists.

Fixes: #895
This commit is contained in:
Dave Davenport 2019-01-22 15:53:12 +01:00
parent cac2eb1a7f
commit 274f2297aa

View file

@ -178,13 +178,18 @@ function set_theme()
${SED} -i "/@import.*/d" "${get_link}"
echo "@import \"${1}\"" >> "${get_link}"
else
if [ -f "${CDIR}/config" ]
if [ ! -e "${CDIR}/config" ]
then
# No file.
echo "rofi.theme: ${1}" >> "${CDIR}/config"
elif [ -f "${CDIR}/config" ]
then
# Regular file
get_link=$(readlink -f "${CDIR}/config")
${SED} -i "/rofi\.theme: .*\.rasi$/d" "${get_link}"
fi
echo "rofi.theme: ${1}" >> "${get_link}"
fi
fi
}
############################################################################################################