Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off &color 0f &mode 80,1 &title Steam minigameslist silent startup replacement shortcut
- :: [2019.11.12]: goes straight to systray icon, and will switch new Library to mini mode
- :: [2021.04.27]: added -cef-single-process to limit steamwebhelper processes to 2 (host + content)
- :: [2022.02.06]: removed -cef-single-process as it started breaking Library (Large) at some point
- rem get STEAMPATH
- for /f "skip=2 tokens=2*" %%R in ('reg query HKCU\SOFTWARE\Valve\Steam /v SteamPath') do set "STEAMPATH=%%S"
- if defined STEAMPATH for %%S in ("%STEAMPATH%") do set "STEAMPATH=%%~fS"
- rem kill steam
- taskkill /im Steam.exe /t /f >nul 2>nul & timeout /t 1 >nul & del /f /q "%STEAMPATH%\.crash" >nul 2>nul
- rem restore View - Small Mode main menu entry - not needed anymore (restored by valve)
- ::set ".=%STEAMPATH%\resource\menus\steam.menu"
- ::findstr hydra "%.%" >nul 2>nul && (goto inserted1) || (goto insert1)
- :::ins1
- ::(if "%1"=="BigPictureMode" >>"%.%" echo hydra { text="#steam_menu_minimode" shellcmd="steam://open/minigameslist" }) &exit/b
- :::insert1
- ::ren "%.%" steam.menu_ & for /f "delims=" %%S in ('type "%.%_"') do call :ins1 %%S & >>"%.%" echo %%S
- ::del /f /q "%.%_" >nul 2>nul
- :::inserted1
- rem top shelf
- set .="%STEAMPATH%\steamui\css\libraryroot.css"
- ::findstr hydra %.% >nul 2>nul && (set AD=) || (set AD=1)
- ::for /f "delims=" %%S in ('findstr .libraryhome_WhatsNewContainer_ %.% 2^>nul') do set "hydra=%%S"
- ::if defined AD >>%.% echo(
- ::if defined AD >>%.% echo(%hydra%
- ::if defined AD >>%.% echo( display : none; /*hydra*/}
- rem switch new Library to minigameslist on startup
- set .="%STEAMPATH%\steamui\index.html"
- findstr hydra %.% >nul 2>nul && (set AD=) || (set AD=1)
- setlocal disableDelayedExpansion
- if defined AD >%.% echo(^<^!doctype html^>
- setlocal enableDelayedExpansion
- if defined AD >>%.% echo(!"! <html style='width: 100%%; height: 100%%'><head><title>Steam</title>
- if defined AD >>%.% echo(!"! <meta charset='utf-8'><link href='/css/library.css' rel='stylesheet'><script>
- if defined AD >>%.% echo(!"! localStorage.setItem('hydra',0);
- if defined AD >>%.% echo(!"! function miniOnStartup(){ if(document.visibilityState == 'visible'){
- if defined AD >>%.% echo(!"! window.location.href='steam://open/minigameslist';
- if defined AD >>%.% echo(!"! document.removeEventListener('visibilitychange',miniOnStartup,true);
- if defined AD >>%.% echo(!"! }}
- ::if defined AD >>%.% echo(!"! document.addEventListener('visibilitychange',miniOnStartup,true);
- rem uncomment the 7 lines below to also switch whenever window minimizes / focus changes
- ::if defined AD >>%.% echo(!"! function miniOnFocus(){ if(document.visibilityState == 'visible'){
- ::if defined AD >>%.% echo(!"! localStorage.setItem('hydra',Number(localStorage.getItem('hydra'))+2);
- ::if defined AD >>%.% echo(!"! } else localStorage.setItem('hydra',Number(localStorage.getItem('hydra'))-1);
- ::if defined AD >>%.% echo(!"! if(Number(localStorage.getItem('hydra')) == 2){
- ::if defined AD >>%.% echo(!"! localStorage.setItem('hydra',0); window.location.href='steam://open/minigameslist';
- ::if defined AD >>%.% echo(!"! }}
- ::if defined AD >>%.% echo(!"! document.addEventListener('visibilitychange',miniOnFocus,true);
- if defined AD >>%.% echo(!"! </script></head>
- if defined AD >>%.% echo(!"! <body class='ClientUIControls' style='width: 100%%; height: 100%%; margin: 0; overflow: hidden;'>
- if defined AD >>%.% echo(!"! <div id='root' style='height:100%%; width: 100%%'></div><div style='display:none'></div>
- if defined AD >>%.% echo(!"! <script src='/libraries/libraries.js'></script><script src='/libraries/libraries_cm.js'></script>
- if defined AD >>%.% echo(!"! <script src='/library.js'></script></body></html>
- endlocal
- rem restart steam silently with parameters
- set [1]=-console -forceservice -single_core -windowed -manuallyclearframes 0 -skipinitialbootstrap -skipstreamingdrivers -vrskip
- set [2]=-nodircheck -norepairfiles -noverifyfiles -nocrashmonitor -nocrashdialog -nofriendsui -oldlib +"@AllowSkipGameUpdate 1 -
- start "Steam" "%STEAMPATH%\Steam.exe" -silent -websocketignorecertissues %[1]% %[2]%
- ; AveYo: done!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement