Any way to tell on linux if a program is started from a terminal versus started from clicking on an icon?
Knute Johnson <knute2020@585ranch.com> wrote:
Any way to tell on linux if a program is started from a terminal versus
started from clicking on an icon?
Maybe https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/GraphicsEnvironment.html#isHeadless()
or
https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#console() (compare result with null)
depending on what you want to get if both console and X11 is available.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 77:52:21 |
Calls: | 6,658 |
Calls today: | 4 |
Files: | 12,203 |
Messages: | 5,332,968 |
Posted today: | 1 |