====== Linux HighDPI ====== * [[https://wiki.archlinux.org/title/HiDPI|HiDPI - ArchWiki]] * [[https://wiki.debian.org/MonitorDPI|MonitorDPI - Debian Wiki]] * [[linux:xrandr|XRandr]] * [[https://github.com/alex-spataru/HiDPI-Fixer|alex-spataru/HiDPI-Fixer: Qt app that automates fractional scaling configuration on X11 desktops]] * [[https://askubuntu.com/questions/197828/how-to-find-and-change-the-screen-dpi|How to find and change the screen DPI? - Ask Ubuntu]] * [[https://winaero.com/find-change-screen-dpi-linux/|How to Find and Change Screen DPI in Linux]] ===== Gnome ===== * [[linux:gnome|Gnome]] * 설정에서 Scale 을 조정하면 됨. * Gnome 환경의 QT 애플리케이션의 경우 시작 프로그램으로 너무 일찍 시작하면 Scaling 이 적용 안될때가 있음. 약간 sleep을 주고 실행해볼 것. * [[linux:gnome:dconf|dconf]] 를 이용해서 ''org.gnome.desktop.interface/scaling-factor'' 값이 적용된다. * ''hidpi daemon'' 사용시 이 값이 올바로 변경되지 않는 경우를 발견함. 직접 바꿔 줘야 할수도 있음. ==== Gnome 3.38 ==== * 기본적으로는 정수 스케일링만 가능(''1(100%), 2(200%), 3(300%), ...''). * Gnome 3.38 현재, 재부팅 없이 Scaling 변경 방법. 모니터별로 별도 스케일링 지정은 안 된다. * 먼저, **시스템설정 -> Display** 에서 해상도와 비율(Scaling Factor)를 원하는 값으로 조정해준다. * 그래도 실제로는 즉시 반영이 안되는데, 그 상황에서 원하는 Scaling Factor 에 따라 아래 명령을 실행한다. # 1K : 100% gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <1>}]" gsettings set org.gnome.desktop.interface scaling-factor 1 # 4k - 200% gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <2>}]" gsettings set org.gnome.desktop.interface scaling-factor 2 * 그 뒤에 Gnome 자체를 재시작한다. [[linux:gnome|Gnome]] 참조.(제일 쉬운건 ''Alt-F2, r'') * 그리고서 이미 실행돼서 떠 있는 애플리케이션들을 재시작해줘야 한다. 특히 ''guake'', 등.. * [[linux:xrandr|XRandr]] 을 통한 해상도와 Scaling Factor 변경은 올바로 반영이 안됐었다. ==== Gnome 42 ==== * 위의 ''scaling-factor'' 값들이 반영이 안됐다. * [[:intellij_idea|IntelliJ IDEA]]의 경우 다른 방식이 필요했다. ==== gdm ==== * [[linux:gdm|GDM]] 로그인 화면에 대해서도 scaling 을 강제 지정할 수 있다. ===== Pop! OS, Gnome HIDPI Daemon ===== * [[https://blog.system76.com/post/174414833678/all-about-the-hidpi-daemon|System76 Blog — All About the HiDPI Daemon]] * [[https://support.system76.com/articles/hidpi-multi-monitor/|HiDPI Multi-Monitor Support - System76 Support]] * [[http://ppa.launchpad.net/system76-dev/stable/ubuntu/pool/main/h/hidpi-daemon/|HiDPI Daemon PPA deb files]] 에서 직접 다운로드 가능. 혹은 * [[https://launchpad.net/~system76-dev/+archive/ubuntu/stable|System76 Stable PPA]] 등록해서 패키지 설치 * HiDPI(4K) 노트북 등을 사용하는데 LoDPI(FHD) 모니터가 붙으면 LoDPI를 기준으로 HiDPI 쪽 해상도를 변경하고 Scaling 을 100%로 자동변경하는 데몬이다. * 예를들어, 3840x2160(16:9, 4k) 모니터에 한 대를 200% Scaling을 사용하고 있는 도중에 1920x1080(16:9, FHD, 1K) 모니터가 연결되면 설정을 뭐로 했었는지를 기억해서 * 첫번째 모니터의 해상도도 1920x1080 으로 변경하고, Scaling 100%로 하거나 * 혹은 첫번째 모니터를 3840x2160으로 유지하더라도 Scaling 을 100%로 강제로 변경해서 맞춰버린다. * 이 경우 Gnome/GTK 애플리케이션들은 스케일링이 잘 되지만, QT 애플리케이션은 재시작해줘야했다. * Top Panel 의 아이콘들이 깨져보인다면 ''Alt+F2'' -> ''r'' 로 Gnome을 재시작하면 정상적으로 보인다. ===== KDE / QT 5 ===== * [[https://github.com/maldoinc/plasma-dpi-switcher|maldoinc/plasma-dpi-switcher: Configure and automate KDE Plasma DPI scaling]] * [[https://doc.qt.io/qt-5/highdpi.html|High DPI Displays | Qt 5.15]] * 보통은 환경변수 ''QT_AUTO_SCREEN_SCALE_FACTOR=1'' 이면 자동으로 처리함. * 명시적으로 지정하려면 ''QT_SCALE_FACTOR=2.0''(200%) 형태로 지정. * 모니터다 여러개인 상태에서 명시적 지정하려면, ''QT_SCREEN_SCALE_FACTORS="2;2"'' 형태.(200%) * 명시적으로 설정할 때는 항상 ''QT_AUTO_SCREEN_SCALE_FACTOR=0'' 상태로 둬야한다. # 명시적 조정 QT_SCALE_FACTOR=2 QT_AUTO_SCREEN_SCALE_FACTOR=0 application > if ''QT_AUTO_SCREEN_SCALE_FACTOR=1'' does not work, the issue may be related to that gnome-settings-daemon sets Xft.dpi to a non-integer. Try xrdb -query | grep dpi to check this. – Fang Hung-chien Jun 15 '19 at 22:36 ==== KDE Plasma DPI 변경 즉시 적용 ==== * [[https://nilsonsales.wordpress.com/2019/10/31/changing-monitor-dpi-on-kde-using-xrandr/|Changing monitor DPI on KDE using ‘xrandr’]] * [[linux:xrandr|XRandr]] xrandr --dpi 120 # then kquitapp5 plasmashell && kstart5 plasmashell > The recommended values are 96 (default value), 120 (25% higher), 144 (50% higher), 168 (75% higher) and 192 (100% higher). ===== wine ===== * [[linux:wine|Linux Wine]] * [[https://www.dedoimedo.com/computers/wine-apps-hd-display.html|WINE applications on HD displays - Better looks]] * ''winecfg'' 에서 **Graphics -> Screen resolution** 에서 dpi 변경. * 표준 DPI 설정은 100%(''96'' DPI), 125%(''120'' DPI) 및 150%(''144'' DPI), 200%(''192'' DPI) * [[https://learn.microsoft.com/ko-kr/windows/win32/learnwin32/dpi-and-device-independent-pixels|DPI 및 장치 독립적 픽셀 - Win32 apps | Microsoft Learn]] ===== gimp ===== * [[linux:gimp|GIMP]]의 아이콘 크기를 명시적 조정으로 변경할 수 있다. * **편집 -> 기본설정 -> 인터페이스 -> 아이콘 테마** 에서 ''Custom icon size''로 변경하고 크기 지정 * [[linux:ubuntu:20.04|Ubuntu 20.04 Focal Fosa]] 저장소의 gimp 는 아이콘 크기 지정이 안 먹음. [[https://snapcraft.io/gimp|snapcraft gimp]], [[https://flathub.org/apps/details/org.gimp.GIMP|flathub gimp]]는 잘 됨. ===== Java Swing ===== * Java 9 이상부터 ''GDK_SCALE=2'' 형태의 환경변수를 인식한다. * [[linux:flatpak|Flatpak]] 혹은 [[linux:snap|Snap]] 애플리케이션 실행시에도 ''GDK_SCALE=2''를 줘서 실행할 수 있다. GDK_SCALE=2 flatpak run net.sourceforge.squirrel_sql * [[https://developer.gnome.org/gtk3/stable/gtk-x11.html|Using GTK+ on the X Window System: GTK+ 3 Reference Manual]] * [[https://github.com/flathub/com.diy_fever.DIYLayoutCreator/blob/master/diylc.sh#L3|com.diy_fever.DIYLayoutCreator/diylc.sh at master · flathub/com.diy_fever.DIYLayoutCreator]] * [[https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk11/issues/15|Java Swing applications (SWT) lack Desktop integration · Issue #15 · flathub/org.freedesktop.Sdk.Extension.openjdk11]] ===== JetBrains / IntelliJ IDEA ===== * 2023 최근에는 별다른 설정없이 잘 인식 됐음. * [[https://intellij-support.jetbrains.com/hc/en-us/articles/360007994999-HiDPI-configuration|HiDPI configuration – IDEs Support (IntelliJ Platform) | JetBrains]] * [[https://plugins.jetbrains.com/plugin/9541-hidpi-profiles|hidpi-profiles - plugin for IntelliJ IDEs | JetBrains]] * ''JBR 11'' 사용시에 다음 순서로 적용된다. * ''-Dsun.java2d.uiScale=값'' * Gnome dconf의 ''org.gnome.desktop.interface/scaling-factor'' (모니터 무관 전역값) 값을 우선 사용한다. 이 값이 잘 못되면 이상 작동한다. * ''ubuntu.user-interface/scale-factor'' 모니터별 DPI 설정값([[linux:wayland|Wayland]])용. * ''GDK_SCALE'' * Gnome 4.2 [[linux:ubuntu:22.04|Ubuntu Linux 22.04 Jammy Jellyfish]]부터 위에 나온 ''dconf'' 값들이 모두 제대로 설정이 안되고 있다. 따라서 ''-Dsun.java2d.uiScale.enabled=false'' 로 IDE 가 자동 판독하게 하거나, 아니면 ''-Dsun.java2d.uiScale=2''로 명시해야 했다. ===== JavaFX ===== * [[https://news.kynosarges.org/2018/01/26/javafx-dpi-scaling-in-java-9/|JavaFX DPI Scaling in Java 9 – Kynosarges Weblog]] ===== Console / Virtual Terminal ===== * [[http://www.ateijelo.com/blog/2017/02/01/linux-console-high-dpi-display|Linux Console & High DPI Displays]] * ''/usr/share/consolefonts'' 디렉토리에서 콘솔용 글꼴 목록 확인가능. * Ubuntu 에서는 ''/etc/default/console-setup'' 파일에 다음 설정으로 확대된 글꼴 사용가능했음. CODESET="Uni3" FONTFACE="Terminus" FONTSIZE="32x16" ===== 특정 Window 단위 스케일링 ===== * [[https://github.com/feklee/vncdesk|GitHub - feklee/vncdesk: Run applications in VNC desktops. Use for scaling on HiDPI displays.]] * [[https://github.com/kaueraal/run_scaled|GitHub - kaueraal/run_scaled: Run an X application scaled via xpra. Useful on hidpi screens.]] * [[https://github.com/kaueraal/run_scaled|run_scaled]] ===== 참조 ===== * [[https://www.youtube.com/watch?v=qv72pUWM08U|HiDPI 환경을 지원하지 못하는 Application의 스케일 변경하기 - YouTube]]