|
@@ -81,7 +81,16 @@ both" | |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ddg() { |
|
|
ddg() { |
|
|
search_string="$(printf "" | dmenu -p 'ddg')" |
|
|
|
|
|
|
|
|
search_string="$(printf "New window\nBookmarks\nHistory" | dmenu -p "ddg")" |
|
|
|
|
|
search_mode='tab' |
|
|
|
|
|
|
|
|
|
|
|
case "$search_string" in |
|
|
|
|
|
'New window') search_mode='window'; search_string=$(printf '' | dmenu -p 'new ddg');; |
|
|
|
|
|
'Bookmarks');; |
|
|
|
|
|
'History') ;; |
|
|
|
|
|
*) printf "Invalid argument";; |
|
|
|
|
|
esac |
|
|
|
|
|
|
|
|
string_length=$(expr length "$search_string") |
|
|
string_length=$(expr length "$search_string") |
|
|
char=''; new_string=''; |
|
|
char=''; new_string=''; |
|
|
|
|
|
|
|
@@ -94,7 +103,11 @@ ddg() { |
|
|
i=$(expr $i + 1) |
|
|
i=$(expr $i + 1) |
|
|
done |
|
|
done |
|
|
search="https://duckduckgo.com/?q=$new_string" |
|
|
search="https://duckduckgo.com/?q=$new_string" |
|
|
brave-browser "$search" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case "$search_mode" in |
|
|
|
|
|
tab) brave-browser "$search";; |
|
|
|
|
|
window) brave-browser --new-window "$search";; |
|
|
|
|
|
esac |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
rawurlencode() { |
|
|
rawurlencode() { |
|
|