summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmith Mohanan <amithm7@gmail.com>2023-01-30 16:14:28 +0530
committerGitHub <noreply@github.com>2023-01-30 11:44:28 +0100
commite65b90757f9f88660a14987c91f8c5e58cc745b0 (patch)
tree77803b83b09e5c734e7186c6ed5585bfed0b6bc5
parent96633031dbab59ca4006ecddf0fa31e45f130389 (diff)
[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
-rwxr-xr-xscript/rofi-theme-selector6
1 files 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}"
}
############################################################################################################