From 779ff5899ea67625de52a3eef335ae54ff0eea40 Mon Sep 17 00:00:00 2001 From: SniverDaBest <106615041+SniverDaBest@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:40:55 -0700 Subject: [PATCH] Made it so if you aren't using X11, or are using something else like wayland, it throws an error and quits. --- src/boomer.nim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/boomer.nim b/src/boomer.nim index 40d2693..dc84179 100644 --- a/src/boomer.nim +++ b/src/boomer.nim @@ -15,9 +15,15 @@ import la import strutils import math import options +import system type Shader = tuple[path, content: string] +proc check_x11() = + if getEnv("XDG_SESSION_TYPE") != "x11": + echo "ERROR: Boomer doesn't work on Wayland..." + system.quit(1) + proc readShader(file: string): Shader = when nimvm: result.path = file @@ -180,6 +186,8 @@ proc main() = var windowed = false var delaySec = 0.0 + check_x11() + # TODO(#95): Make boomer optionally wait for some kind of event (for example, key press) block: proc versionQuit() =