summaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-01-19 09:19:14 +0100
committerDave Davenport <qball@gmpclient.org>2017-01-19 09:19:14 +0100
commit823d1b46511abc5904f7358636ccd7ec2cbc25ea (patch)
treea38a7709c2ffa245356fffe3d6fbfe3e73f6bd22 /script
parent3a7fde924a9efd3c2df73961d2b19bc727c1f77d (diff)
Convert built-in themes to new format.
Diffstat (limited to 'script')
-rwxr-xr-xscript/rofi-theme-selector15
1 files changed, 9 insertions, 6 deletions
diff --git a/script/rofi-theme-selector b/script/rofi-theme-selector
index a9041068..4a03e1eb 100755
--- a/script/rofi-theme-selector
+++ b/script/rofi-theme-selector
@@ -74,7 +74,7 @@ function find_themes()
if [ -n "${p}" ] && [ -d "${TD}" ]
then
echo "Checking themes in: ${TD}"
- for file in ${TD}/*.theme
+ for file in ${TD}/*.rasi
do
if [ -f "${file}" ]
then
@@ -137,7 +137,12 @@ function select_theme ()
<b>Alt-a</b> to accept the new theme.
<b>Escape</b> to cancel
Current theme: <b>${CUR}</b>"""
- RES=$( create_theme_list | ${ROFI} ${MORE_FLAGS[@]} -selected-row "${SELECTED}" -mesg "${MESG}")
+ THEME_FLAG=
+ if [ -n "${SELECTED}" ]
+ then
+ THEME_FLAG="-theme ${themes[${SELECTED}]}"
+ fi
+ RES=$( create_theme_list | ${ROFI} ${THEME_FLAG} ${MORE_FLAGS[@]} -selected-row "${SELECTED}" -mesg "${MESG}")
RTR=$?
if [ ${RTR} = 10 ]
then
@@ -146,8 +151,6 @@ Current theme: <b>${CUR}</b>"""
then
return 1;
fi
- ${SED} -i '/#include .*/d' ${TMP_CONFIG_FILE}
- echo "#include \"${themes[${RES}]}\"" >> ${TMP_CONFIG_FILE}
CUR=${theme_names[${RES}]}
SELECTED=${RES}
done
@@ -166,9 +169,9 @@ function set_theme()
fi
if [ -f "${CDIR}/config" ]
then
- ${SED} -i "/#include \".*\.theme\"$/d" "${CDIR}/config"
+ ${SED} -i "/rofi\.theme: \".*\.rasi\"$/d" "${CDIR}/config"
fi
- echo "#include \"${1}\"" >> "${CDIR}/config"
+ echo "rofi.theme: ${1}" >> "${CDIR}/config"
}