aveyo

steam_silent

Apr 19th, 2018
16,539
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off &color 0f &mode 80,1 &title Steam minigameslist silent startup replacement shortcut
  2. :: [2019.11.12]:  goes straight to systray icon, and will switch new Library to mini mode
  3.  
  4. rem get STEAMPATH
  5. for /f "skip=2 tokens=2*" %%R in ('reg query HKCU\SOFTWARE\Valve\Steam /v SteamPath') do set "STEAMPATH=%%S"
  6. if defined STEAMPATH for %%S in ("%STEAMPATH%") do set "STEAMPATH=%%~fS"
  7.  
  8. rem kill steam
  9. taskkill /im Steam.exe /t /f >nul 2>nul & timeout /t 1 >nul & del /f /q "%STEAMPATH%\.crash" >nul 2>nul
  10.  
  11. rem restore View - Small Mode main menu entry - not needed anymore (restored by valve)
  12. ::set ".=%STEAMPATH%\resource\menus\steam.menu"
  13. ::findstr hydra "%.%" >nul 2>nul && (goto inserted1) || (goto insert1)
  14. :::ins1
  15. ::(if "%1"=="BigPictureMode" >>"%.%" echo     hydra { text="#steam_menu_minimode" shellcmd="steam://open/minigameslist" }) &exit/b
  16. :::insert1
  17. ::ren "%.%" steam.menu_ & for /f "delims=" %%S in ('type "%.%_"') do call :ins1 %%S & >>"%.%" echo %%S
  18. ::del /f /q "%.%_" >nul 2>nul
  19. :::inserted1
  20.  
  21. rem top shelf
  22. set .="%STEAMPATH%\steamui\css\libraryroot.css"
  23. findstr hydra %.% >nul 2>nul && (set AD=) || (set AD=1)
  24. for /f "delims=" %%S in ('findstr .libraryhome_WhatsNewContainer_ %.% 2^>nul') do set "hydra=%%S"
  25. if defined AD >>%.% echo(
  26. if defined AD >>%.% echo(%hydra%
  27. if defined AD >>%.% echo(  display : !! /*hydra*/}
  28.  
  29. rem switch new Library to minigameslist on startup
  30. set .="%STEAMPATH%\steamui\index.html"
  31. findstr hydra %.% >nul 2>nul && (set AD=) || (set AD=1)
  32. setlocal enableDelayedExpansion
  33. if defined AD >>%.% echo(
  34. if defined AD >>%.% echo(!"! <html><head><script>localStorage.setItem('hydra',0);
  35. if defined AD >>%.% echo(!"! function miniOnStartup(){ if(document.visibilityState == 'visible'){
  36. if defined AD >>%.% echo(!"!   window.location.href='steam://open/minigameslist';
  37. if defined AD >>%.% echo(!"!   document.removeEventListener('visibilitychange',miniOnStartup,true);
  38. if defined AD >>%.% echo(!"! }}
  39. if defined AD >>%.% echo(!"! document.addEventListener('visibilitychange',miniOnStartup,true);
  40.  
  41. rem uncomment the 7 lines below to also switch whenever window minimizes / focus changes
  42. ::if defined AD >>%.% echo(!"! function miniOnFocus(){ if(document.visibilityState == 'visible'){
  43. ::if defined AD >>%.% echo(!"!     localStorage.setItem('hydra',Number(localStorage.getItem('hydra'))+2);
  44. ::if defined AD >>%.% echo(!"!   } else localStorage.setItem('hydra',Number(localStorage.getItem('hydra'))-1);
  45. ::if defined AD >>%.% echo(!"!   if(Number(localStorage.getItem('hydra')) == 2){
  46. ::if defined AD >>%.% echo(!"!     localStorage.setItem('hydra',0); window.location.href='steam://open/minigameslist';
  47. ::if defined AD >>%.% echo(!"! }}
  48. ::if defined AD >>%.% echo(!"! document.addEventListener('visibilitychange',miniOnFocus,true);
  49.  
  50. if defined AD >>%.% echo(!"! </script></head></html>
  51. endlocal
  52.  
  53. rem restart steam silently with parameters
  54. set [1]=-console -forceservice -single_core -windowed -manuallyclearframes 0 -skipinitialbootstrap -skipstreamingdrivers -vrskip
  55. set [2]=-nodircheck -norepairfiles -noverifyfiles -nocrashmonitor -nocrashdialog -nofriendsui -oldlib +"@AllowSkipGameUpdate 1 -
  56. start "Steam" "%STEAMPATH%\Steam.exe" -silent -websocketignorecertissues %[1]% %[2]%
  57. ; AveYo: done!
RAW Paste Data