mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
os: add flatpak detection
This commit is contained in:
9
src/os/flatpak.zig
Normal file
9
src/os/flatpak.zig
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
const std = @import("std");
|
||||||
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
|
/// Returns true if we're running in a Flatpak environment.
|
||||||
|
pub fn isFlatpak() bool {
|
||||||
|
// If we're not on Linux then we'll make this comptime false.
|
||||||
|
if (comptime builtin.os.tag != .linux) return false;
|
||||||
|
return if (std.fs.accessAbsolute("/.flatpak-info", .{})) true else |_| false;
|
||||||
|
}
|
Reference in New Issue
Block a user