From 6314db1861dfebd72688da1f4bf6da32e4a6f494 Mon Sep 17 00:00:00 2001 From: pztrn Date: Fri, 14 Aug 2015 21:43:54 +0500 Subject: [PATCH] Export JAVA options only if we have X session running. --- zsh/exports/70-java-options.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zsh/exports/70-java-options.zsh b/zsh/exports/70-java-options.zsh index bfdd264..a4ed7ec 100644 --- a/zsh/exports/70-java-options.zsh +++ b/zsh/exports/70-java-options.zsh @@ -1,4 +1,7 @@ # Java-specific exports. # More or less pretty fonts in Java programs. -export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' -export JAVA_FONTS=/usr/share/fonts/TTF \ No newline at end of file +# It should be exported only if we have X session running. +if [ ! -z ${DISPLAY} ]; then + export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' + export JAVA_FONTS=/usr/share/fonts/TTF +fi