Ubuntu 앱에 QT_AUTO_SCREEN_SCALE_FACTOR 적용하기

4K 등 HiDPi 환경에서 Ubuntu에 apt나 Ubuntu Software를 이용해 앱을 설치한 후 이를 실행을 하게 되면 레이아웃이 보기 싫게 깨지는 경우가 있다. Gtk 환경의 앱은 어느 정도 자체적으로 지원이 되는듯 한데, Qt 환경의 앱은 그러지 않는데, QT_AUTO_SCREEN_SCALE_FACTOR 환경 변수를 설정하면 쉽게 적용이 가능하다.

예를 들어, 스크린 녹화 앱인 vokoscreen의 경우 설치한 후에 실행을 하게 되면,

와 같이 되는데 (스크린샹으론 잘 구별이 되진 않지만….), QT_AUTO_SCREEN_SCALE_FACTOR 환경 변수를 설정한 후 실행하면,

와 같이, UI 레이아웃의 비율이 원래와 같이 나옴을 볼 수 있다.

수정하는 방법은 각 앱의 desktop 파일을 검색하고, (보통은 /usr/share/applications 디렉토리에 있음) 편집기를 이용해 해당되는 앱의 desktop 파일을 다음과 같이 수정한다.

[수정전]

[Desktop Entry]
Comment=screencast
Exec=/usr/bin/vokoscreen
Icon=vokoscreen
Name=vokoscreen
StartupNotify=false
Terminal=false
Type=Application
Categories=AudioVideo;Recorder;
Keywords=Audio;Video;Recorder;Screencast;

[수정후]

[Desktop Entry]
Comment=screencast
Exec=env QT_AUTO_SCREEN_SCALE_FACTOR=1 /usr/bin/vokoscreen
Icon=vokoscreen
Name=vokoscreen
StartupNotify=false
Terminal=false
Type=Application
Categories=AudioVideo;Recorder;
Keywords=Audio;Video;Recorder;Screencast;

저장하고, 예전과 같이 앱을 실행하면 됨.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.