run_scaled icon indicating copy to clipboard operation
run_scaled copied to clipboard

Breakage if using non-default "bc" settings

Open vstax opened this issue 4 years ago • 1 comments

Hello. Thanks for this neat script.

I've tried it yesterday for the first time and it didn't work for me: turns out, it assumes that bc has 0 digit precision, which is default but might not always be the case. I use bc a lot and have ~/.bcrc with following contents

scale = 3

This makes run_scaled break like this (for 4K screen):

(EE) Invalid screen configuration 1920.000x1080.000x24+32 for -screen 0

The solution is trivial though a bit ugly, calculate unscaled resolution as follows

UNSCALED_RESOLUTION="$( bc <<<"scale=0; $UNSCALED_RESOLUTION_X / $SCALING_FACTOR" )x$( bc <<<"scale=0; $UNSCALED_RESOLUTION_Y / $SCALING_FACTOR" )"

It's unfortunate that there are no better options such as "skip reading RC file", but that's how it is.

I also wish it would fail more gracefully in absence of dependencies, e.g I saw that xpra is required but script was failing in not very obvious until I installed Xvfb as well. But, well, that's a different issue :)

vstax avatar Sep 08 '20 11:09 vstax

I also have scale set in my .bcrc. I created PR #41 to fix it.

devkev avatar Apr 29 '21 07:04 devkev

Xpra directly includes an equivalent tool since version 4.1. It is also called run_scaled and is part of the default Xpra installation.

Hence, this script here is deprecated and no longer maintained. I'm sorry that it took me quite long to officially announce it here. Thank you for your support and please continue your HiDPI journey with Xpra's tool!

kaueraal avatar Jul 22 '23 20:07 kaueraal