[rofi-theme-selector] prepend newline before specifying new theme (#1791)

* [rofi-theme-selector] prepend newline before specifying new theme

If the EOF is not a newline, new theme setting will fail.

* make sed substitution more readable

* simplify sed substitution
This commit is contained in:
Amith Mohanan 2023-01-30 16:14:28 +05:30 committed by GitHub
parent 96633031db
commit e65b90757f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -198,8 +198,10 @@ set_theme()
then
touch "${get_link}"
fi
${SED} -i 's/^\s*\(@theme\s\+".*"\)/\/\/\1/' "${get_link}"
echo "@theme \"${1}\"" >> "${get_link}"
# Comment old base theme, not replace as it may be modified after the line
${SED} -i '/^\s*@theme/ s,^,//,' "${get_link}"
echo -e "\n@theme \"${1}\"" >> "${get_link}"
}
############################################################################################################