apps.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. # Links
  9. terminal=""
  10. files=""
  11. editor=""
  12. browser=""
  13. music=""
  14. settings=""
  15. # Error msg
  16. msg() {
  17. rofi -theme "$dir/message.rasi" -e "$1"
  18. }
  19. # Variable passed to rofi
  20. options="$terminal\n$files\n$editor\n$browser\n$music\n$settings"
  21. chosen="$(echo -e "$options" | $rofi_command -p "Most Used" -dmenu -selected-row 0)"
  22. case $chosen in
  23. $terminal)
  24. if [[ -f /usr/bin/termite ]]; then
  25. termite &
  26. elif [[ -f /usr/bin/urxvt ]]; then
  27. urxvt &
  28. elif [[ -f /usr/bin/kitty ]]; then
  29. kitty &
  30. elif [[ -f /usr/bin/xterm ]]; then
  31. xterm &
  32. elif [[ -f /usr/bin/xfce4-terminal ]]; then
  33. xfce4-terminal &
  34. elif [[ -f /usr/bin/gnome-terminal ]]; then
  35. gnome-terminal &
  36. else
  37. msg "No suitable terminal found!"
  38. fi
  39. ;;
  40. $files)
  41. if [[ -f /usr/bin/thunar ]]; then
  42. thunar &
  43. elif [[ -f /usr/bin/pcmanfm ]]; then
  44. pcmanfm &
  45. else
  46. msg "No suitable file manager found!"
  47. fi
  48. ;;
  49. $editor)
  50. if [[ -f /usr/bin/geany ]]; then
  51. geany &
  52. elif [[ -f /usr/bin/leafpad ]]; then
  53. leafpad &
  54. elif [[ -f /usr/bin/mousepad ]]; then
  55. mousepad &
  56. elif [[ -f /usr/bin/code ]]; then
  57. code &
  58. else
  59. msg "No suitable text editor found!"
  60. fi
  61. ;;
  62. $browser)
  63. if [[ -f /usr/bin/firefox ]]; then
  64. firefox &
  65. elif [[ -f /usr/bin/chromium ]]; then
  66. chromium &
  67. elif [[ -f /usr/bin/midori ]]; then
  68. midori &
  69. else
  70. msg "No suitable web browser found!"
  71. fi
  72. ;;
  73. $music)
  74. if [[ -f /usr/bin/lxmusic ]]; then
  75. lxmusic &
  76. else
  77. msg "No suitable music player found!"
  78. fi
  79. ;;
  80. $settings)
  81. if [[ -f /usr/bin/xfce4-settings-manager ]]; then
  82. xfce4-settings-manager &
  83. else
  84. msg "No suitable settings manager found!"
  85. fi
  86. ;;
  87. esac