mirror of https://github.com/fairyglade/ly.git
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:
parent
6d7dbb9f27
commit
69d39dc035
|
|
@ -200,9 +200,6 @@ input_len = 34
|
||||||
# Available languages are found in $CONFIG_DIRECTORY/ly/lang/
|
# Available languages are found in $CONFIG_DIRECTORY/ly/lang/
|
||||||
lang = en
|
lang = en
|
||||||
|
|
||||||
# Load the saved desktop and username
|
|
||||||
load = true
|
|
||||||
|
|
||||||
# Command executed when logging in
|
# Command executed when logging in
|
||||||
# If null, no command will be executed
|
# If null, no command will be executed
|
||||||
# Important: the code itself must end with `exec "$@"` in order to launch the session!
|
# 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)
|
# Specifies the key used for restart (F1-F12)
|
||||||
restart_key = F2
|
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
|
save = true
|
||||||
|
|
||||||
# Service name (set to ly to use the provided pam config file)
|
# Service name (set to ly to use the provided pam config file)
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ hide_key_hints: bool = false,
|
||||||
initial_info_text: ?[]const u8 = null,
|
initial_info_text: ?[]const u8 = null,
|
||||||
input_len: u8 = 34,
|
input_len: u8 = 34,
|
||||||
lang: []const u8 = "en",
|
lang: []const u8 = "en",
|
||||||
load: bool = true,
|
|
||||||
login_cmd: ?[]const u8 = null,
|
login_cmd: ?[]const u8 = null,
|
||||||
login_defs_path: []const u8 = "/etc/login.defs",
|
login_defs_path: []const u8 = "/etc/login.defs",
|
||||||
logout_cmd: ?[]const u8 = null,
|
logout_cmd: ?[]const u8 = null,
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ pub fn main() !void {
|
||||||
.comment_characters = comment_characters,
|
.comment_characters = comment_characters,
|
||||||
}) catch Lang{};
|
}) catch Lang{};
|
||||||
|
|
||||||
if (config.load) {
|
if (config.save) {
|
||||||
save_path = try std.fmt.allocPrint(allocator, "{s}{s}save.ini", .{ s, trailing_slash });
|
save_path = try std.fmt.allocPrint(allocator, "{s}{s}save.ini", .{ s, trailing_slash });
|
||||||
save_path_alloc = true;
|
save_path_alloc = true;
|
||||||
|
|
||||||
|
|
@ -197,7 +197,7 @@ pub fn main() !void {
|
||||||
.comment_characters = comment_characters,
|
.comment_characters = comment_characters,
|
||||||
}) catch Lang{};
|
}) catch Lang{};
|
||||||
|
|
||||||
if (config.load) {
|
if (config.save) {
|
||||||
var user_buf: [32]u8 = undefined;
|
var user_buf: [32]u8 = undefined;
|
||||||
save = save_ini.readFileToStruct(save_path, .{
|
save = save_ini.readFileToStruct(save_path, .{
|
||||||
.fieldHandler = null,
|
.fieldHandler = null,
|
||||||
|
|
@ -383,7 +383,7 @@ pub fn main() !void {
|
||||||
var insert_mode = !config.vi_mode or config.vi_default_mode == .insert;
|
var insert_mode = !config.vi_mode or config.vi_default_mode == .insert;
|
||||||
|
|
||||||
// Load last saved username and desktop selection, if any
|
// Load last saved username and desktop selection, if any
|
||||||
if (config.load) {
|
if (config.save) {
|
||||||
if (save.user) |user| {
|
if (save.user) |user| {
|
||||||
// Find user with saved name, and switch over to it
|
// Find user with saved name, and switch over to it
|
||||||
// If it doesn't exist (anymore), we don't change the value
|
// If it doesn't exist (anymore), we don't change the value
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue