Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: ==================================
- :: Legion Power Optimizations
- :: ==================================
- :: Automatically change power plan and screen refresh rate when
- :: the AC adaptor is connected or disconnected on your Lenovo Legion Laptop:
- ::
- :: - When unplugged, set screen refresh to 60hz and Power Plan to Quiet
- :: - When plugged, set screen refresh to 165hz and Power Plan to Balanced
- ::
- :: Only tested on a single Legion 7 5800H/3070RTX, so your mileage may vary.
- :: Use at your own risk.
- ::
- :: ==================================
- :: Installation
- :: ==================================
- :: - Save this script to "c:\tools\legion-power\apply-settings.bat" (or other directory of your choice)
- :: - Download http://tools.taubenkorb.at/change-screen-resolution/#download
- :: - Copy "ChangeScreenResolution.exe" to "c:\tools\legion-power"
- ::
- :: ==================================
- :: Task Setup
- :: ==================================
- :: Create a Windows Task which triggers when the AC Adaptor is inserted or unplugged:
- ::
- :: - Press START button and start typing "task scheduler"
- :: - Click "Task Scheduler" once it appears
- :: - Click "Action > Create Basic Task"
- :: - Follow the wizard using these settings: https://imgur.com/a/qvf6UNN
- :: - Once the task is created, right-click on it and select properties. The task settings will open in a new window.
- :: - Go through each tab and ensure the settings identical to https://imgur.com/a/U6io2Hm
- @echo off
- set exe=%~dp0ChangeScreenResolution.exe
- set width=2560
- set height=1600
- set colorBits=32
- set refreshBattery=60
- set refreshPlugged=165
- set pwrBattery=16edbccd-dee9-4ec4-ace5-2f0b5f2a8975
- set pwrPlugged=85d583c5-cf2e-4197-80fd-3789a227a72c
- set refresh=
- set pwrPlan=
- set "batStatus="&for /f "skip=1 tokens=*" %%m in ('wmic PATH Win32_Battery Get BatteryStatus ') do if not defined batStatus set "batStatus=%%m"
- if %batStatus% == 1 (
- set refresh=%refreshBattery%
- set pwrPlan=%pwrBattery%
- ) else (
- set refresh=%refreshPlugged%
- set pwrPlan=%pwrPlugged%
- )
- if exist %exe% (
- echo Setting refresh %exe%
- %exe% /w=%width% /h=%height% /f=%refresh% /d=0
- ) else (
- echo Change refresh failed - %exe% not found
- )
- powercfg -s %pwrPlan%
- echo Power Plan set to %pwrPlan%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement