* On X, use X display variable; * On Wl, use Wl display variable; * Otherwise, use NULL device * (ie: we are neither on x or wayland; try drm plugin) */
| 8 | * (ie: we are neither on x or wayland; try drm plugin) |
| 9 | */ |
| 10 | const char *fetch_display() { |
| 11 | /* |
| 12 | * Use wayland as first case, |
| 13 | * as sometimes on wayland you have $DISPLAY env var too! |
| 14 | */ |
| 15 | const char *wl_display = getenv("WAYLAND_DISPLAY"); |
| 16 | if (!is_string_empty(wl_display)) { |
| 17 | return wl_display; |
| 18 | } |
| 19 | return getenv("DISPLAY"); |
| 20 | } |
| 21 | |
| 22 | /* |
| 23 | * On X, use xauthority |
no test coverage detected