From aa0cd52a7f327f41a64bc92f615169b66ccb383e Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Sun, 15 Oct 2017 17:55:41 +0200 Subject: [PATCH] fix user being split from theme name --- script/rofi-theme-selector | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 }