diff --git a/script/rofi-theme-selector b/script/rofi-theme-selector
index 687216d8..374f8a5b 100755
--- a/script/rofi-theme-selector
+++ b/script/rofi-theme-selector
@@ -81,7 +81,7 @@ function find_themes()
themes+=(${file})
FN=$(basename ${file})
NAME=${FN%.*}
- USER=$(${SED} -n 's/^.*User: \(.*\)/\1/p' ${file} )
+ USER=$(${SED} -n 's/^.*User: \(.*\)/\1/p' ${file} | head -n 1 )
if [ -z "${USER}" ]
then
theme_names+=(${NAME})
@@ -143,7 +143,7 @@ Current theme: ${CUR}"""
then
THEME_FLAG="-theme ${themes[${SELECTED}]}"
fi
- RES=$( create_theme_list | ${ROFI} ${THEME_FLAG} ${MORE_FLAGS[@]} -cycle -selected-row "$(( ${SELECTED} +1 ))" -mesg "${MESG}")
+ RES=$( create_theme_list | ${ROFI} ${THEME_FLAG} ${MORE_FLAGS[@]} -cycle -selected-row "${SELECTED}" -mesg "${MESG}")
RTR=$?
if [ ${RTR} = 10 ]
then
@@ -153,7 +153,7 @@ Current theme: ${CUR}"""
return 1;
fi
CUR=${theme_names[${RES}]}
- SELECTED=$(( ${RES} -1 ))
+ SELECTED=${RES}
done
}