Dotfiles for different machines on different branches.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
666 B

  1. #!/bin/sh
  2. # Gives a dmenu prompt to search Startpage.
  3. # Without input, will open Startpage.com.
  4. # URLs will be directly handed to the browser.
  5. # Anything else, it search it.
  6. # original by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
  7. browser=${RTVBROWSER:-firefox}
  8. pgrep -x dmenu && exit
  9. choice=$(echo "Startpage" | dmenu -i -p "Search Startpage:") || exit 1
  10. if [ "$choice" = "Startpage" ]; then
  11. $RTV_BROWSER "https://startpage.com"
  12. else
  13. if echo "$choice" | grep "^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$"; then
  14. $RTV_BROWSER "$choice"
  15. else
  16. $RTV_BROWSER "https://startpage.com/do/search/?q=$choice"
  17. fi
  18. fi