diff --git a/res/config.ini b/res/config.ini index 52fb15d..06d6a2f 100644 --- a/res/config.ini +++ b/res/config.ini @@ -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 @@ -200,7 +200,7 @@ fg = 0x00FFFFFF # TB_WHITE 0x0008 # 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. -# 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. full_color = true diff --git a/src/main.zig b/src/main.zig index 2cae9b6..1faae80 100644 --- a/src/main.zig +++ b/src/main.zig @@ -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; }