Advertisement
Guest User

KSP_launcher.sh

a guest
Jun 18th, 2017
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 18.76 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ## version 2.3
  4.  
  5. ## run this script with any parameter in terminal for help, like this:
  6. ## KSP_launcher.sh --help
  7.  
  8. ## otherwise place it into the same directory where KSP binary exists, run.
  9.  
  10. ## if you use GOG standalone installer, in start.sh replace strings "KSP.x86_64" and "KSP.x86",  with "KSP_launcher.sh"
  11. ## you can also make the KSP desktop file invoke this script.
  12.  
  13.  
  14. ########################### values: >default< / possible
  15.  
  16. ## debug setting.
  17. ## setting this variable to anything other than "off", will cause script to dump the launch string, instead of running ksp.
  18. KSP_debuglauncher="off"
  19.  
  20. KSP_gallium_bench="off"     ## on / >off<
  21. KSP_ksp_cleanprefs="on"     ## >on< / off
  22. KSP_ksp_forceversion="off"  ## >off< / 32 / 64
  23. KSP_ksp_logrotate="on"      ## >on< / off , also see KSP_unity_logdisable
  24. KSP_ksp_protect="on"        ## >on< / off
  25. KSP_mesa_disableDRI3="off"  ## on / >off<
  26. KSP_mesa_noerror="off"      ## on / >off<
  27. KSP_mesa_software="off"     ## on / >off<
  28. KSP_mesa_vsync="on"         ## >on< / off , on - enables vsync
  29. KSP_nv_opts="on"            ## >on< / off
  30. KSP_nv_preload="off"        ## on / >off<
  31. KSP_nv_vsync="on"           ## >on< / off , on - enables vsync
  32. KSP_radeon_R600_DEBUG="off" ## >off< / clear / option(,option,..)
  33. KSP_unity_forceX="off"      ## >off< / horizontal resolution, like 1920
  34. KSP_unity_forceY="off"      ## >off< / vertical resolution, like 1080
  35. KSP_unity_forceLC="on"      ## >on< / off
  36. KSP_unity_fullscreen="off"  ## on / >off<
  37. KSP_unity_gl_old="off"      ## on / >off<
  38. KSP_unity_glclamp="off"     ## on / >off<
  39. KSP_unity_glcore="off"      ## on / >off< / 32 / 33 / 40 / 41 / 42 / 43 / 44 / 45
  40. KSP_unity_gles="off"        ## on / >off< / 20 / 30 / 31 / 31aep
  41. KSP_unity_glthread="off"    ## on / >off<
  42. KSP_unity_logdisable="off"  ## on / >off< , also see KSP_ksp_logrotate
  43.  
  44.  
  45. display_help() {
  46.  
  47. echo 'written by Kerbal101. GPL3+ '
  48. echo ''
  49.  
  50. echo '==============================================='
  51. echo 'KSP_gallium_bench '
  52. echo 'on / >off< '
  53. echo ''
  54. echo 'gallium-drivers only: radeon/amdgpu, nouveau, intel-gallium (not intel classic). '
  55. echo 'enable string to debug performance. outputs cpu, gpu, fps, gpu memory graphs. '
  56. echo ''
  57.  
  58. echo '==============================================='
  59. echo 'KSP_ksp_cleanprefs '
  60. echo '>on< / off '
  61. echo ''
  62. echo 'cleans "prefs" file, which is unity configuration cache. '
  63. echo 'this file is automatically re-generated if absent, as unity runs its detection routine. '
  64. echo 'however, if it exists, unity will use it - instead of running detection, which will cause issues, '
  65. echo 'if video resolution is changed in the settings. its absolutely safe to enable. '
  66. echo ''
  67.  
  68. echo '==============================================='
  69. echo 'KSP_ksp_forceversion '
  70. echo '>off< (autodetect) / 32 / 64 '
  71. echo ''
  72. echo 'you can force the 32 or 64 bit version here. "off" will use autodetection instead. '
  73. echo ''
  74.  
  75. echo '==============================================='
  76. echo 'KSP_ksp_logrotate '
  77. echo '>on< / off '
  78. echo ''
  79. echo 'a log file is generated every time KSP starts and is a huge text file. '
  80. echo 'it is required for support, however it will be overwritten every time KSP is started. '
  81. echo 'with this option enabled, the script will backup and compress the old log with tar - keeping at least three compressed copies. '
  82. echo 'also see "KSP_unity_logdisable" to disable the log altogether, if needed. '
  83. echo ''
  84.  
  85. echo '==============================================='
  86. echo 'KSP_ksp_protect '
  87. echo '>on< / off '
  88. echo ''
  89. echo 'enable crash protection, if KSP requests too much memory too fast. '
  90. echo 'this causes Linux to kill KSP instead of whole Xorg session, by rising KSP "naughtiness level". '
  91. echo 'you should really leave at "on". '
  92. echo ''
  93.  
  94. echo '==============================================='
  95. echo 'KSP_mesa_disableDRI3 '
  96. echo 'on / >off< '
  97. echo ''
  98. echo 'mesa only: disables DRI3, which will cause driver to fallback to DRI2. '
  99. echo 'this will impact (worsen) performance and is used for debugging. '
  100. echo 'known to solve issue with game freezing at random points on intel driver. '
  101. echo 'https://bugs.freedesktop.org/show_bug.cgi?id=97890 '
  102. echo ''
  103.  
  104. echo '==============================================='
  105. echo 'KSP_mesa_noerror'
  106. echo 'on / >off< '
  107. echo ''
  108. echo 'mesa only: disables error checking in mesa driver. '
  109. echo 'this may reduce CPU overhead, at the price of disabled error checks, which would crash the misbehaving game. '
  110. echo ''
  111.  
  112. echo '==============================================='
  113. echo 'KSP_mesa_software '
  114. echo 'on / >off< '
  115. echo ''
  116. echo 'mesa only: disables hardware accelerated rendering completely and switches to LLVM-assisted software renderer. '
  117. echo 'usefull for debugging properties only, severely impacts performance. '
  118. echo ''
  119.  
  120. echo '==============================================='
  121. echo 'KSP_mesa_vsync '
  122. echo '>on< / off '
  123. echo ''
  124. echo 'mesa only: disables vsync (off setting), which improves performance at cost of tearing and will cause GPU to run constantly hot. '
  125. echo 'you may want to disable SwapBuffersWait for DDX driver (in xorg.conf.d) too '
  126. echo 'see https://www.x.org/wiki/RadeonFeature/ '
  127. echo ''
  128.  
  129. echo '==============================================='
  130. echo 'KSP_nv_opts '
  131. echo '>on< / off '
  132. echo ''
  133. echo 'nvidia proprietary only: force driver threaded optimizations by exporting a variable. '
  134. echo ''
  135.  
  136. echo '==============================================='
  137. echo 'KSP_nv_preload '
  138. echo 'on / >off< '
  139. echo ''
  140. echo 'nvidia proprietary only: preloads the blob, which can solve some problems. '
  141. echo 'will interfere with benchmarking software like GLXOSD. '
  142. echo ''
  143.  
  144. echo '==============================================='
  145. echo 'KSP_nv_vsync '
  146. echo '>on< / off '
  147. echo ''
  148. echo 'nvidia proprietary only: disables vsync (off) on nvidia proprietary driver. '
  149. echo ''
  150.  
  151. echo '==============================================='
  152. echo 'KSP_radeon_R600_DEBUG '
  153. echo '>off< / clear / option(,option,..) '
  154. echo ''
  155. echo 'radeon/amdgpu driver only: "R600_DEBUG" is a variable for changing driver options of Radeon/RadeonSI/AMDGPU. '
  156. echo 'some options may be already enabled in the driver internally, these are marked with "enabled by default" below. '
  157. echo '"off" and "clear" are handled by the script and can′t be combined with others. '
  158. echo ''
  159. echo 'to get full list of options supported by your current driver, install glx-utils package and run this in terminal: '
  160. echo '$ R600_DEBUG=help glxgears '
  161. echo ''
  162. echo 'options can be combined using comma where it makes sense: '
  163. echo '"KSP_mesa_R600_DEBUG=sbcl,hyperz,llvm,sisched,forcedma" '
  164. echo ''
  165. echo 'off - (script) do not touch R600_DEBUG variable. '
  166. echo 'clear - (script) clear the R600_DEBUG variable, causing driver to run with default options. '
  167. echo ''
  168. echo 'Known options:'
  169. echo 'sb - enable shader optimizer. (enabled by default) '
  170. echo 'sbcl - enable shader optimizer with opencl improvements. '
  171. echo 'sbsafemaths - enable optimized shader backend but disable fast unsafe math ops. '
  172. echo 'nosb  - disable shader backend. '
  173. echo 'hyperz - enable hyperz. (enabled by default) '
  174. echo 'nohyperz - disable hyperz. '
  175. echo 'forcedma - force enable dma. '
  176. echo 'nodma - disable dma. '
  177. echo 'nocpdma - disable CP dma. '
  178. echo 'nowc - disable write combining. '
  179. echo 'llvm - enable llvm backend for shader compilation. (enabled by default) '
  180. echo 'nollvm - disable llvm backend for shader compilation. '
  181. echo 'sisched - enable improved radensi scheduler in llvm. '
  182. echo ''
  183.  
  184. echo '==============================================='
  185. echo 'KSP_unity_forceX '
  186. echo '>off< / horizontal resolution, like 1920 '
  187. echo 'KSP_unity_forceY '
  188. echo '>off< / vertical resolution, like 1080 '
  189. echo ''
  190. echo 'unity option: force horizontal and vertical resolution. '
  191. echo 'useful to if KSP starts with window of weird sizes. '
  192. echo ''
  193.  
  194. echo '==============================================='
  195. echo 'KSP_unity_forceLC '
  196. echo '>on< / off '
  197. echo ''
  198. echo 'exports LC_ALL=C var, which solves the problem of non-us_US encoding with numeric comma. '
  199. echo 'symptons include absent savegames and KSP forgetting settings. '
  200. echo ''
  201.  
  202. echo '==============================================='
  203. echo 'KSP_unity_fullscreen '
  204. echo 'on / >off<'
  205. echo ''
  206. echo 'unity option: force fullscreen in KSP. '
  207. echo ''
  208.  
  209. echo '==============================================='
  210. echo 'KSP_unity_gl_old '
  211. echo 'on / >off< '
  212. echo ''
  213. echo 'unity option: force old unity OpenGL backend. blocks gles settings. '
  214. echo ''
  215.  
  216. echo '==============================================='
  217. echo 'KSP_unity_glclamp '
  218. echo 'on / >off< '
  219. echo ''
  220. echo 'unity option: disable opengl extensions. primary used for debugging.'
  221. echo ''
  222.  
  223. echo '==============================================='
  224. echo 'KSP_unity_glcore '
  225. echo 'on / >off< / 32 / 33 / 40 / 41 / 42 / 43 / 44 / 45 '
  226. echo ''
  227. echo 'unity option: force unity to use GL "core profile", instead of the "compat. profile" - which has legacy/outdated GL codepaths. '
  228. echo 'recommended on mesa and drivers that dont implement legacy functions fully. '
  229. echo 'enable if you experience weird planet colors or black screen during launch. '
  230. echo 'see: https://docs.unity3d.com/Manual/OpenGLCoreDetails.html '
  231. echo 'blocks gles settings. '
  232. echo 'off = use compat. profile, on = force and detect core profile, number = on +limit core profile to specified level'
  233. echo ''
  234.  
  235. echo '==============================================='
  236. echo 'KSP_unity_gles '
  237. echo 'on / >off< / 20 / 30 / 31 / 31aep '
  238. echo ''
  239. echo 'unity option: force opengles. will not work, if glcore or oldgl options are enabled. '
  240. echo 'see: https://docs.unity3d.com/Manual/OpenGLCoreDetails.html '
  241. echo 'off = use opengl, on = use gles, number = on+limit gles profile to level'
  242. echo ''
  243.  
  244. echo '==============================================='
  245. echo 'KSP_unity_glthread '
  246. echo 'on / >off< '
  247. echo ''
  248. echo 'unity option: force OpenGL backend to use single rendering thread. may reduce render performance. '
  249. echo 'this is known to solve issues with old amd proprietary driver (fglrx/catalyst) freezing, but is applicable to all drivers. '
  250. echo ''
  251.  
  252. echo '==============================================='
  253. echo 'KSP_unity_logdisable '
  254. echo 'on / >off< '
  255. echo ''
  256. echo 'unity option: will disable generating the log file. log file is generated every time KSP starts and is a text file. '
  257. echo 'it is required for support, however it can quickly grow gigabytes in size and may introduce slowdowns. '
  258. echo 'setting this option to on will cause unity to stop writing the log file. '
  259. echo 'also see "KSP_ksp_logrotate". '
  260. echo ''
  261.  
  262. echo -e 'If you want ability to scroll through this help in terminal, pipe it through "| less" : '
  263. echo -e "${0} --help | less \n"
  264. echo -e 'Use arrows to scroll and "q" to quit. '
  265.  
  266. exit 0
  267.  
  268. }
  269.  
  270.  
  271. ## this is an internal variable that is filled as needed. Do not change.
  272. KSP_params=""
  273.  
  274. ## this is an internal variable that is filled with exported values, shown at debug. Do not change.
  275. KSP_env_debug=""
  276.  
  277. ## just for deduplication
  278. KSP_playerlog="${HOME}/.config/unity3d/Squad/Kerbal Space Program/Player.log"
  279.  
  280.  
  281. ## display help if we have any parameters, else run.
  282. if [[ -n "$1" ]]; then display_help; fi
  283.  
  284. echo "${0}: starting script."
  285.  
  286. if [[ "$KSP_ksp_forceversion" = "32" ]]; then
  287.     KSP_bin="./KSP.x86"
  288. elif [[ "$KSP_ksp_forceversion" = "64" ]]; then
  289.     KSP_bin="./KSP.x86_64"
  290. else
  291.     if [[ "$(uname -m)" = "x86_64" ]]; then
  292.         KSP_bin="./KSP.x86_64"
  293.     else
  294.         KSP_bin="./KSP.x86"
  295.     fi
  296. fi
  297.  
  298.  
  299. if [[ "$KSP_mesa_vsync" = "off" ]]; then
  300.     export vblank_mode=0
  301.     KSP_env_debug+="export vblank_mode=0\n"
  302. fi
  303.  
  304. if [[ "$KSP_nv_vsync" = "off" ]]; then
  305.     nvidia-settings --load-config-only --assign="SyncToVBlank=0"
  306.     KSP_nvcorrect="yes"
  307.     KSP_env_debug+="execute: nvidia-settings --load-config-only --assign=\"SyncToVBlank=0\"\n"
  308. fi
  309.  
  310. ## options can be extracted with "GALLIUM_HUD=help glxgears"
  311. ## each option consumes cycles, so stat sparingly!
  312. if [[ ! "$KSP_gallium_bench" = "off" ]]; then
  313.     export GALLIUM_HUD="VRAM-usage+temperature+fps+cpu+GPU-load,cpu0+cpu1+cpu2+cpu3+cpu4+cpu5+cpu6+cpu7"
  314.     KSP_env_debug+="export GALLIUM_HUD=\"VRAM-usage+temperature+fps+cpu+GPU-load,cpu0+cpu1+cpu2+cpu3+cpu4+cpu5+cpu6+cpu7\"\n"
  315. fi
  316.  
  317. if [[ ! "$KSP_mesa_noerror" = "off" ]]; then
  318.     export MESA_NO_ERROR=1
  319.     KSP_env_debug+="export MESA_NO_ERROR=1\n"
  320. fi
  321.  
  322. if [[ "$KSP_ksp_cleanprefs" = "on" ]]; then
  323.     rm -f "${HOME}/.config/unity3d/Squad/Kerbal Space Program/prefs"
  324.     KSP_env_debug+="execute: rm -f \"${HOME}/.config/unity3d/Squad/Kerbal Space Program/prefs\"\n"
  325. fi
  326.  
  327.  
  328. if [[ "$KSP_unity_forceLC" = "on" ]]; then
  329.     export LC_ALL=C
  330.     KSP_env_debug+="export LC_ALL=C\n"
  331. fi
  332.  
  333.  
  334. if [[ ! "$KSP_mesa_disableDRI3" = "off" ]]; then
  335.     export LIBGL_DRI3_DISABLE=1
  336.     KSP_env_debug+="export LIBGL_DRI3_DISABLE=1\n"
  337. fi
  338.  
  339.  
  340. if [[ ! "$KSP_mesa_software" = "off" ]]; then
  341.     export LIBGL_ALWAYS_SOFTWARE=1
  342.     KSP_env_debug+="export LIBGL_ALWAYS_SOFTWARE=1\n"
  343. fi
  344.  
  345.  
  346. if [[ ! "$KSP_unity_fullscreen" = "off" ]]; then
  347.     KSP_params+=" -screen-fullscreen 1"
  348. fi
  349.  
  350. if [[ ! "$KSP_radeon_R600_DEBUG" = "off" ]]; then
  351.     if [[ "$KSP_radeon_R600_DEBUG" = "clear" ]]; then
  352.         unset R600_DEBUG
  353.         KSP_env_debug+="unset R600_DEBUG\n"
  354.     else
  355.         unset R600_DEBUG
  356.         export R600_DEBUG="${KSP_radeon_R600_DEBUG}"
  357.         KSP_env_debug+="unset R600_DEBUG\n"
  358.         KSP_env_debug+="export R600_DEBUG=\"${KSP_radeon_R600_DEBUG}\"\n"
  359.     fi
  360. fi
  361.  
  362. if [[ ! "$KSP_unity_forceX" = "off" ]]; then
  363.     KSP_params+="-screen-width ${KSP_unity_forceX} "
  364. fi
  365.  
  366.  
  367. if [[ ! "$KSP_unity_forceY" = "off" ]]; then
  368.     KSP_params+="-screen-height ${KSP_unity_forceY} "
  369. fi
  370.  
  371.  
  372. if [[ ! "$KSP_unity_gl_old" = "off" ]]; then
  373.     KSP_params+="-force-opengl "
  374. fi
  375.  
  376.  
  377. if [[ ! "$KSP_unity_glthread" = "off" ]]; then
  378.     KSP_params+="-force-gfx-direct "
  379. fi
  380.  
  381.  
  382. if [[ ! "$KSP_unity_glcore" = "off" ]]; then
  383.     if [[ "$KSP_unity_glcore" = "on" ]]; then
  384.         KSP_params+="-force-glcore "
  385.     else
  386.         KSP_params+="-force-glcore${KSP_unity_glcore} "
  387.     fi
  388. fi
  389.  
  390.  
  391. if [[ ! "$KSP_unity_glclamp" = "off" ]]; then
  392.     KSP_params+="-force-clamped "
  393. fi
  394.  
  395.  
  396. if [[ ! "$KSP_unity_gles" = "off" ]] && [[ "$KSP_unity_glcore" = "off" ]] && [[ "$KSP_unity_gl_old" == "off" ]]; then
  397.  
  398.     if [[ "$KSP_unity_gles" = "on" ]]; then
  399.         KSP_params+="-force-gles "
  400.     else
  401.         KSP_params+="-force-gles${KSP_unity_gles} "
  402.     fi
  403. fi
  404.  
  405. if [[ ! "$KSP_nv_preload" = "off" ]]; then
  406.     export LD_PRELOAD="libpthread.so.0 libGL.so.1"
  407.     KSP_env_debug+="export LD_PRELOAD=\"libpthread.so.0 libGL.so.1\"\n"
  408. fi
  409.  
  410.  
  411. if [[ ! "$KSP_nv_opts" = "off" ]]; then
  412.     export __GL_THREADED_OPTIMIZATIONS=1
  413.     KSP_env_debug+="export __GL_THREADED_OPTIMIZATIONS=1\n"
  414. fi
  415.  
  416.  
  417. ### placement of the three blocks below is critical.
  418. ### first block checks if log is a link to /dev/null, and removes it if it is. Its repeated in the post-execute section.
  419. ### seconds checks for log files and backs them up. the previous action would remove an empty log.
  420. ### third block creates a block to /dev/null if specified, otherwise is ignored.
  421.  
  422.  
  423. ## unlinks the log file if its a symlink to void. it may be set to void by $KSP_unity_logdisable.
  424. if [[ $(readlink -- "$KSP_playerlog") = "/dev/null" ]]; then
  425.     rm -f "$KSP_playerlog"
  426. fi
  427.  
  428.  
  429. if [[ ! "$KSP_ksp_logrotate" = "off" ]]; then
  430. ## "log option selected" level
  431.  
  432.     if $(type tar >/dev/null 2>&1); then
  433.     ## "tar present" level
  434.  
  435.         if [[ ! "$KSP_debuglauncher" = "off" ]]; then
  436.         ## "debug is running" level
  437.             KSP_env_debug+="Would compress and rotate logs.\n"
  438.            
  439.         else
  440.         ## "debug is not running" level
  441.  
  442.             if [[ -f "$KSP_playerlog" ]]; then
  443.             ## "log file exists" level
  444.  
  445.                 ## rotate the 2->3 (3 gets wiped in the process), 1->2 and generate 1 by compressing or copying.
  446.                 mv -f "${KSP_playerlog}-3.tar.gz" "${KSP_playerlog}-4.tar.gz" >/dev/null 2>&1
  447.        
  448.                 mv -f "${KSP_playerlog}-2.tar.gz" "${KSP_playerlog}-3.tar.gz" >/dev/null 2>&1
  449.        
  450.                 mv -f "${KSP_playerlog}-1.tar.gz" "${KSP_playerlog}-2.tar.gz" >/dev/null 2>&1
  451.        
  452.                 tar -czf "${KSP_playerlog}-1.tar.gz" "$KSP_playerlog"
  453.            
  454.                 rm -f "$KSP_playerlog"
  455.             else
  456.             ## "log file does not exist" level
  457.            
  458.                 echo -e "${0}: Previous debug log not found, nothing to rotate.\n"
  459.             fi
  460.         fi
  461.     else
  462.     ## "tar not found" level
  463.    
  464.         echo -e "${0}: WARNING! Tar was not found on the system! KSP_ksp_logrotate disabled!\n"
  465.     fi
  466.     ## phew!
  467. fi
  468.  
  469.  
  470. ### errata: test have shown, that KSP 1.3 completely ignores this option as well as "-logFile"
  471. ### because of this, we are working around of this issue by using another method, which is symlinking the log to void.
  472. ### must remove the link at the end though, or "bad things may happen"(c)
  473.  
  474. if [[ ! "$KSP_unity_logdisable" = "off" ]]; then
  475.  
  476.     if [[ ! "$KSP_debuglauncher" = "off" ]]; then
  477.         KSP_env_debug+="Would disable the log, by linking it to /dev/null.\n"
  478.     else
  479. ##    KSP_params+="-nolog "
  480. ##    KSP_params+="-logFile /dev/null"
  481.     ln -s /dev/null "$KSP_playerlog"
  482.     fi    
  483. fi
  484.  
  485.  
  486.  
  487. if [[ ! "$KSP_ksp_protect" = "off" ]]; then
  488.     if [[ ! "$KSP_debuglauncher" = "off" ]]; then
  489.         KSP_env_debug+="Would increase KSP binary naughtiness value.\n"
  490.     else
  491.         if [[ "$KSP_bin" = "./KSP.x86" ]]; then
  492.             sh -c 'sleep 3 ; echo 15 > "/proc/$(pgrep KSP.x86)/oom_adj"' &
  493.             sh -c 'sleep 2 ; echo 15 > "/proc/$(pgrep KSP.x86)/oom_adj"' &
  494.             sh -c 'sleep 1 ; echo 15 > "/proc/$(pgrep KSP.x86)/oom_adj"' &
  495.         else
  496.             sh -c 'sleep 3 ; echo 15 > "/proc/$(pgrep KSP.x86_64)/oom_adj"' &
  497.             sh -c 'sleep 2 ; echo 15 > "/proc/$(pgrep KSP.x86_64)/oom_adj"' &
  498.             sh -c 'sleep 1 ; echo 15 > "/proc/$(pgrep KSP.x86_64)/oom_adj"' &
  499.         fi
  500.     fi
  501. fi
  502.  
  503.  
  504. ####### executing KSP if debug is off, otherwise just spill the parameters into shell
  505.  
  506. if [[ ! "$KSP_debuglauncher" = "off" ]]; then
  507.     echo -e "${KSP_env_debug}"
  508.     echo -e "Would finally execute: ${KSP_bin} ${KSP_params}"
  509.     exit 0
  510. else
  511.     ## this construction is necessary, because KSP often segfaults instead of exiting, causing it to abort the script too.
  512.     exec "$KSP_bin" "$KSP_params" &
  513.     wait
  514.     echo "${0}: KSP finished, performing post-exec actions."
  515. fi
  516.  
  517. #######
  518.  
  519. ####### post-execution block
  520.  
  521. ## will restore vsync for nvidia after game exit, if the script enabled it.
  522. if [[ $KSP_nvcorrect = "yes" ]]; then
  523.     nvidia-settings --load-config-only --assign="SyncToVBlank=1"
  524. fi
  525.  
  526.  
  527. ## unlinks the log file if its a symlink to void.
  528. if [[ $(readlink -- "$KSP_playerlog") = "/dev/null" ]]; then
  529.     rm -f "$KSP_playerlog"
  530. fi
  531.  
  532. echo "${0}: finished."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement