Skip to content

Commit

Permalink
core: prohibit checking for the desktop environment on linux during c…
Browse files Browse the repository at this point in the history
…omptime
  • Loading branch information
jcollie committed Jan 3, 2025
1 parent 5c39d09 commit c89df01
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/os/desktop.zig
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub fn desktopEnvironment() DesktopEnvironment {
.macos => .macos,
.windows => .windows,
.linux => de: {
if (@inComptime()) @compileError("Checking for the desktop environment on Linux must be done at runtime.");
// use $XDG_SESSION_DESKTOP to determine what DE we are using on Linux
// https://www.freedesktop.org/software/systemd/man/latest/pam_systemd.html#desktop=
const de = posix.getenv("XDG_SESSION_DESKTOP") orelse break :de .other;
Expand Down

0 comments on commit c89df01

Please sign in to comment.