diff options
author | Rasmus Steinke <rasi@xssn.at> | 2017-10-15 17:23:30 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2017-10-15 17:23:30 +0200 |
commit | 743b393f1555390e72e8c470800a99e62d882a71 (patch) | |
tree | 72864d96f98774457b424562643f3e54b61039cd /script | |
parent | 673124b22c8f33839c4439d6e64dd62590649c6e (diff) |
fix offset on theme previews
Diffstat (limited to 'script')
-rwxr-xr-x | script/rofi-theme-selector | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/script/rofi-theme-selector b/script/rofi-theme-selector index 8973ec2c..687216d8 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} | head -n 1 ) + USER=$(${SED} -n 's/^.*User: \(.*\)/\1/p' ${file} ) if [ -z "${USER}" ] then theme_names+=(${NAME}) @@ -129,6 +129,7 @@ function select_theme () MORE_FLAGS+=(-kb-custom-1 "Alt-a") MORE_FLAGS+=(-u 2,3 -a 4,5 ) local CUR="default" + SELECTED="-1" while true do declare -i RTR @@ -140,9 +141,9 @@ Current theme: <b>${CUR}</b>""" THEME_FLAG= if [ -n "${SELECTED}" ] then - THEME_FLAG="-theme ${themes[${SELECTED}]}" + THEME_FLAG="-theme ${themes[${SELECTED}]}" fi - RES=$( create_theme_list | ${ROFI} ${THEME_FLAG} ${MORE_FLAGS[@]} -selected-row "${SELECTED}" -mesg "${MESG}") + RES=$( create_theme_list | ${ROFI} ${THEME_FLAG} ${MORE_FLAGS[@]} -cycle -selected-row "$(( ${SELECTED} +1 ))" -mesg "${MESG}") RTR=$? if [ ${RTR} = 10 ] then @@ -152,7 +153,7 @@ Current theme: <b>${CUR}</b>""" return 1; fi CUR=${theme_names[${RES}]} - SELECTED=${RES} + SELECTED=$(( ${RES} -1 )) done } |