Browse Source

Added Twitch client support

tags/0.2
Bret R. Human 4 weeks ago
parent
commit
5b28f61aee
2 changed files with 27 additions and 4 deletions
  1. 20
    2
      bn3t-run.sh
  2. 7
    2
      bn3t.sh

+ 20
- 2
bn3t-run.sh View File

@@ -10,7 +10,7 @@
10 10
 ##    info@cynicaloptimist.me
11 11
 #####################################################################
12 12
 #                               bn3t-run
13
-script_ver="0.1"
13
+script_ver="0.2"
14 14
 page="https://mage.cynicaloptimist.me/en/bn3t"
15 15
 # author: Bret Human
16 16
 # date: Dec 6, 2018
@@ -38,6 +38,7 @@ page="https://mage.cynicaloptimist.me/en/bn3t"
38 38
 runas_user="`whoami`"
39 39
 app_name="Battle.net"
40 40
 dl_addr="https://www.battle.net/download/getInstallerForGame?os=win&locale=enUS&version=LIVE&gameProgram=BATTLENET_APP"
41
+tc_addr="https://desktop.twitchsvc.net/installer/windows/TwitchSetup.exe"
41 42
 install_dir="/drive_c/Program Files (x86)"
42 43
 app_loc="/Battle.net/Battle.net.exe"
43 44
 console="bash"
@@ -51,6 +52,7 @@ Usage: ./`basename ${0}` -g (game) -p (prefix) -a (arch) -dvsbwtnchx
51 52
      -s   | Runs ${app_name} setup
52 53
      -b   | Runs wineboot
53 54
      -w   | Runs winetricks
55
+     -m   | Runs Twitch client
54 56
      -t   | Attempts to launch to the system tray
55 57
      -n   | No BS mode - doesn't launch an app (for boot/tricks/console safety)
56 58
      -c   | Launch a console session as specified user (can launch Xapps)
@@ -223,7 +225,7 @@ function run_wine () {
223 225
 
224 226
 
225 227
 ## Pick up any arguments provided
226
-while getopts ":g:G:p:P:a:A:dDvVsSbBwWtTnNcChHxX" option; do
228
+while getopts ":g:G:p:P:a:A:dDvVsSbBwWtTnNcChHxXmM" option; do
227 229
     case "${option}" in
228 230
         "g"|"G") game_launch="${OPTARG}";;
229 231
         "d"|"D")
@@ -242,6 +244,22 @@ while getopts ":g:G:p:P:a:A:dDvVsSbBwWtTnNcChHxX" option; do
242 244
                 *) inform "Weird architecture: ${OPTARG}, ignoring";;
243 245
             esac
244 246
             ;;
247
+        "m"|"M")
248
+            echo "Running Twitch Client..."
249
+            nobs_mode="y"
250
+
251
+            if [ -d ${WINEPREFIX}/drive_c/users/${runas_user}/Application\ Data/Twitch ]; then
252
+                wine C:\\users\\${runas_user}\\Application\ Data\\Twitch\\Bin\\Twitch.exe
253
+            else
254
+                inform "...but it helps to install it first..."
255
+                if [ ! -f "/tmp/TwitchSetup.exe" ]; then
256
+                    inform "/tmp/TwitchSetup.exe was not found. Retreiving."
257
+                    wget -O "/tmp/TwitchSetup.exe" "${tc_addr}" ||
258
+                    (echo "Failed to download installer from ${tc_addr}"; warp 1)
259
+                fi
260
+                wine "/tmp/TwitchSetup.exe"
261
+            fi
262
+            ;;
245 263
         "w"|"W")
246 264
             echo "Running winetricks..."
247 265
             nobs_mode="y"

+ 7
- 2
bn3t.sh View File

@@ -10,7 +10,7 @@
10 10
 ##    info@cynicaloptimist.me
11 11
 #####################################################################
12 12
 #                                bn3t
13
-script_ver="0.1"
13
+script_ver="0.2"
14 14
 page="https://mage.cynicaloptimist.me/en/bn3t"
15 15
 # author: Bret Human
16 16
 # date: Dec 6, 2018
@@ -59,6 +59,7 @@ Usage: ./`basename ${0}` -g (game) -u (user) -p (prefix) -a (arch) -dvksbwtnchxi
59 59
      -s   | Runs ${app_name} setup
60 60
      -b   | Runs wineboot
61 61
      -w   | Runs winetricks
62
+     -m   | Runs Twitch Client (for /M/ods - I'm running out of letters)
62 63
      -t   | Attempts to launch to the system tray
63 64
      -n   | No BS mode - doesn't launch an app (for boot/tricks/console safety)
64 65
      -c   | Launch a console session as specified user (can launch Xapps)
@@ -182,7 +183,7 @@ function check {
182 183
 ## Pick up any arguments provided
183 184
 # None are required, we'll use default values.
184 185
 launch_opt=""
185
-while getopts ":g:G:u:U:p:P:a:A:dDvVkKsSbBwWtTnNcChHxXiI" option; do
186
+while getopts ":g:G:u:U:p:P:a:A:dDvVkKsSbBwWtTnNcChHxXiImM" option; do
186 187
     case "${option}" in
187 188
         "k"|"K") die 0;;
188 189
         "g"|"G") launch_opt="${launch_opt} -g ${OPTARG}";;
@@ -222,6 +223,10 @@ while getopts ":g:G:u:U:p:P:a:A:dDvVkKsSbBwWtTnNcChHxXiI" option; do
222 223
             inform "Wineboot mode"
223 224
             launch_opt="${launch_opt} -b"
224 225
             ;;
226
+        "m"|"M")
227
+            inform "Twitch mode"
228
+            launch_opt="${launch_opt} -m"
229
+            ;;
225 230
         "n"|"N")
226 231
             inform "No BS mode"
227 232
             nobs_mode="y"

Loading…
Cancel
Save