searx-search.sh 542 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env bash
  2. # -----------------------------------------------------------------------------
  3. # Requirements:
  4. # rofi
  5. # Description:
  6. # Use rofi to search the web.
  7. # Usage:
  8. # searx-search.sh
  9. # -----------------------------------------------------------------------------
  10. # Script:
  11. URL="https://duckduckgo.com/?q="
  12. main() {
  13. # Open rofi for prompt
  14. query=$(rofi -dmenu -matching fuzzy -location 0 -p "Query > ")
  15. if [[ -n "$query" ]]; then
  16. url=$URL$query
  17. qutebrwoser ":open -w $url"
  18. else
  19. exit
  20. fi
  21. }
  22. main
  23. exit 0