mirror of
https://github.com/fairyglade/ly.git
synced 2026-02-04 08:24:55 +00:00
Fix wrong session being chosen in autologin (closes #911)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -62,7 +62,7 @@ auto_login_service = ly-autologin
|
||||
# To find available session names, check the .desktop files in:
|
||||
# - /usr/share/xsessions/ (for X11 sessions)
|
||||
# - /usr/share/wayland-sessions/ (for Wayland sessions)
|
||||
# Use the filename without .desktop extension, or the value of DesktopNames field
|
||||
# Use the filename without .desktop extension, the Name field inside the file or the value of the DesktopNames field
|
||||
# Examples: "i3", "sway", "gnome", "plasma", "xfce"
|
||||
# If null, automatic login is disabled
|
||||
auto_login_session = null
|
||||
|
||||
@@ -1300,14 +1300,14 @@ fn isValidUsername(username: []const u8, usernames: StringList) bool {
|
||||
|
||||
fn findSessionByName(session: *Session, name: []const u8) ?usize {
|
||||
for (session.label.list.items, 0..) |env, i| {
|
||||
if (std.ascii.eqlIgnoreCase(env.environment.file_name, name)) return i;
|
||||
if (std.ascii.eqlIgnoreCase(env.environment.name, name)) return i;
|
||||
if (env.environment.xdg_session_desktop) |session_desktop| {
|
||||
if (session_desktop.len > 0 and std.ascii.eqlIgnoreCase(session_desktop, name)) return i;
|
||||
}
|
||||
if (env.environment.xdg_desktop_names) |session_desktop_name| {
|
||||
if (std.ascii.eqlIgnoreCase(session_desktop_name, name)) return i;
|
||||
}
|
||||
if (std.ascii.eqlIgnoreCase(env.environment.name, name)) return i;
|
||||
if (std.ascii.eqlIgnoreCase(env.environment.file_name, name)) return i;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user