mirror of
https://github.com/fairyglade/ly.git
synced 2026-05-06 15:20:36 +00:00
config: add shell option to hide the shell session (#955)
The shell session is unconditionally added to the session list with no way to hide it. This is inconsistent with `xinitrc`, which is omitted from the list when set to `null`. This change adds a `shell` boolean config option (default `true`). Setting it to `false` hides the shell session from the list, following the same pattern as `xinitrc`. Co-authored-by: Jackson Delahunt <jackson@stemn.com> Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/955 Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org> Co-authored-by: Jackson Delahunt <sabrehagen@noreply.codeberg.org> Co-committed-by: Jackson Delahunt <sabrehagen@noreply.codeberg.org>
This commit is contained in:
committed by
AnErrupTion
parent
b8048234d9
commit
eec83179b9
@@ -330,6 +330,10 @@ session_log = .local/state/ly-session.log
|
|||||||
# Setup command
|
# Setup command
|
||||||
setup_cmd = $CONFIG_DIRECTORY/ly/setup.sh
|
setup_cmd = $CONFIG_DIRECTORY/ly/setup.sh
|
||||||
|
|
||||||
|
# Show the shell session in the session list
|
||||||
|
# If false, the shell session will be hidden
|
||||||
|
shell = true
|
||||||
|
|
||||||
# Specifies the key combination used for showing the password
|
# Specifies the key combination used for showing the password
|
||||||
show_password_key = F7
|
show_password_key = F7
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ save: bool = true,
|
|||||||
service_name: [:0]const u8 = "ly",
|
service_name: [:0]const u8 = "ly",
|
||||||
session_log: ?[]const u8 = "ly-session.log",
|
session_log: ?[]const u8 = "ly-session.log",
|
||||||
setup_cmd: []const u8 = build_options.config_directory ++ "/ly/setup.sh",
|
setup_cmd: []const u8 = build_options.config_directory ++ "/ly/setup.sh",
|
||||||
|
shell: bool = true,
|
||||||
show_password_key: []const u8 = "F7",
|
show_password_key: []const u8 = "F7",
|
||||||
show_tty: bool = false,
|
show_tty: bool = false,
|
||||||
shutdown_cmd: []const u8 = "/sbin/shutdown -a now",
|
shutdown_cmd: []const u8 = "/sbin/shutdown -a now",
|
||||||
|
|||||||
26
src/main.zig
26
src/main.zig
@@ -737,18 +737,20 @@ pub fn main() !void {
|
|||||||
try state.buffer.registerKeybind(&state.login.label.keybinds, "H", &viGoLeft, &state);
|
try state.buffer.registerKeybind(&state.login.label.keybinds, "H", &viGoLeft, &state);
|
||||||
try state.buffer.registerKeybind(&state.login.label.keybinds, "L", &viGoRight, &state);
|
try state.buffer.registerKeybind(&state.login.label.keybinds, "L", &viGoRight, &state);
|
||||||
|
|
||||||
addOtherEnvironment(&state.session, state.lang, .shell, null) catch |err| {
|
if (state.config.shell) {
|
||||||
try state.info_line.addMessage(
|
addOtherEnvironment(&state.session, state.lang, .shell, null) catch |err| {
|
||||||
state.lang.err_alloc,
|
try state.info_line.addMessage(
|
||||||
state.config.error_bg,
|
state.lang.err_alloc,
|
||||||
state.config.error_fg,
|
state.config.error_bg,
|
||||||
);
|
state.config.error_fg,
|
||||||
try state.log_file.err(
|
);
|
||||||
"sys",
|
try state.log_file.err(
|
||||||
"failed to add shell environment: {s}",
|
"sys",
|
||||||
.{@errorName(err)},
|
"failed to add shell environment: {s}",
|
||||||
);
|
.{@errorName(err)},
|
||||||
};
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (build_options.enable_x11_support) {
|
if (build_options.enable_x11_support) {
|
||||||
if (state.config.xinitrc) |xinitrc_cmd| {
|
if (state.config.xinitrc) |xinitrc_cmd| {
|
||||||
|
|||||||
Reference in New Issue
Block a user