Various compilation scripts & patches for Linux programs.
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.

200 lines
8.6 KiB

  1. #!/bin/bash
  2. # This script installs a user selected theme file for all existing
  3. # PlayOnLinux wine prefixes.
  4. # The purpose of this script is to automate theme selection process
  5. # in a case user has many wineprefixes which would otherwise
  6. # require manual tweaking, individually.
  7. #
  8. # USAGE: Change your theme preferences here and then run the script.
  9. #
  10. # NOTE: If you change VistaPerfection theme to another one, please
  11. # make sure you change corresponding registry values below!
  12. #########################################################################
  13. REGFILE=user.reg
  14. MAINFOLDER=$HOME/.PlayOnLinux/wineprefix/
  15. THEMEFILE=VistaPerfection.msstyles
  16. THEMEFOLDER=drive_c/windows/Resources/Themes/VistaPerfection/
  17. #########################################################################
  18. # Add VistaPerfection theme to each existing PlayOnLinux Wine prefix
  19. # folder.
  20. for i in $MAINFOLDER/* ; do
  21. if [[ -d $i ]]; then # Filter directories only and exclude all files
  22. #########################################################################
  23. # Copy theme file into correct folder.
  24. mkdir -p $i/$THEMEFOLDER
  25. cp -rf ./$THEMEFILE $i/$THEMEFOLDER
  26. #########################################################################
  27. # If pattern [Control Panel\\Colors] exists in user.reg (basically, it always does)
  28. if [[ $(cat $i/$REGFILE | grep -c "\[Control Panel\\\\\\\\Colors\]") -eq 1 ]]; then
  29. # If no theme is applied, ThemeManager registry key shouldn't exist. We check this, and if the check returns 0, then
  30. if [[ $(cat $i/$REGFILE | grep -c "\[Software\\\\\\\\Microsoft\\\\\\\\Windows\\\\\\\\CurrentVersion\\\\\\\\ThemeManager\]") -eq 0 ]]; then
  31. # Delete lines between [Control Panel\\Colors] and #time
  32. sed -i '/\[Control Panel\\\\Colors\]/,/#time/ { // { x; s/$/./; x; }; x; /.../! { x; d; }; x; }' $i/$REGFILE
  33. else
  34. # Else, we expect that some theme is already applied and range of lines [Control Panel\\Colors] - "WindowText" exists.
  35. # Delete all between lines [Control Panel\\Colors] to the next "WindowText" line (including these lines themselves, too).
  36. # First match only.
  37. sed -i '/\[Control Panel\\\\Colors\]/,/.*WindowText/ { // { x; s/$/./; x; }; x; /.../! { x; d; }; x; }' $i/$REGFILE
  38. fi
  39. fi
  40. #########################################################################
  41. # If pattern [Software\\Microsoft\\Windows\\CurrentVersion\\ThemeManager]
  42. # exists in user.reg.
  43. if [[ $(cat $i/$REGFILE | grep -c "\[Software\\\\\\\\Microsoft\\\\\\\\Windows\\\\\\\\CurrentVersion\\\\\\\\ThemeManager\]") -eq 1 ]]; then
  44. # Then delete all between lines [Software\\Microsoft\\Windows\\CurrentVersion\\ThemeManager]
  45. # to the next "ThemeActive" line (including these lines themselves, too).
  46. # First match only.
  47. sed -i '/\[Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\ThemeManager\]/,/.*ThemeActive/ { // { x; s/$/./; x; }; x; /.../! { x; d; }; x; }' $i/$REGFILE
  48. fi
  49. #########################################################################
  50. # If pattern [Software\\Microsoft\\Windows\\CurrentVersion\\ThemeManager\\Control Panel\\Colors]
  51. # exists in user reg.
  52. if [[ $(cat $i/$REGFILE | grep -c "\[Software\\\\\\\\Microsoft\\\\\\\\Windows\\\\\\\\CurrentVersion\\\\\\\\ThemeManager\\\\\\\\Control Panel\\\\\\\\Colors]") -eq 1 ]]; then
  53. # Then delete all between lines [Software\\Microsoft\\Windows\\CurrentVersion\\ThemeManager\\Control Panel\\Colors]
  54. # to the next "WindowText" line (including these lines themselves, too).
  55. # First match only.
  56. sed -i '/\[Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\ThemeManager\\\\Control Panel\\\\Colors\]/,/.*WindowText/ { // { x; s/$/./; x; }; x; /.../! { x; d; }; x; }' $i/$REGFILE
  57. fi
  58. #########################################################################
  59. # Insert the following lines before [Control Panel\\Desktop] entry.
  60. # To modify theme colors universally for all PlayOnLinux wineprefixes, modify these values and re-run this bash script.
  61. #
  62. # If you use another theme file than VistaPefection, you must change these values!
  63. sed -i '/\[Control Panel\\\\Desktop\]/i \
  64. [Control Panel\\\\Colors] 1412354567 0 \
  65. #time=1cfdf290fdf9d80 \
  66. "ActiveBorder"="212 208 200" \
  67. "ActiveTitle"="185 209 234" \
  68. "AppWorkSpace"="128 128 128" \
  69. "Background"="0 0 0" \
  70. "ButtonAlternateFace"="181 181 181" \
  71. "ButtonDkShadow"="160 160 160" \
  72. "ButtonFace"="240 240 240" \
  73. "ButtonHilight"="255 255 255" \
  74. "ButtonLight"="227 227 227" \
  75. "ButtonShadow"="213 213 213" \
  76. "ButtonText"="0 0 0" \
  77. "GradientActiveTitle"="185 209 234" \
  78. "GradientInactiveTitle"="215 228 242" \
  79. "GrayText"="128 128 128" \
  80. "Hilight"="51 153 255" \
  81. "HilightText"="255 255 255" \
  82. "HotTrackingColor"="0 102 204" \
  83. "InactiveBorder"="212 208 200" \
  84. "InactiveTitle"="191 205 219" \
  85. "InactiveTitleText"="67 78 84" \
  86. "InfoText"="0 0 0" \
  87. "InfoWindow"="255 255 255" \
  88. "Menu"="240 240 240" \
  89. "MenuBar"="240 240 240" \
  90. "MenuHilight"="51 153 255" \
  91. "MenuText"="0 0 0" \
  92. "Scrollbar"="212 208 200" \
  93. "TitleText"="0 0 0" \
  94. "Window"="255 255 255" \
  95. "WindowFrame"="0 0 0" \
  96. "WindowText"="0 0 0" \
  97. \
  98. [Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\ThemeManager] 1424057405 0 \
  99. #time=1d04998dae45c80 \
  100. "ColorName"="NormalColor" \
  101. "DllName"="C:\\\\windows\\\\Resources\\\\Themes\\\\VistaPerfection\\\\VistaPerfection.msstyles" \
  102. "FlatMenu"=dword:00000000 \
  103. "GradientCaption"=dword:00000001 \
  104. "IconTitleFont"=hex:f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,\\ \
  105. 00,00,00,00,00,00,00,00,22,4d,00,53,00,20,00,53,00,68,00,65,00,6c,00,6c,00,\\ \
  106. 20,00,44,00,6c,00,67,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\\ \
  107. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 \
  108. "NonClientMetrics"=hex:f8,01,00,00,01,00,00,00,10,00,00,00,10,00,00,00,12,00,\\ \
  109. 00,00,12,00,00,00,f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,\\ \
  110. 00,00,00,00,00,00,00,00,22,4d,00,53,00,20,00,53,00,68,00,65,00,6c,00,6c,00,\\ \
  111. 20,00,44,00,6c,00,67,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\\ \
  112. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0f,00,\\ \
  113. 00,00,0f,00,00,00,f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,\\ \
  114. 00,00,00,00,00,00,00,00,22,4d,00,53,00,20,00,53,00,68,00,65,00,6c,00,6c,00,\\ \
  115. 20,00,44,00,6c,00,67,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\\ \
  116. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,12,00,\\ \
  117. 00,00,12,00,00,00,f5,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,\\ \
  118. 00,00,00,00,00,00,00,00,22,4d,00,53,00,20,00,53,00,68,00,65,00,6c,00,6c,00,\\ \
  119. 20,00,44,00,6c,00,67,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\\ \
  120. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,f5,ff,\\ \
  121. ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,\\ \
  122. 22,4d,00,53,00,20,00,53,00,68,00,65,00,6c,00,6c,00,20,00,44,00,6c,00,67,00,\\ \
  123. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\\ \
  124. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,f5,ff,ff,ff,00,00,00,00,00,00,\\ \
  125. 00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,22,4d,00,53,00,20,00,53,\\ \
  126. 00,68,00,65,00,6c,00,6c,00,20,00,44,00,6c,00,67,00,00,00,00,00,00,00,00,00,\\ \
  127. 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\\ \
  128. 00,00,00,00,00,00,00,00,00,00,00 \
  129. "SizeName"="NormalSize" \
  130. "ThemeActive"="1" \
  131. \
  132. [Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\ThemeManager\\\\Control Panel\\\\Colors] 1424057405 0 \
  133. #time=1d04998dae45c80 \
  134. "ActiveBorder"="212 208 200" \
  135. "ActiveTitle"="10 36 106" \
  136. "AppWorkSpace"="128 128 128" \
  137. "Background"="58 110 165" \
  138. "ButtonAlternateFace"="181 181 181" \
  139. "ButtonDkShadow"="64 64 64" \
  140. "ButtonFace"="212 208 200" \
  141. "ButtonHilight"="255 255 255" \
  142. "ButtonLight"="212 208 200" \
  143. "ButtonShadow"="128 128 128" \
  144. "ButtonText"="0 0 0" \
  145. "GradientActiveTitle"="166 202 240" \
  146. "GradientInactiveTitle"="192 192 192" \
  147. "GrayText"="128 128 128" \
  148. "Hilight"="10 36 106" \
  149. "HilightText"="255 255 255" \
  150. "HotTrackingColor"="0 0 200" \
  151. "InactiveBorder"="212 208 200" \
  152. "InactiveTitle"="128 128 128" \
  153. "InactiveTitleText"="212 208 200" \
  154. "InfoText"="0 0 0" \
  155. "InfoWindow"="255 255 225" \
  156. "Menu"="212 208 200" \
  157. "MenuBar"="212 208 200" \
  158. "MenuHilight"="10 36 106" \
  159. "MenuText"="0 0 0" \
  160. "Scrollbar"="212 208 200" \
  161. "TitleText"="255 255 255" \
  162. "Window"="255 255 255" \
  163. "WindowFrame"="0 0 0" \
  164. "WindowText"="0 0 0" \
  165. ' $i/$REGFILE
  166. ####################################################
  167. # Replace double blank lines with one blank line.
  168. sed -i '/^$/N;/^\n$/D' $i/$REGFILE
  169. ####################################################
  170. fi
  171. done