| 1 | package io.github.humbleui.jwm; |
| 2 | |
| 3 | public enum Platform { |
| 4 | WINDOWS, |
| 5 | X11, |
| 6 | MACOS; |
| 7 | |
| 8 | public static final Platform CURRENT; |
| 9 | |
| 10 | static { |
| 11 | String os = System.getProperty("os.name").toLowerCase(); |
| 12 | if (os.contains("mac") || os.contains("darwin")) |
| 13 | CURRENT = MACOS; |
| 14 | else if (os.contains("windows")) |
| 15 | CURRENT = WINDOWS; |
| 16 | else if (os.contains("nux") || os.contains("nix")) |
| 17 | CURRENT = X11; |
| 18 | else |
| 19 | throw new RuntimeException("Unsupported platform: " + os); |
| 20 | } |
| 21 | } |