From 535cc5e6b97c3c0de31714e81599933acf4c3bfd Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Fri, 17 Feb 2023 11:53:32 +0000 Subject: [PATCH] updated lines mode for rofi, also adjusted compile script to allow install of specific app --- compile_urrl.sh | 24 +++++++++++++++++------- globurrl.nim | 4 ++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/compile_urrl.sh b/compile_urrl.sh index 85341de..1dafb8d 100755 --- a/compile_urrl.sh +++ b/compile_urrl.sh @@ -1,16 +1,26 @@ #!/bin/bash +build () { + dir="$1" + i="$2" + cd "./$dir" || exit + f=$(echo "$dir" | sed 's/\.\///') + nimble install -y + if [[ $i == "install" ]]; then + sudo cp -v "$f" "/usr/local/bin/$f" + fi + cd ../ +} + +if [[ $2 != "" ]]; then + build "$2" "$1" + exit +fi for dir in ./*; do if [ -d "$dir" ]; then if [[ "$dir" == "./" ]]; then continue fi - cd "$dir" || exit - f=$(echo "$dir" | sed 's/\.\///') - nimble install -y - if [[ $1 == "install" ]]; then - sudo cp -v "$f" "/usr/local/bin/$f" - fi - cd ../ + build "$dir" "$1" fi done diff --git a/globurrl.nim b/globurrl.nim index dc6986e..c0ba020 100644 --- a/globurrl.nim +++ b/globurrl.nim @@ -198,7 +198,7 @@ proc genMenuCmd*(data: Info, opts: varargs[string], rofi: bool = false): string cmd = cmd & text & "\n" cmd.removeSuffix("\n") - var x_lines = len(opts) + var x_lines = len(opts) + 1 if x_lines > MAX_LINES: x_lines = MAX_LINES @@ -208,7 +208,7 @@ proc genMenuCmd*(data: Info, opts: varargs[string], rofi: bool = false): string cmd = cmd & menu.command & " " cmd = cmd & menu.extra_cmd & " " cmd = cmd & menu.i_case & " " - cmd = cmd & menu.lines_shown & " " & $MAX_LINES & " " + cmd = cmd & menu.lines_shown & " " & $x_lines & " " cmd = cmd & menu.prompt & quote(data.title) cmd = cmd & menu.norm_bg & quote(data.unselected_bg) cmd = cmd & menu.norm_fg & quote(data.unselected_fg)