salman-abedin / bolt

Launcher wrapper for a lightning fast Unix workflow
GNU General Public License v3.0
64 stars 3 forks source link

dmenu/rofi search is broken #2

Open di72nn opened 3 years ago

di72nn commented 3 years ago

"$1" here is executing all content of $1 as one command, which doesn't exist. For it to work correctly quotation marks should not be used.

I patched it for myself like this:

dmenu_search() {
   QUERY=$(awk -F / '{print $(NF-1)"/"$NF}' "$SEARCHLIST" | $1) &&
      search_n_launch "$QUERY"
}

run_rofi() {
   rofi -sort true -sorting-method fzf -dmenu -i -p Open
}

run_dmenu() {
   dmenu -i
}

...
      --rofi-search)
         dmenu_search "run_rofi"
         ;;
      --dmenu-search) dmenu_search "run_dmenu" ;;

P.S.: I have some other suggestions, but I don't see a point in posting them since there are two branches existing in parallel.

ubuntupunk commented 2 years ago

Thank you! 👍🏽 This made it work for me.

NOTE: I had to also fix a typo I introduced in the .config/bolt/paths. Now its working.

UPDATE: Am also finding that the filter isn't screening out .git files and practically only works for hard paths.