From e65b90757f9f88660a14987c91f8c5e58cc745b0 Mon Sep 17 00:00:00 2001 From: Amith Mohanan Date: Mon, 30 Jan 2023 16:14:28 +0530 Subject: [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 --- script/rofi-theme-selector | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/rofi-theme-selector b/script/rofi-theme-selector index 5a01729d..99eb6ac1 100755 --- a/script/rofi-theme-selector +++ b/script/rofi-theme-selector @@ -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}" } ############################################################################################################ -- cgit v1.2.3