Skip to content

Instantly share code, notes, and snippets.

@gabriel-laet
Created June 2, 2015 03:06
Show Gist options
  • Save gabriel-laet/1372dc07b0c946f7da8c to your computer and use it in GitHub Desktop.
Save gabriel-laet/1372dc07b0c946f7da8c to your computer and use it in GitHub Desktop.
Set IntelliJ HIDPI flag according to scaling-factor
--- bin/idea.sh 2015-06-02 00:03:02.869607320 -0300
+++ bin/idea.sh 2015-06-02 00:01:59.867708731 -0300
@@ -171,6 +171,12 @@
CLASSPATH="$CLASSPATH:$IDEA_CLASSPATH"
fi
+# Define HIDPI flag
+SCALE_FACTOR=$(gsettings get org.gnome.desktop.interface scaling-factor | sed 's/uint32\ //')
+if [ "$SCALE_FACTOR" = 2 ]; then
+ HIDPI_PROPERTIES="-Dhidpi=true"
+fi
+
# ---------------------------------------------------------------------
# Run the IDE.
# ---------------------------------------------------------------------
@@ -181,6 +187,7 @@
$VM_OPTIONS "-Djb.vmOptionsFile=$VM_OPTIONS_FILES_USED" \
"-XX:ErrorFile=$HOME/java_error_in_IDEA_%p.log" \
-Djb.restart.code=88 -Didea.paths.selector=IntelliJIdea14 \
+ $HIDPI_PROPERTIES \
$IDE_PROPERTIES_PROPERTY \
$IDE_JVM_ARGS \
$REQUIRED_JVM_ARGS \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment