-
Notifications
You must be signed in to change notification settings - Fork 3
/
tdp_10w.ps1
29 lines (23 loc) · 1.25 KB
/
tdp_10w.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<#
Steam Deck powershell script by ryanrudolf.
This script is intended to be used in conjunction with Playnite.
Prerequisites - Playnite and RyzenAdj.
Put this script in a folder together with RyzenAdj.
The script will check if Steam Deck is plugged in to charger or running on battery.
If Steam Deck is running on battery, the script will set the TDP to 10W.
Otherwise the Steam Deck is connected to charger. No action needed the script exits immediately.
To set as the default TDP for all games - Add this script to the global script settings of Playnite - "execute before starting a game"
To set as TDP on a per-game basis - Add this script to the specific game in Playnite - "execute after starting a game"
#>
<# Initialize variables #>
$RyzenAdjInstallLocation="d:\1tools\scripts\ryzenadj\ryzenadj.exe"
<# main #>
Get-WmiObject Win32_Battery | findstr -i BatteryStatus | findstr 2
if ($LASTEXITCODE -eq 0) {
Write-output "Steam Deck is connected to charger. No changes needed. Goodbye."
exit }
elseif ($LASTEXITCODE -eq 1) {
Write-output "Steam Deck is running on battery. Setting TDP to 10W. Please wait"
Start-Process $RyzenAdjInstallLocation -ArgumentList "--stapm-limit=1000 --slow-limit=10000 --fast-limit=10000" -Verb runas
exit }
exit