Skip to content

Instantly share code, notes, and snippets.

@imniko
Last active August 18, 2023 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save imniko/d54fc3f4f157a6b114873f3b58ce9083 to your computer and use it in GitHub Desktop.
Save imniko/d54fc3f4f157a6b114873f3b58ce9083 to your computer and use it in GitHub Desktop.
Sample AHK script to change windows display scaling using https://github.com/imniko/SetDPI , compatible with AHK version 1.x
#persistent
current_scale := 100 ; scale value you are currently in
next_scale := 125 ; scale value you want to switch to next
is_scaled := 0
return
; Ctrl + Win + F1 toggles main monitor between 2 scale values
^#F1::
if(is_scaled == 0)
Run SetDpi.exe %next_scale%
else
Run SetDpi.exe %current_scale%
is_scaled := !is_scaled
return
; Ctrl + Win + F2 sets 2nd monitor to a scale of 150
^#F2::
Run SetDpi.exe 150 2
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment