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.

85 lines
1.8 KiB

  1. #!/bin/bash
  2. usage() {
  3. echo "Usage:"
  4. echo "$0:"
  5. echo " Install Gnome Extension: Disable-Gnome-Gesuture."
  6. echo "$0 uninstall:"
  7. echo " Uninstall Gnome Extension: Disable-Gnome-Gesuture."
  8. echo ""
  9. exit 0
  10. }
  11. CheckPermission() {
  12. echo -n "(I) Check user permission:"
  13. account=`whoami`
  14. if [ ${account} = "root" ]; then
  15. echo " ${account}, you are the supervisor."
  16. else
  17. echo " ${account}"
  18. echo -e "\033[1;31;5mYou are NOT the supervisor.\033[0m"
  19. echo -e "\033[1;31;5m(E) The root permission is required to run this installer.\033[0m"
  20. echo ""
  21. exit 1
  22. fi
  23. }
  24. InitMember(){
  25. drivername="eGalaxInfo"
  26. installpath="/usr/bin"
  27. driverEXE="${drivername}_${cpuArch}"
  28. gnomeShellPath="/usr/share/gnome-shell/extensions"
  29. gnomeShellDisaleGesture="disable-gestures@egalax"
  30. SupportDisableGnomeGesture="false" #Gnome Gesture Defalut is enabled.
  31. }
  32. install(){
  33. if [ -e ${gnomeShellPath} ];then #/usr/share/gnome-shell/extensions folder is exist
  34. echo "(I) Copying ${gnomeShellDisaleGesture} to ${gnomeShellPath}."
  35. cp -af "${gnomeShellDisaleGesture}" ${gnomeShellPath}
  36. gnome-shell-extension-tool -e ${gnomeShellDisaleGesture}
  37. else
  38. echo "(I) If you Need to disable Gnome Gesture"
  39. echo "\t please install gnome-shell-extension-tool, and try again."
  40. fi
  41. }
  42. uninstall(){
  43. gnome-shell-extension-tool -d ${gnomeShellDisaleGesture}
  44. if [ -e ${gnomeShellPath} ];then #/usr/share/gnome-shell/extensions folder is exist
  45. echo "(I) Remove ${gnomeShellDisaleGesture}."
  46. rm -rf ${gnomeShellPath}/${gnomeShellDisaleGesture}
  47. fi
  48. }
  49. if [ $# = 0 ]; then
  50. clear
  51. CheckPermission
  52. InitMember
  53. install
  54. elif [ $# -ge 1 ]; then
  55. if [ $1 = "uninstall" ]; then
  56. clear
  57. CheckPermission
  58. InitMember
  59. uninstall
  60. echo "(I) Gnome Extension: Disable Gnome Gesuture Uninstall Done."
  61. echo ""
  62. else
  63. usage
  64. fi
  65. fi