From f578f3af81728d5f2590bc69ad125ef143d9d8f6 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Fri, 25 Mar 2016 15:08:35 +0100 Subject: [PATCH] Force headless mode if "--tui" is passed (so we can generate image even if we have a DISPLAY env var and no X11) --- src/be/nikiroo/jvcard/launcher/Main.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/be/nikiroo/jvcard/launcher/Main.java b/src/be/nikiroo/jvcard/launcher/Main.java index 5fea28d..178dff1 100644 --- a/src/be/nikiroo/jvcard/launcher/Main.java +++ b/src/be/nikiroo/jvcard/launcher/Main.java @@ -167,6 +167,12 @@ public class Main { files.addAll(open(arg)); } } + + // Force headless mode if we run in forced-text mode + if (textMode != null && textMode) { + // same as -Djava.awt.headless=true + System.setProperty("java.awt.headless", "true"); + } if (unicode) { utf8(); -- 2.27.0