WolverineFan / YNABLinuxInstall

Install script for YNAB 4 on Linux
174 stars 18 forks source link

YNAB4 (Adobe Air) on a HiDPI screen #18

Open oboxodo opened 9 years ago

oboxodo commented 9 years ago

I have a new PC with a HiDPI screen (3200x1800 13" 276pdi). Just installed YNAB on Ubuntu 15.04 following your instructions and seems to work great.

The problem is the size of the text as it doesn't seem to support HiDPI.

I changed wine's resolution from 96 to 276dpi via the Graphics tab in winecfg:

WINEPREFIX=$HOME/.wine_YNAB4 winecfg

The menu now looks good, but YNAB itself (the AdobeAir part) still looks tiny.

According to this support thread, YNAB already supports Retina/HiDPI screens. So I think the only thing missing is finding a way to tell AdobeAir in Linux (wine, actually) that it's running on a HiDPI screen.

Any clues?

doridori commented 7 years ago

temp change your screen res while using YNAB! XPS 13?

mydewji commented 7 years ago

Same issue here, haven't found a workaround :(

RadicalZephyr commented 6 years ago

Same issue with a System76 Galago Pro. I'm working on improving a generic workaround for running specific programs at a higher resolution.

EDIT - Better Option

An even better option than any of the below, use the run_scaled script, available on github: https://github.com/kaueraal/run_scaled

The basic gist is this: run YNAB in an Xvfb X server, expose that server over VNC with x11vnc which allows you to scale the output, then use a vncviewer to actually interact with YNAB.

Dependencies

On an apt system get the deps with: sudo apt install xvfb x11vnc matchbox tigervnc-viewer

Setup

Make a wrapper shell script for starting Wine-YNAB: ~/.local/bin/start-ynab

#!/bin/sh

wine /home/geoff/.wine/drive_c/Program\ Files\ \(x86\)/YNAB\ 4/YNAB\ 4.exe &

matchbox-window-manager -use_titlebar no -use_desktop_mode plain

Run

Then in three separate terminals:

xvfb-run -n 99 -f /tmp/Xauthority ~/.local/bin/start-ynab
x11vnc -auth /tmp/Xauthority -nopw -localhost -display :99 -scale 2:nb -repeat
vncviewer localhost

Notes

Credit for the basic idea of scaling with VNC and running the program in a separate X server goes to KenMacD from this ArchLinux thread https://bbs.archlinux.org/viewtopic.php?id=192733

Anyone have ideas for improving this? Ideally I'd like to create a wrapper script similar xvfb-run that could automate setting up this entire process so I can run any tiny apps in a zoomed fashion.

pierrecollignon commented 4 years ago

After hours swearing at the screen, I got it working like such:

WINEARCH=win32 WINEPREFIX=~/.wine32 wine /home/pierre/.wine32/drive_c/Program\ Files/YNAB\ 4/YNAB\ 4.exe & matchbox-window-manager -use_titlebar no -use_desktop_mode plain


- Configure the VNC chain to run the framebuffer at same resolution + scale x3

cat /usr/local/bin/ynab

!/bin/bash

xvfb-run -s "-screen 0 1278x655x24" -n 99 -f /tmp/Xauthority ~/.local/bin/start-ynab & (sleep 6 && x11vnc -auth /tmp/Xauthority -nopw -localhost -display :99 -scale 3:nb -shared -forever -noxfixes) & (sleep 10 && xtightvncviewer localhost:5900) wait pkill Xvfb && pkill start-ynab && pkill x11vnc && pkill xtightvncviewer



And VOILA, runs perfect in 4k on gnome (pixel size to adapt for your own VNC renderer), no crash (xtightvncviewer is better), no overflow requiring scrolling, and auto stops if you close window or do Ctrl+C.

I can't imagine a generic solution though, since you need to size the underlying window correctly first, with the right aspect ratio and pixel margin so that when scaled by your, again, custom scale factor, it doesn't overflow out of the screen. You can set parameters, but you don't solve:
- finding the actual perfect window size + scale factor combo since it very much depends on the app behaviour. YNAB scales itself in the resolution it's given for ex, but other would be fixed, maybe
- setting the size at the application level, since it's too late by the time you do it in the framebuffer.
Valloric commented 1 year ago

For others having the same issue, the best solution is to use run_scaled.

  1. Install dependencies for the script (Debian: sudo apt install xvfb xpra x11-xserver-utils)
  2. Put run_scaled on your PATH
  3. Edit your YNAB desktop launcher and change Exec line to start with run_scaled --scale=1.75 (adjust scale factor as desired)
axelson commented 1 year ago

I'll third the run_scaled suggestion. I'm now using the following script to launch ynab4:

#!/bin/bash
~/install/run_scaled/run_scaled --scale=2.5 env WINEPREFIX="/home/jason/.wine" wine-stable C:\\windows\\command\\start.exe /Unix /home/myuser/.wine/dosdevices/c:/ProgramData/Microsoft/Windows/Start\ Menu/Programs/YNAB\ 4/YNAB\ 4.lnk

Although I had to make a small change to run_scaled to get it to work for me: https://github.com/kaueraal/run_scaled/issues/48

Not sure why I'm the only one who appears to be running into that.