From 5bc9701d9027ee315c449a2aaf93e2bc8b74eb48 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 18 May 2026 12:09:28 +0200 Subject: [PATCH] Added wayland package --- lib/wayland/path.q | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/wayland/path.q diff --git a/lib/wayland/path.q b/lib/wayland/path.q new file mode 100644 index 0000000..0ec3799 --- /dev/null +++ b/lib/wayland/path.q @@ -0,0 +1,22 @@ +import cli +import mem + +path() -> (!string, error) { + runtime, err := cli.env("XDG_RUNTIME_DIR") + + if err != 0 { + return "", -1 + } + + display, err := cli.env("WAYLAND_DISPLAY") + + if err != 0 { + return "", -1 + } + + address := mem.alloc(runtime.len + 1 + display.len) + mem.copy(address, runtime) + address[runtime.len] = '/' + mem.copy(address[runtime.len+1..], display) + return address, 0 +} \ No newline at end of file -- 2.51.2