diff options
author | Rasmus Steinke <rasi@xssn.at> | 2018-12-22 09:36:48 +0100 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2018-12-22 09:36:48 +0100 |
commit | 5d50ae45cdc5e0901be02e4d72b0dc9f4d133bca (patch) | |
tree | 2a347b381984e986d6ff2d3cbb37446586307385 /script | |
parent | 8ea484349b931a91474c2e35ee7a725101eaf2a5 (diff) |
Follow symlink before writing config file. Fixes #884
Diffstat (limited to 'script')
-rwxr-xr-x | script/rofi-theme-selector | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/script/rofi-theme-selector b/script/rofi-theme-selector index 4184ebcb..eec7b0a8 100755 --- a/script/rofi-theme-selector +++ b/script/rofi-theme-selector @@ -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 } |