RStudio is great IDE for R development. I wonder if there is any way for nice support HiDPI resolution?
I currently have 13 inch display and 3200x1800 resolution, it is even hard to read RStudio options to adjust more appropriate setting.
This is of course not an RStudio issue but general issue related to high resolution display which requires HiDPI support to make it reasonably usable.
Posting it here as question because RStudio still doesn't allow to fill questions/issues on github.
RStudio is a Qt application. I've solved this by setting a scaling factor in Qt with this environment variable (note it must be an integer):
export QT_DEVICE_PIXEL_RATIO=2
The Arch wiki has some excellent advice on getting HiDPI working.
UPDATE: This solution is only for WINDOWS!
There is a simple solution for you, it comes from the option "Compatibility" of the execute file.
Note that, on the HiDPI screen, resolution of modified RStudio is not so good but it really solved the bad scale problem.
You can also apply this technique to other apps without supporting HiDPI.
I use the following bash script to determine the current screen resolution and substitute the scaling factor by 1 (normal resolution) or 1.75 (high resolution) in the RStudio desktop file:
#!/bin/bash
# Determine resolution
width=$(xdpyinfo | grep 'dimensions:' | grep -o -E '[0-9]+' | head -1 | sed -e 's/^0\+//')
echo "Screen width is $width pixels"
if [ $width -gt 3000 ]; then
echo "High resolution detected -> setting zoom level to 1.75"
sed -i 's/view.zoomLevel.*/view.zoomLevel=1.75/' ~/.config/RStudio/desktop.ini
else
echo "Normal resolution detected -> setting zoom level to 1.0"
sed -i 's/view.zoomLevel.*/view.zoomLevel=1/' ~/.config/RStudio/desktop.ini
fi
QT_QPA_PLATFORMTHEME=gtk2 /usr/lib/rstudio/bin/rstudio %F
I am on Ubuntu 17.10. If I want to use the GTK theme, I have to set the QT_QPA_PLATFORMTHEME environment variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With