mirror of
https://github.com/fairyglade/ly.git
synced 2026-02-04 00:14: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:
|
# To find available session names, check the .desktop files in:
|
||||||
# - /usr/share/xsessions/ (for X11 sessions)
|
# - /usr/share/xsessions/ (for X11 sessions)
|
||||||
# - /usr/share/wayland-sessions/ (for Wayland 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"
|
# Examples: "i3", "sway", "gnome", "plasma", "xfce"
|
||||||
# If null, automatic login is disabled
|
# If null, automatic login is disabled
|
||||||
auto_login_session = null
|
auto_login_session = null
|
||||||
@@ -200,7 +200,7 @@ fg = 0x00FFFFFF
|
|||||||
# TB_WHITE 0x0008
|
# TB_WHITE 0x0008
|
||||||
# If full color is off, the styling options still work. The colors are
|
# If full color is off, the styling options still work. The colors are
|
||||||
# always 32-bit values with the styling in the most significant byte.
|
# always 32-bit values with the styling in the most significant byte.
|
||||||
# Note: If using the dur_file animation option and the dur file's color range
|
# Note: If using the dur_file animation option and the dur file's color range
|
||||||
# is saved as 256 with this option disabled, the file will not be drawn.
|
# is saved as 256 with this option disabled, the file will not be drawn.
|
||||||
full_color = true
|
full_color = true
|
||||||
|
|
||||||
|
|||||||
@@ -1300,14 +1300,14 @@ fn isValidUsername(username: []const u8, usernames: StringList) bool {
|
|||||||
|
|
||||||
fn findSessionByName(session: *Session, name: []const u8) ?usize {
|
fn findSessionByName(session: *Session, name: []const u8) ?usize {
|
||||||
for (session.label.list.items, 0..) |env, i| {
|
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 (env.environment.xdg_session_desktop) |session_desktop| {
|
||||||
if (session_desktop.len > 0 and std.ascii.eqlIgnoreCase(session_desktop, name)) return i;
|
if (session_desktop.len > 0 and std.ascii.eqlIgnoreCase(session_desktop, name)) return i;
|
||||||
}
|
}
|
||||||
if (env.environment.xdg_desktop_names) |session_desktop_name| {
|
if (env.environment.xdg_desktop_names) |session_desktop_name| {
|
||||||
if (std.ascii.eqlIgnoreCase(session_desktop_name, name)) return i;
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user