Remove config.load

config.save already makes it redundant. Besides, who would want
to save the current username & session, but not want to load it
at the next boot?

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2025-08-29 00:32:49 +02:00
parent 6d7dbb9f27
commit 69d39dc035
No known key found for this signature in database
3 changed files with 4 additions and 8 deletions

View File

@ -200,9 +200,6 @@ input_len = 34
# Available languages are found in $CONFIG_DIRECTORY/ly/lang/
lang = en
# Load the saved desktop and username
load = true
# Command executed when logging in
# If null, no command will be executed
# Important: the code itself must end with `exec "$@"` in order to launch the session!
@ -243,7 +240,7 @@ restart_cmd = /sbin/shutdown -r now
# Specifies the key used for restart (F1-F12)
restart_key = F2
# Save the current desktop and login as defaults
# Save the current desktop and login as defaults, and load them on startup
save = true
# Service name (set to ly to use the provided pam config file)

View File

@ -52,7 +52,6 @@ hide_key_hints: bool = false,
initial_info_text: ?[]const u8 = null,
input_len: u8 = 34,
lang: []const u8 = "en",
load: bool = true,
login_cmd: ?[]const u8 = null,
login_defs_path: []const u8 = "/etc/login.defs",
logout_cmd: ?[]const u8 = null,

View File

@ -164,7 +164,7 @@ pub fn main() !void {
.comment_characters = comment_characters,
}) catch Lang{};
if (config.load) {
if (config.save) {
save_path = try std.fmt.allocPrint(allocator, "{s}{s}save.ini", .{ s, trailing_slash });
save_path_alloc = true;
@ -197,7 +197,7 @@ pub fn main() !void {
.comment_characters = comment_characters,
}) catch Lang{};
if (config.load) {
if (config.save) {
var user_buf: [32]u8 = undefined;
save = save_ini.readFileToStruct(save_path, .{
.fieldHandler = null,
@ -383,7 +383,7 @@ pub fn main() !void {
var insert_mode = !config.vi_mode or config.vi_default_mode == .insert;
// Load last saved username and desktop selection, if any
if (config.load) {
if (config.save) {
if (save.user) |user| {
// Find user with saved name, and switch over to it
// If it doesn't exist (anymore), we don't change the value