yokmp

mms.cfg settings

Dec 1st, 2012
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.58 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # ------------------------------------------------------------------------------
  4. #
  5. # If you use Mozilla then you can use:
  6. # https://addons.mozilla.org/en-US/firefox/addon/flash-aid/
  7. #
  8. # This script is for NON-Mozilla users. You can set different configurations
  9. # to turn off crashes in Flash, blue-peoples-bug and the like.
  10. #
  11. # Also fiddling around with enabling and disabling HardwareAcceleration (rightclick on video)
  12. # can help you. Sometimes ...
  13. #
  14. # Remember to refresh the page to let the changes take effect.
  15. #
  16. # OverrideGPUValidation    = $1, only 0 or 1. else nothing happens.
  17. # EnableLinuxHWVideoDecode = $2, same as above.
  18. #
  19. # Some settings and how they behave:
  20. #
  21. # Firefox 16.0.2
  22. # Settings                      YouTube         Vimeo            GameTrailers
  23. # OverrideGPUValidation=1
  24. # EnableLinuxHWVideoDecode=1    Works           Crashes plugin   Crashes plugin
  25. #
  26. # OverrideGPUValidation=1
  27. # EnableLinuxHWVideoDecode=0    Bad  Colours    Works            Works
  28. #
  29. # OverrideGPUValidation=0
  30. # EnableLinuxHWVideoDecode=1    Works           Crashes plugin  Crashes plugin
  31. #
  32. # OverrideGPUValidation=0
  33. # EnableLinuxHWVideoDecode=0    Bad Colours     Works            Works
  34. #
  35. #
  36. # Chrome 23.0.1271.64
  37. # Settings                      YouTube         Vimeo           GameTrailers
  38. # OverrideGPUValidation=1
  39. # EnableLinuxHWVideoDecode=1    Crashes plugin  Crashes plugin  Crashes plugin
  40. #
  41. # OverrideGPUValidation=1
  42. # EnableLinuxHWVideoDecode=0    Bad Colours     Works           Works
  43. #
  44. # OverrideGPUValidation=0
  45. # EnableLinuxHWVideoDecode=1    Crashes tab     Crashes tab     Crashes tab
  46. #
  47. # OverrideGPUValidation=0
  48. # EnableLinuxHWVideoDecode=0    Bad colours     Works           Works
  49. #
  50. # ------------------------------------------------------------------------------
  51.  
  52. MMSCFGPATH="/etc/adobe"
  53. MMSCFGNAME="mms.cfg"
  54. MMSTEMP="mms.cfg.tmp"
  55.  
  56. fat='\033[1m'
  57. nf='\033[0m'
  58.  
  59. if [ "$(id -u)" != "0" ]; then
  60.   echo -e "\t${fat}You need the proper rights to edit $MMSCFGPATH/$MMSCFGNAME ! ${nf}"
  61.   return 1
  62. fi
  63.  
  64. if [ -e $MMSCFGPATH/$MMSCFGNAME ]; then
  65.   echo -e "\t${fat}$MMSCFGPATH/$MMSCFGNAME found. ${nf}"
  66. else
  67.   echo -e "\t${fat}$MMSCFGPATH/$MMSCFGNAME NOT found.${nf}"
  68.   return 1
  69. fi
  70.  
  71. case $1 in
  72.   0|1)
  73.  
  74.   sed s#".OverrideGPUValidation.*"#"OverrideGPUValidation=$1"# $MMSCFGPATH/$MMSCFGNAME > $MMSCFGPATH/$MMSTEMP
  75.  
  76.   ;;
  77.   *) echo "$1: 0 or 1 only." ;;
  78. esac
  79.  
  80. case $1 in
  81.   0|1)
  82.  
  83.   sed s#".EnableLinuxHWVideoDecode.*"#"EnableLinuxHWVideoDecode=$2"# $MMSCFGPATH/$MMSTEMP > $MMSCFGPATH/$MMSCFGNAME
  84.  
  85.   ;;
  86.   *) echo "$2: 0 or 1 only." ;;
  87. esac
Advertisement
Add Comment
Please, Sign In to add comment