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.

22 lines
623 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. pgrep -x dmenu && exit
  8. choice=$(echo "Startpage" | dmenu -i -p "Search Startpage:") || exit 1
  9. if [ "$choice" = "Startpage" ]; then
  10. $BROWSER "https://startpage.com"
  11. else
  12. if echo "$choice" | grep "^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$"; then
  13. $BROWSER "$choice"
  14. else
  15. $BROWSER "https://startpage.com/do/search/?q=$choice"
  16. fi
  17. fi