fix default search engine when target isnt a bookmark

This commit is contained in:
fenze 2022-05-13 14:41:24 +02:00
parent 8161461da7
commit fb5df91cad
2 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ all:
install: all
su -c "cp -f ./rose /usr/local/bin/rose && \
cp -f ./scripts/rose-open.sh /usr/local/bin/dmenu_rose"
cp -f ./scripts/dmenu_rose.sh /usr/local/bin/dmenu_rose"
clean:
rm -f rose compile_flags.txt
@ -31,4 +31,4 @@ clean:
flags:
echo $(CFLAGS) | sed 's/ /\n/g' > compile_flags.txt
.SILENT: all clean flags
.SILENT: all clean install flags

View File

@ -27,11 +27,11 @@ search()
[ -z "$ROSE_GO" ] || {
[ -z "$(printf "$BOOKMARKS" | grep -w "$SEARCH")" ] && {
xprop -id "$CURRENT_ID" -f "_ROSE_GO" 8u -set "_ROSE_GO" $SEARCH
xprop -id "$CURRENT_ID" -f "_ROSE_GO" 8u -set "_ROSE_GO" https://duckduckgo.com/?q="$SEARCH"
exit
} || {
FULL_URL=$(printf "$BOOKMARKS" | grep -w "$SEARCH" | sed 's/ /\./g')
xprop -id "$CURRENT_ID" -f "_ROSE_GO" 8u -set "_ROSE_GO" https://"$FULL_URL"
xprop -id "$CURRENT_ID" -f "_ROSE_GO" 8u -set "_ROSE_GO" $FULL_URL
exit
}
}