# Is there a way to make the DPI always sync depending on which screen I am using?

I run Blender through a laptop and when when I'm at home I connect my laptop to an external display screen.

That means the resolution changes so the DPI I use when working on the laptop is incredibly small on the other screen.

As a result I change my display screen maybe twice a day and would like to know if is there a way to sync it so that I don't have to manually change it every time?

• Maybe, but this would likely either be hardware or operating system dependent, it is probably not something that could be done in Blender. – brasshat May 9 '17 at 20:14
• I think the user might be refering to the DPI setting in Blender user preferences under System > DPI, which could theoretically be changed by a script, though it is probably non trivial, and require some coding and Python knowledge – Duarte Farrajota Ramos May 9 '17 at 23:39

While an addon can create an operator that can change the DPI setting, it cannot access or change the current setting while blender is registering the addon.

Once the addon has been registered the operator can change the DPI for you. An operator can be assigned to a button or a keyboard shortcut for you to use. My thought is adding a button to the top left of the info header will always be visible and will let you quickly toggle between two specific DPI settings.

Save the following to a text file and use Install from File in your preferences. You can then enable the addon and Save User Settings so that is always available. The two dpi settings can be adjusted to taste.

bl_info = {
"name": "Set DPI",
"author": "sambler",
"version": (1, 0),
"blender": (2, 75, 0),
"description": "Toggle between two DPI settings",
"category": "System",
}

import bpy

low_res_dpi = 72
hi_res_dpi = 120

class SetDPI(bpy.types.Operator):
bl_idname = 'wm.set_dpi'
bl_label = 'Toggle dpi setting'

def execute(self, context):
syspref = context.user_preferences.system
if syspref.dpi <= low_res_dpi:
syspref.dpi = hi_res_dpi
else:
syspref.dpi = low_res_dpi
return {'FINISHED'}

if context.user_preferences.system.dpi <= low_res_dpi:
i = 'FULLSCREEN_ENTER'
else:
i = 'FULLSCREEN_EXIT'
self.layout.operator( SetDPI.bl_idname, text="", icon=i )

def register():
bpy.utils.register_class(SetDPI)