mirror of https://github.com/fairyglade/ly.git
Merge branch 'master' of codeberg.org:fairyglade/ly
This commit is contained in:
commit
7353e75d78
|
@ -253,7 +253,8 @@ service_name = ly
|
|||
# This will contain stdout and stderr of Wayland sessions
|
||||
# By default it's saved in the user's home directory
|
||||
# Important: due to technical limitations, X11 and shell sessions aren't supported, which
|
||||
# means you won't get any logs from those sessions
|
||||
# means you won't get any logs from those sessions.
|
||||
# If null, no session log will be created
|
||||
session_log = ly-session.log
|
||||
|
||||
# Setup command
|
||||
|
|
13
src/auth.zig
13
src/auth.zig
|
@ -15,7 +15,7 @@ pub const AuthOptions = struct {
|
|||
tty: u8,
|
||||
service_name: [:0]const u8,
|
||||
path: ?[:0]const u8,
|
||||
session_log: []const u8,
|
||||
session_log: ?[]const u8,
|
||||
xauth_cmd: []const u8,
|
||||
setup_cmd: []const u8,
|
||||
login_cmd: ?[]const u8,
|
||||
|
@ -399,8 +399,11 @@ fn executeShellCmd(shell: [*:0]const u8, options: AuthOptions) !void {
|
|||
}
|
||||
|
||||
fn executeWaylandCmd(shell: [*:0]const u8, options: AuthOptions, desktop_cmd: []const u8) !void {
|
||||
const log_file = try redirectStandardStreams(options.session_log, true);
|
||||
defer log_file.close();
|
||||
var maybe_log_file: ?std.fs.File = null;
|
||||
if (options.session_log) |log_path| {
|
||||
maybe_log_file = try redirectStandardStreams(log_path, true);
|
||||
}
|
||||
defer if (maybe_log_file) |log_file| log_file.close();
|
||||
|
||||
var cmd_buffer: [1024]u8 = undefined;
|
||||
const cmd_str = try std.fmt.bufPrintZ(&cmd_buffer, "{s} {s} {s}", .{ options.setup_cmd, options.login_cmd orelse "", desktop_cmd });
|
||||
|
@ -470,7 +473,9 @@ fn executeCustomCmd(shell: [*:0]const u8, options: AuthOptions, is_terminal: boo
|
|||
// For custom desktop entries, the "Terminal" value here determines if
|
||||
// we redirect standard output & error or not. That is, we redirect only
|
||||
// if it's equal to false (so if it's not running in a TTY).
|
||||
maybe_log_file = try redirectStandardStreams(options.session_log, true);
|
||||
if (options.session_log) |log_path| {
|
||||
maybe_log_file = try redirectStandardStreams(log_path, true);
|
||||
}
|
||||
}
|
||||
defer if (maybe_log_file) |log_file| log_file.close();
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ restart_cmd: []const u8 = "/sbin/shutdown -r now",
|
|||
restart_key: []const u8 = "F2",
|
||||
save: bool = true,
|
||||
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",
|
||||
shutdown_cmd: []const u8 = "/sbin/shutdown -a now",
|
||||
shutdown_key: []const u8 = "F1",
|
||||
|
|
Loading…
Reference in New Issue