изменить размер шрифта Firefox в зависимости от расположения окна в настройке нескольких мониторов

467
Andrei

У моего монитора ноутбука плотность пикселей намного выше, чем у моих внешних мониторов, и я хотел бы иметь возможность увеличить глобальный размер шрифта Firefox, используя что-то вроде NoSquint, но только тогда, когда окно размещено на мониторе ноутбука.

Я думаю о решении на основе AutoHotkey . Есть ли какие-то другие варианты, или кто-то уже имеет скрипт Autohotkey, который решает эту проблему?

4

1 ответ на вопрос

1
adaaaam

I wrote this in AHK just now as a solution (since you mentioned the wonderful tool). To use it, set Z1, Z2, etc. to the desired zoom levels shown in the legend. (If nothing is set for a display it will maximize at 100% zoom.) Then, you can combine Alt with the number key corresponding to any display's number to maximize/zoom Firefox on that display. For example:

  • Press Alt+1 to maximize the active FF window to zoom level Z1 on the primary display

  • Press Alt+2 to maximize the active FF window to zoom level Z2 on the secondary display

Code:

; Set the zoom levels for FF to maximize to on each display Z1 = 4 ; Primary display zoom level Z2 = 0 ; Secondary display zoom level Z3 = 0 ; etc.. ; Zoom level legend ; 0 = 100% 3 = 133% 6 = 200% ; 1 = 110% 4 = 150% 7 = 240% ; 2 = 120% 5 = 170% 8 = 300% ; Count displays and create hotkeys accordingly sysGet, monitors, 80 loop %monitors% { sysGet, screen, monitor, %a_index% %a_index%_screenTop := screenTop %a_index%_screenLeft := screenLeft hotkey, ifWinActive, ahk_class MozillaWindowClass hotkey, $!%a_index%, moveMaxZoom } moveMaxZoom: winRestore ; Restore window if necessary thisHotkey := regExReplace(a_thisHotkey, "[^0-9A-Za-z]") winMove, a,, %thisHotkey%_screenLeft, %thisHotkey%_screenTop postMessage, 0x112, 0xF030 ; 0x112 = WM_SYSCOMMAND, 0xF030 = SC_MAXIMIZE Z := Z%thisHotkey% send ^0^{+ %Z%} return