quicklinks.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/usr/bin/env bash
  2. ## Author : Aditya Shakya
  3. ## Mail : adi1090x@gmail.com
  4. ## Github : @adi1090x
  5. ## Twitter : @adi1090x
  6. dir="$HOME/.config/rofi/applets/android"
  7. rofi_command="rofi -theme $dir/six.rasi"
  8. # Error msg
  9. msg() {
  10. rofi -theme "$dir/message.rasi" -e "$1"
  11. }
  12. # Browser
  13. if [[ -f /usr/bin/firefox ]]; then
  14. app="firefox"
  15. elif [[ -f /usr/bin/chromium ]]; then
  16. app="chromium"
  17. elif [[ -f /usr/bin/midori ]]; then
  18. app="midori"
  19. else
  20. msg "No suitable web browser found!"
  21. exit 1
  22. fi
  23. # Links
  24. google=""
  25. facebook=""
  26. twitter=""
  27. github=""
  28. mail=""
  29. youtube=""
  30. # Variable passed to rofi
  31. options="$google\n$facebook\n$twitter\n$github\n$mail\n$youtube"
  32. chosen="$(echo -e "$options" | $rofi_command -p "Open In : Firefox" -dmenu -selected-row 0)"
  33. case $chosen in
  34. $google)
  35. $app https://www.google.com &
  36. ;;
  37. $facebook)
  38. $app https://www.facebook.com &
  39. ;;
  40. $twitter)
  41. $app https://www.twitter.com &
  42. ;;
  43. $github)
  44. $app https://www.github.com &
  45. ;;
  46. $mail)
  47. $app https://www.gmail.com &
  48. ;;
  49. $youtube)
  50. $app https://www.youtube.com &
  51. ;;
  52. esac