mirror of https://github.com/fairyglade/ly.git
config: allow waylandsessions and xsessions to be set to null
Makes both fields optional (?[]const u8), consistent with other nullable config fields such as xinitrc. Setting either to null in config.ini cleanly skips crawling for that session type with no side effects.
This commit is contained in:
parent
142476041d
commit
2874fb4abd
|
|
@ -363,6 +363,7 @@ vi_mode = false
|
|||
# Wayland desktop environments
|
||||
# You can specify multiple directories,
|
||||
# e.g. $PREFIX_DIRECTORY/share/wayland-sessions:$PREFIX_DIRECTORY/local/share/wayland-sessions
|
||||
# If null, Wayland sessions will not be shown
|
||||
waylandsessions = $PREFIX_DIRECTORY/share/wayland-sessions
|
||||
|
||||
# Xorg server command
|
||||
|
|
@ -384,6 +385,7 @@ xinitrc = ~/.xinitrc
|
|||
# Xorg desktop environments
|
||||
# You can specify multiple directories,
|
||||
# e.g. $PREFIX_DIRECTORY/share/xsessions:$PREFIX_DIRECTORY/local/share/xsessions
|
||||
# If null, X11 sessions will not be shown
|
||||
xsessions = $PREFIX_DIRECTORY/share/xsessions
|
||||
|
||||
# Custom Commands and Labels:
|
||||
|
|
|
|||
|
|
@ -92,9 +92,9 @@ start_cmd: ?[]const u8 = null,
|
|||
text_in_center: bool = false,
|
||||
vi_default_mode: ViMode = .normal,
|
||||
vi_mode: bool = false,
|
||||
waylandsessions: []const u8 = build_options.prefix_directory ++ "/share/wayland-sessions",
|
||||
waylandsessions: ?[]const u8 = build_options.prefix_directory ++ "/share/wayland-sessions",
|
||||
x_cmd: []const u8 = build_options.prefix_directory ++ "/bin/X",
|
||||
x_vt: ?u8 = null,
|
||||
xauth_cmd: []const u8 = build_options.prefix_directory ++ "/bin/xauth",
|
||||
xinitrc: ?[]const u8 = "~/.xinitrc",
|
||||
xsessions: []const u8 = build_options.prefix_directory ++ "/share/xsessions",
|
||||
xsessions: ?[]const u8 = build_options.prefix_directory ++ "/share/xsessions",
|
||||
|
|
|
|||
|
|
@ -769,7 +769,8 @@ pub fn main() !void {
|
|||
var has_crawl_error = false;
|
||||
|
||||
// Crawl session directories (Wayland, X11 and custom respectively)
|
||||
var wayland_session_dirs = std.mem.splitScalar(u8, state.config.waylandsessions, ':');
|
||||
if (state.config.waylandsessions) |waylandsessions| {
|
||||
var wayland_session_dirs = std.mem.splitScalar(u8, waylandsessions, ':');
|
||||
while (wayland_session_dirs.next()) |dir| {
|
||||
crawl(&state.session, state.lang, dir, .wayland) catch |err| {
|
||||
has_crawl_error = true;
|
||||
|
|
@ -780,9 +781,11 @@ pub fn main() !void {
|
|||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (build_options.enable_x11_support) {
|
||||
var x_session_dirs = std.mem.splitScalar(u8, state.config.xsessions, ':');
|
||||
if (state.config.xsessions) |xsessions| {
|
||||
var x_session_dirs = std.mem.splitScalar(u8, xsessions, ':');
|
||||
while (x_session_dirs.next()) |dir| {
|
||||
crawl(&state.session, state.lang, dir, .x11) catch |err| {
|
||||
has_crawl_error = true;
|
||||
|
|
@ -794,6 +797,7 @@ pub fn main() !void {
|
|||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var custom_session_dirs = std.mem.splitScalar(u8, state.config.custom_sessions, ':');
|
||||
while (custom_session_dirs.next()) |dir| {
|
||||
|
|
|
|||
Loading…
Reference in New Issue