mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-19 20:14:19 +02:00
Compare commits
8 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afb1dc62a0 |
||
|
|
efa56ae770 |
||
|
|
2a41391764 |
||
|
|
e0f915d440 |
||
|
|
692ca9f7b5 |
||
|
|
f6c44d5e57 |
||
|
|
1080583233 |
||
|
|
cd426bb3df |
64 changed files with 1668 additions and 3110 deletions
17
.github/ISSUE_TEMPLATE/bug.yml
vendored
17
.github/ISSUE_TEMPLATE/bug.yml
vendored
|
|
@ -11,19 +11,15 @@ body:
|
||||||
options:
|
options:
|
||||||
- label: I have looked for any other duplicate issues
|
- label: I have looked for any other duplicate issues
|
||||||
required: true
|
required: true
|
||||||
- label: I have reproduced the issue with the default config of Ly
|
- label: I have reproduced the issue on a fresh install of my OS & Ly with default settings, except ones I will mention
|
||||||
required: true
|
|
||||||
- label: I have reproduced the issue on a fresh install of Ly **as well as** my OS and my desktop environment/window manager, all with **default settings**, except ones I will mention
|
|
||||||
required: false
|
required: false
|
||||||
- label: I have confirmed this issue also occurs on the latest development version (found in the `master` branch)
|
- label: I have confirmed this issue also occurs on the latest development version (found in the `master` branch)
|
||||||
required: true
|
required: true
|
||||||
- label: I understand that this issue **will** be closed if requirements are not or not properly met
|
|
||||||
required: true
|
|
||||||
- type: input
|
- type: input
|
||||||
id: version
|
id: version
|
||||||
attributes:
|
attributes:
|
||||||
label: Ly version
|
label: Ly version
|
||||||
description: The output of `ly --version`. Please note that only the latest release and the current version in development are supported.
|
description: The output of `ly --version`. Please note that only Ly v1.2.0 and above are supported.
|
||||||
placeholder: 1.1.0-dev.12+2b0301c
|
placeholder: 1.1.0-dev.12+2b0301c
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
@ -45,16 +41,9 @@ body:
|
||||||
id: desktop
|
id: desktop
|
||||||
attributes:
|
attributes:
|
||||||
label: OS + Desktop environment/Window manager
|
label: OS + Desktop environment/Window manager
|
||||||
description: Which operating system and DE (or WM) did you use when observing the problem?
|
description: Which OS and DE (or WM) did you use when observing the problem?
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
|
||||||
id: osimage
|
|
||||||
attributes:
|
|
||||||
label: OS version/snapshot used to reproduce
|
|
||||||
description: Which version (or snapshot if rolling release) of the OS did you use to reproduce the issue? This is only required if you have reproduced the issue on a fresh copy of the OS.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: reproduction
|
id: reproduction
|
||||||
attributes:
|
attributes:
|
||||||
|
|
|
||||||
7
.github/ISSUE_TEMPLATE/feature.yml
vendored
7
.github/ISSUE_TEMPLATE/feature.yml
vendored
|
|
@ -20,10 +20,3 @@ body:
|
||||||
description: What do you want to be added? Describe the behavior clearly.
|
description: What do you want to be added? Describe the behavior clearly.
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
|
||||||
id: alternatives
|
|
||||||
attributes:
|
|
||||||
label: Alternatives
|
|
||||||
description: Are there any alternatives to the new behavior you wish to see being added?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
|
||||||
6
.github/pull_request_template.md
vendored
6
.github/pull_request_template.md
vendored
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
_Replace this with a brief description of your changes_
|
_Replace this with a brief description of your changes_
|
||||||
|
|
||||||
## What existing issue(s) does this resolve?
|
## What existing issue does this resolve?
|
||||||
|
|
||||||
_Replace this with a reference to (an) existing issue(s), or N/A if there is none_
|
_Replace this with a reference to an existing issue, or N/A if there is none_
|
||||||
|
|
||||||
## Pre-requisites
|
## Pre-requisites
|
||||||
|
|
||||||
- [ ] I have tested & confirmed the changes work locally
|
- [ ] I have tested & confirmed the changes work locally
|
||||||
- [ ] I have read and fully adhere to the rules set in the contributing guidelines found in `CONTRIBUTING.md`
|
- [ ] I have run `zig fmt` throughout my changes
|
||||||
|
|
|
||||||
483
build.zig
483
build.zig
|
|
@ -1,6 +1,7 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
|
const PatchMap = std.StringHashMap([]const u8);
|
||||||
const InitSystem = enum {
|
const InitSystem = enum {
|
||||||
systemd,
|
systemd,
|
||||||
openrc,
|
openrc,
|
||||||
|
|
@ -10,12 +11,6 @@ const InitSystem = enum {
|
||||||
sysvinit,
|
sysvinit,
|
||||||
freebsd,
|
freebsd,
|
||||||
};
|
};
|
||||||
const InstallType = enum {
|
|
||||||
installexe,
|
|
||||||
installnoconf,
|
|
||||||
uninstallexe,
|
|
||||||
uninstallnoconf,
|
|
||||||
};
|
|
||||||
|
|
||||||
const min_zig_string = "0.16.0";
|
const min_zig_string = "0.16.0";
|
||||||
const current_zig = builtin.zig_version;
|
const current_zig = builtin.zig_version;
|
||||||
|
|
@ -28,47 +23,21 @@ comptime {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ly_version = std.SemanticVersion{ .major = 1, .minor = 5, .patch = 0 };
|
const ly_version = std.SemanticVersion{ .major = 1, .minor = 4, .patch = 1 };
|
||||||
|
|
||||||
fn InstallStep(
|
var dest_directory: []const u8 = undefined;
|
||||||
b: *std.Build,
|
var config_directory: []const u8 = undefined;
|
||||||
target: std.Build.ResolvedTarget,
|
var prefix_directory: []const u8 = undefined;
|
||||||
comptime install_type: InstallType,
|
var executable_name: []const u8 = undefined;
|
||||||
dest_directory: []const u8,
|
var init_system: InitSystem = undefined;
|
||||||
config_directory: []const u8,
|
var default_tty_str: []const u8 = undefined;
|
||||||
prefix_directory: []const u8,
|
|
||||||
executable_name: []const u8,
|
|
||||||
init_system: InitSystem,
|
|
||||||
default_tty_str: []const u8,
|
|
||||||
) *std.Build.Step.Run {
|
|
||||||
const step = b.addRunArtifact(b.addExecutable(.{
|
|
||||||
.name = "install",
|
|
||||||
.root_module = b.createModule(.{
|
|
||||||
.root_source_file = b.path("install.zig"),
|
|
||||||
.target = target,
|
|
||||||
}),
|
|
||||||
}));
|
|
||||||
step.step.dependOn(b.getInstallStep());
|
|
||||||
|
|
||||||
step.addArgs(&.{
|
|
||||||
std.enums.tagName(InstallType, install_type).?,
|
|
||||||
dest_directory,
|
|
||||||
config_directory,
|
|
||||||
prefix_directory,
|
|
||||||
executable_name,
|
|
||||||
std.enums.tagName(InitSystem, init_system).?,
|
|
||||||
default_tty_str,
|
|
||||||
});
|
|
||||||
|
|
||||||
return step;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
pub fn build(b: *std.Build) !void {
|
||||||
const dest_directory = b.option([]const u8, "dest_directory", "Specify a destination directory for installation") orelse "";
|
dest_directory = b.option([]const u8, "dest_directory", "Specify a destination directory for installation") orelse "";
|
||||||
const config_directory = b.option([]const u8, "config_directory", "Specify a default config directory (default is /etc). This path gets embedded into the binary") orelse "/etc";
|
config_directory = b.option([]const u8, "config_directory", "Specify a default config directory (default is /etc). This path gets embedded into the binary") orelse "/etc";
|
||||||
const prefix_directory = b.option([]const u8, "prefix_directory", "Specify a default prefix directory (default is /usr)") orelse "/usr";
|
prefix_directory = b.option([]const u8, "prefix_directory", "Specify a default prefix directory (default is /usr)") orelse "/usr";
|
||||||
const executable_name = b.option([]const u8, "name", "Specify installed executable file name (default is ly)") orelse "ly";
|
executable_name = b.option([]const u8, "name", "Specify installed executable file name (default is ly)") orelse "ly";
|
||||||
const init_system = b.option(InitSystem, "init_system", "Specify the target init system (default is systemd)") orelse .systemd;
|
init_system = b.option(InitSystem, "init_system", "Specify the target init system (default is systemd)") orelse .systemd;
|
||||||
|
|
||||||
const build_options = b.addOptions();
|
const build_options = b.addOptions();
|
||||||
const version_str = try getVersionStr(b, "ly", ly_version);
|
const version_str = try getVersionStr(b, "ly", ly_version);
|
||||||
|
|
@ -78,7 +47,7 @@ pub fn build(b: *std.Build) !void {
|
||||||
const fallback_uid_min = b.option(std.posix.uid_t, "fallback_uid_min", "Set the fallback minimum UID (default is 1000). This value gets embedded into the binary") orelse 1000;
|
const fallback_uid_min = b.option(std.posix.uid_t, "fallback_uid_min", "Set the fallback minimum UID (default is 1000). This value gets embedded into the binary") orelse 1000;
|
||||||
const fallback_uid_max = b.option(std.posix.uid_t, "fallback_uid_max", "Set the fallback maximum UID (default is 60000). This value gets embedded into the binary") orelse 60000;
|
const fallback_uid_max = b.option(std.posix.uid_t, "fallback_uid_max", "Set the fallback maximum UID (default is 60000). This value gets embedded into the binary") orelse 60000;
|
||||||
|
|
||||||
const default_tty_str = try std.fmt.allocPrint(b.allocator, "{d}", .{default_tty});
|
default_tty_str = try std.fmt.allocPrint(b.allocator, "{d}", .{default_tty});
|
||||||
|
|
||||||
build_options.addOption([]const u8, "config_directory", config_directory);
|
build_options.addOption([]const u8, "config_directory", config_directory);
|
||||||
build_options.addOption([]const u8, "prefix_directory", prefix_directory);
|
build_options.addOption([]const u8, "prefix_directory", prefix_directory);
|
||||||
|
|
@ -100,21 +69,13 @@ pub fn build(b: *std.Build) !void {
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.link_libc = true,
|
.link_libc = true,
|
||||||
}),
|
}),
|
||||||
|
.use_llvm = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const zlua = b.dependency("zlua", .{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
.lang = .luajit,
|
|
||||||
});
|
|
||||||
exe.root_module.addImport("zlua", zlua.module("zlua"));
|
|
||||||
|
|
||||||
const ly_ui = b.dependency("ly_ui", .{
|
const ly_ui = b.dependency("ly_ui", .{
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.enable_x11_support = enable_x11_support,
|
.enable_x11_support = enable_x11_support,
|
||||||
.fallback_uid_min = fallback_uid_min,
|
|
||||||
.fallback_uid_max = fallback_uid_max,
|
|
||||||
});
|
});
|
||||||
exe.root_module.addImport("ly-ui", ly_ui.module("ly-ui"));
|
exe.root_module.addImport("ly-ui", ly_ui.module("ly-ui"));
|
||||||
|
|
||||||
|
|
@ -129,63 +90,293 @@ pub fn build(b: *std.Build) !void {
|
||||||
b.installArtifact(exe);
|
b.installArtifact(exe);
|
||||||
|
|
||||||
const run_cmd = b.addRunArtifact(exe);
|
const run_cmd = b.addRunArtifact(exe);
|
||||||
|
|
||||||
run_cmd.step.dependOn(b.getInstallStep());
|
run_cmd.step.dependOn(b.getInstallStep());
|
||||||
|
|
||||||
if (b.args) |args| run_cmd.addArgs(args);
|
if (b.args) |args| run_cmd.addArgs(args);
|
||||||
|
|
||||||
const run_step = b.step("run", "Run the app");
|
const run_step = b.step("run", "Run the app");
|
||||||
run_step.dependOn(&run_cmd.step);
|
run_step.dependOn(&run_cmd.step);
|
||||||
|
|
||||||
const installexe_step = b.step("installexe", "Install Ly and the selected init system service");
|
const installexe_step = b.step("installexe", "Install Ly and the selected init system service");
|
||||||
installexe_step.dependOn(&InstallStep(
|
installexe_step.makeFn = Installer(true).make;
|
||||||
b,
|
installexe_step.dependOn(b.getInstallStep());
|
||||||
target,
|
|
||||||
.installexe,
|
|
||||||
dest_directory,
|
|
||||||
config_directory,
|
|
||||||
prefix_directory,
|
|
||||||
executable_name,
|
|
||||||
init_system,
|
|
||||||
default_tty_str,
|
|
||||||
).step);
|
|
||||||
|
|
||||||
const installnoconf_step = b.step("installnoconf", "Install Ly and the selected init system service, but not the configuration file");
|
const installnoconf_step = b.step("installnoconf", "Install Ly and the selected init system service, but not the configuration file");
|
||||||
installnoconf_step.dependOn(&InstallStep(
|
installnoconf_step.makeFn = Installer(false).make;
|
||||||
b,
|
installnoconf_step.dependOn(b.getInstallStep());
|
||||||
target,
|
|
||||||
.installnoconf,
|
|
||||||
dest_directory,
|
|
||||||
config_directory,
|
|
||||||
prefix_directory,
|
|
||||||
executable_name,
|
|
||||||
init_system,
|
|
||||||
default_tty_str,
|
|
||||||
).step);
|
|
||||||
|
|
||||||
const uninstallexe_step = b.step("uninstallexe", "Uninstall Ly and remove the selected init system service");
|
const uninstallexe_step = b.step("uninstallexe", "Uninstall Ly and remove the selected init system service");
|
||||||
uninstallexe_step.dependOn(&InstallStep(
|
uninstallexe_step.makeFn = Uninstaller(true).make;
|
||||||
b,
|
|
||||||
target,
|
|
||||||
.uninstallexe,
|
|
||||||
dest_directory,
|
|
||||||
config_directory,
|
|
||||||
prefix_directory,
|
|
||||||
executable_name,
|
|
||||||
init_system,
|
|
||||||
default_tty_str,
|
|
||||||
).step);
|
|
||||||
|
|
||||||
const uninstallnoconf_step = b.step("uninstallnoconf", "Uninstall Ly and remove the selected init system service, but keep the configuration directory");
|
const uninstallnoconf_step = b.step("uninstallnoconf", "Uninstall Ly and remove the selected init system service, but keep the configuration directory");
|
||||||
uninstallnoconf_step.dependOn(&InstallStep(
|
uninstallnoconf_step.makeFn = Uninstaller(false).make;
|
||||||
b,
|
}
|
||||||
target,
|
|
||||||
.uninstallnoconf,
|
pub fn Installer(install_config: bool) type {
|
||||||
dest_directory,
|
return struct {
|
||||||
config_directory,
|
pub fn make(step: *std.Build.Step, _: std.Build.Step.MakeOptions) !void {
|
||||||
prefix_directory,
|
var threaded: std.Io.Threaded = .init_single_threaded;
|
||||||
executable_name,
|
const io = threaded.io();
|
||||||
init_system,
|
const allocator = step.owner.allocator;
|
||||||
default_tty_str,
|
|
||||||
).step);
|
var patch_map = PatchMap.init(allocator);
|
||||||
|
defer patch_map.deinit();
|
||||||
|
|
||||||
|
try patch_map.put("$DEFAULT_TTY", default_tty_str);
|
||||||
|
try patch_map.put("$CONFIG_DIRECTORY", config_directory);
|
||||||
|
try patch_map.put("$PREFIX_DIRECTORY", prefix_directory);
|
||||||
|
try patch_map.put("$EXECUTABLE_NAME", executable_name);
|
||||||
|
|
||||||
|
// The "-a" argument doesn't exist on FreeBSD, so we use "-p"
|
||||||
|
// instead to shutdown the system.
|
||||||
|
try patch_map.put("$PLATFORM_SHUTDOWN_ARG", if (init_system == .freebsd) "-p" else "-a");
|
||||||
|
|
||||||
|
try install_ly(allocator, io, patch_map, install_config);
|
||||||
|
try install_service(allocator, io, patch_map);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
fn install_ly(allocator: std.mem.Allocator, io: std.Io, patch_map: PatchMap, install_config: bool) !void {
|
||||||
|
const ly_config_directory = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/ly" });
|
||||||
|
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, ly_config_directory) catch {
|
||||||
|
std.debug.print("warn: {s} already exists as a directory.\n", .{ly_config_directory});
|
||||||
|
};
|
||||||
|
|
||||||
|
const ly_custom_sessions_directory = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/ly/custom-sessions" });
|
||||||
|
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, ly_custom_sessions_directory) catch {
|
||||||
|
std.debug.print("warn: {s} already exists as a directory.\n", .{ly_custom_sessions_directory});
|
||||||
|
};
|
||||||
|
|
||||||
|
const ly_lang_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/ly/lang" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, ly_lang_path) catch {
|
||||||
|
std.debug.print("warn: {s} already exists as a directory.\n", .{ly_lang_path});
|
||||||
|
};
|
||||||
|
|
||||||
|
{
|
||||||
|
const exe_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix_directory, "/bin" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, exe_path) catch {
|
||||||
|
if (!std.mem.eql(u8, dest_directory, "")) {
|
||||||
|
std.debug.print("warn: {s} already exists as a directory.\n", .{exe_path});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var executable_dir = std.Io.Dir.cwd().openDir(io, exe_path, .{}) catch unreachable;
|
||||||
|
defer executable_dir.close(io);
|
||||||
|
|
||||||
|
try installFile(io, "zig-out/bin/ly", executable_dir, exe_path, executable_name, .{});
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
var config_dir = std.Io.Dir.cwd().openDir(io, ly_config_directory, .{}) catch unreachable;
|
||||||
|
defer config_dir.close(io);
|
||||||
|
|
||||||
|
if (install_config) {
|
||||||
|
const patched_config = try patchFile(allocator, io, "res/config.ini", patch_map);
|
||||||
|
try installText(io, patched_config, config_dir, ly_config_directory, "config.ini", .{});
|
||||||
|
|
||||||
|
try installFile(io, "res/startup.sh", config_dir, ly_config_directory, "startup.sh", .{ .permissions = .fromMode(0o755) });
|
||||||
|
}
|
||||||
|
|
||||||
|
const patched_example_config = try patchFile(allocator, io, "res/config.ini", patch_map);
|
||||||
|
try installText(io, patched_example_config, config_dir, ly_config_directory, "config.ini.example", .{});
|
||||||
|
|
||||||
|
const patched_setup = try patchFile(allocator, io, "res/setup.sh", patch_map);
|
||||||
|
try installText(io, patched_setup, config_dir, ly_config_directory, "setup.sh", .{ .permissions = .fromMode(0o755) });
|
||||||
|
|
||||||
|
try installFile(io, "res/example.dur", config_dir, ly_config_directory, "example.dur", .{ .permissions = .fromMode(0o755) });
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
var custom_sessions_dir = std.Io.Dir.cwd().openDir(io, ly_custom_sessions_directory, .{}) catch unreachable;
|
||||||
|
defer custom_sessions_dir.close(io);
|
||||||
|
|
||||||
|
const patched_readme = try patchFile(allocator, io, "res/custom-sessions/README", patch_map);
|
||||||
|
try installText(io, patched_readme, custom_sessions_dir, ly_custom_sessions_directory, "README", .{});
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
var lang_dir = std.Io.Dir.cwd().openDir(io, ly_lang_path, .{}) catch unreachable;
|
||||||
|
defer lang_dir.close(io);
|
||||||
|
|
||||||
|
const languages = [_][]const u8{
|
||||||
|
"ar.ini",
|
||||||
|
"cat.ini",
|
||||||
|
"cs.ini",
|
||||||
|
"de.ini",
|
||||||
|
"en.ini",
|
||||||
|
"es.ini",
|
||||||
|
"fr.ini",
|
||||||
|
"it.ini",
|
||||||
|
"ja_JP.ini",
|
||||||
|
"lv.ini",
|
||||||
|
"pl.ini",
|
||||||
|
"pt.ini",
|
||||||
|
"pt_BR.ini",
|
||||||
|
"ro.ini",
|
||||||
|
"ru.ini",
|
||||||
|
"sr.ini",
|
||||||
|
"sv.ini",
|
||||||
|
"tr.ini",
|
||||||
|
"uk.ini",
|
||||||
|
"zh_CN.ini",
|
||||||
|
};
|
||||||
|
|
||||||
|
inline for (languages) |language| {
|
||||||
|
try installFile(io, "res/lang/" ++ language, lang_dir, ly_lang_path, language, .{});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const pam_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/pam.d" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, pam_path) catch {
|
||||||
|
if (!std.mem.eql(u8, dest_directory, "")) {
|
||||||
|
std.debug.print("warn: {s} already exists as a directory.\n", .{pam_path});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var pam_dir = std.Io.Dir.cwd().openDir(io, pam_path, .{}) catch unreachable;
|
||||||
|
defer pam_dir.close(io);
|
||||||
|
|
||||||
|
try installFile(io, if (init_system == .freebsd) "res/pam.d/ly-freebsd" else "res/pam.d/ly-linux", pam_dir, pam_path, "ly", .{ .permissions = .fromMode(0o644) });
|
||||||
|
try installFile(io, if (init_system == .freebsd) "res/pam.d/ly-freebsd-autologin" else "res/pam.d/ly-linux-autologin", pam_dir, pam_path, "ly-autologin", .{ .permissions = .fromMode(0o644) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn install_service(allocator: std.mem.Allocator, io: std.Io, patch_map: PatchMap) !void {
|
||||||
|
switch (init_system) {
|
||||||
|
.systemd => {
|
||||||
|
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix_directory, "/lib/systemd/system" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
||||||
|
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
||||||
|
defer service_dir.close(io);
|
||||||
|
|
||||||
|
const patched_service = try patchFile(allocator, io, "res/ly@.service", patch_map);
|
||||||
|
try installText(io, patched_service, service_dir, service_path, "ly@.service", .{ .permissions = .fromMode(0o644) });
|
||||||
|
|
||||||
|
const patched_kmsconvt_service = try patchFile(allocator, io, "res/ly-kmsconvt@.service", patch_map);
|
||||||
|
try installText(io, patched_kmsconvt_service, service_dir, service_path, "ly-kmsconvt@.service", .{ .permissions = .fromMode(0o644) });
|
||||||
|
},
|
||||||
|
.openrc => {
|
||||||
|
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/init.d" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
||||||
|
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
||||||
|
defer service_dir.close(io);
|
||||||
|
|
||||||
|
const patched_service = try patchFile(allocator, io, "res/ly-openrc", patch_map);
|
||||||
|
try installText(io, patched_service, service_dir, service_path, executable_name, .{ .permissions = .fromMode(0o755) });
|
||||||
|
},
|
||||||
|
.runit => {
|
||||||
|
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/sv/ly" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
||||||
|
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
||||||
|
defer service_dir.close(io);
|
||||||
|
|
||||||
|
const supervise_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ service_path, "supervise" });
|
||||||
|
|
||||||
|
const patched_conf = try patchFile(allocator, io, "res/ly-runit-service/conf", patch_map);
|
||||||
|
try installText(io, patched_conf, service_dir, service_path, "conf", .{});
|
||||||
|
|
||||||
|
try installFile(io, "res/ly-runit-service/finish", service_dir, service_path, "finish", .{ .permissions = .fromMode(0o755) });
|
||||||
|
|
||||||
|
const patched_run = try patchFile(allocator, io, "res/ly-runit-service/run", patch_map);
|
||||||
|
try installText(io, patched_run, service_dir, service_path, "run", .{ .permissions = .fromMode(0o755) });
|
||||||
|
|
||||||
|
std.Io.Dir.cwd().symLink(io, "/run/runit/supervise.ly", supervise_path, .{}) catch |err| {
|
||||||
|
if (err == error.PathAlreadyExists) {
|
||||||
|
std.debug.print("warn: /run/runit/supervise.ly already exists as a symbolic link.\n", .{});
|
||||||
|
} else {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
std.debug.print("info: installed symlink /run/runit/supervise.ly\n", .{});
|
||||||
|
},
|
||||||
|
.s6 => {
|
||||||
|
const admin_service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/s6/adminsv/default/contents.d" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, admin_service_path) catch {};
|
||||||
|
var admin_service_dir = std.Io.Dir.cwd().openDir(io, admin_service_path, .{}) catch unreachable;
|
||||||
|
defer admin_service_dir.close(io);
|
||||||
|
|
||||||
|
const file = try admin_service_dir.createFile(io, "ly-srv", .{});
|
||||||
|
file.close(io);
|
||||||
|
|
||||||
|
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/s6/sv/ly-srv" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
||||||
|
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
||||||
|
defer service_dir.close(io);
|
||||||
|
|
||||||
|
const patched_run = try patchFile(allocator, io, "res/ly-s6/run", patch_map);
|
||||||
|
try installText(io, patched_run, service_dir, service_path, "run", .{ .permissions = .fromMode(0o755) });
|
||||||
|
|
||||||
|
try installFile(io, "res/ly-s6/type", service_dir, service_path, "type", .{});
|
||||||
|
},
|
||||||
|
.dinit => {
|
||||||
|
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/dinit.d" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
||||||
|
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
||||||
|
defer service_dir.close(io);
|
||||||
|
|
||||||
|
const patched_service = try patchFile(allocator, io, "res/ly-dinit", patch_map);
|
||||||
|
try installText(io, patched_service, service_dir, service_path, "ly", .{});
|
||||||
|
},
|
||||||
|
.sysvinit => {
|
||||||
|
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/init.d" });
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
||||||
|
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
||||||
|
defer service_dir.close(io);
|
||||||
|
|
||||||
|
const patched_service = try patchFile(allocator, io, "res/ly-sysvinit", patch_map);
|
||||||
|
try installText(io, patched_service, service_dir, service_path, "ly", .{ .permissions = .fromMode(0o755) });
|
||||||
|
},
|
||||||
|
.freebsd => {
|
||||||
|
const exe_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix_directory, "/bin" });
|
||||||
|
var executable_dir = std.Io.Dir.cwd().openDir(io, exe_path, .{}) catch unreachable;
|
||||||
|
defer executable_dir.close(io);
|
||||||
|
|
||||||
|
const patched_wrapper = try patchFile(allocator, io, "res/ly-freebsd-wrapper", patch_map);
|
||||||
|
try installText(io, patched_wrapper, executable_dir, exe_path, "ly_wrapper", .{ .permissions = .fromMode(0o755) });
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn Uninstaller(uninstall_config: bool) type {
|
||||||
|
return struct {
|
||||||
|
pub fn make(step: *std.Build.Step, _: std.Build.Step.MakeOptions) !void {
|
||||||
|
var threaded: std.Io.Threaded = .init_single_threaded;
|
||||||
|
const io = threaded.io();
|
||||||
|
const allocator = step.owner.allocator;
|
||||||
|
|
||||||
|
if (uninstall_config) {
|
||||||
|
try deleteTree(allocator, io, config_directory, "/ly", "ly config directory not found");
|
||||||
|
}
|
||||||
|
|
||||||
|
const exe_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ prefix_directory, "/bin/", executable_name });
|
||||||
|
var success = true;
|
||||||
|
std.Io.Dir.cwd().deleteFile(io, exe_path) catch {
|
||||||
|
std.debug.print("warn: ly executable not found\n", .{});
|
||||||
|
success = false;
|
||||||
|
};
|
||||||
|
if (success) std.debug.print("info: deleted {s}\n", .{exe_path});
|
||||||
|
|
||||||
|
try deleteFile(allocator, io, config_directory, "/pam.d/ly", "ly pam file not found");
|
||||||
|
|
||||||
|
switch (init_system) {
|
||||||
|
.systemd => try deleteFile(allocator, io, prefix_directory, "/lib/systemd/system/ly@.service", "systemd service not found"),
|
||||||
|
.openrc => try deleteFile(allocator, io, config_directory, "/init.d/ly", "openrc service not found"),
|
||||||
|
.runit => try deleteTree(allocator, io, config_directory, "/sv/ly", "runit service not found"),
|
||||||
|
.s6 => {
|
||||||
|
try deleteTree(allocator, io, config_directory, "/s6/sv/ly-srv", "s6 service not found");
|
||||||
|
try deleteFile(allocator, io, config_directory, "/s6/adminsv/default/contents.d/ly-srv", "s6 admin service not found");
|
||||||
|
},
|
||||||
|
.dinit => try deleteFile(allocator, io, config_directory, "/dinit.d/ly", "dinit service not found"),
|
||||||
|
.sysvinit => try deleteFile(allocator, io, config_directory, "/init.d/ly", "sysvinit service not found"),
|
||||||
|
.freebsd => try deleteFile(allocator, io, prefix_directory, "/bin/ly_wrapper", "freebsd wrapper not found"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
fn getVersionStr(b: *std.Build, name: []const u8, version: std.SemanticVersion) ![]const u8 {
|
fn getVersionStr(b: *std.Build, name: []const u8, version: std.SemanticVersion) ![]const u8 {
|
||||||
|
|
@ -242,3 +433,99 @@ fn getVersionStr(b: *std.Build, name: []const u8, version: std.SemanticVersion)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn installFile(
|
||||||
|
io: std.Io,
|
||||||
|
source_file: []const u8,
|
||||||
|
destination_directory: std.Io.Dir,
|
||||||
|
destination_directory_path: []const u8,
|
||||||
|
destination_file: []const u8,
|
||||||
|
options: std.Io.Dir.CopyFileOptions,
|
||||||
|
) !void {
|
||||||
|
try std.Io.Dir.cwd().copyFile(source_file, destination_directory, destination_file, io, options);
|
||||||
|
std.debug.print("info: installed {s}/{s}\n", .{ destination_directory_path, destination_file });
|
||||||
|
}
|
||||||
|
|
||||||
|
fn patchFile(allocator: std.mem.Allocator, io: std.Io, source_file: []const u8, patch_map: PatchMap) ![]const u8 {
|
||||||
|
var file = try std.Io.Dir.cwd().openFile(io, source_file, .{});
|
||||||
|
defer file.close(io);
|
||||||
|
|
||||||
|
const stat = try file.stat(io);
|
||||||
|
|
||||||
|
var buffer: [4096]u8 = undefined;
|
||||||
|
var reader = file.reader(io, &buffer);
|
||||||
|
var text = try reader.interface.readAlloc(allocator, @intCast(stat.size));
|
||||||
|
|
||||||
|
var iterator = patch_map.iterator();
|
||||||
|
while (iterator.next()) |kv| {
|
||||||
|
const new_text = try std.mem.replaceOwned(u8, allocator, text, kv.key_ptr.*, kv.value_ptr.*);
|
||||||
|
allocator.free(text);
|
||||||
|
text = new_text;
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn installText(
|
||||||
|
io: std.Io,
|
||||||
|
text: []const u8,
|
||||||
|
destination_directory: std.Io.Dir,
|
||||||
|
destination_directory_path: []const u8,
|
||||||
|
destination_file: []const u8,
|
||||||
|
options: std.Io.File.CreateFlags,
|
||||||
|
) !void {
|
||||||
|
var file = try destination_directory.createFile(io, destination_file, options);
|
||||||
|
defer file.close(io);
|
||||||
|
|
||||||
|
var buffer: [1024]u8 = undefined;
|
||||||
|
var writer = file.writer(io, &buffer);
|
||||||
|
try writer.interface.writeAll(text);
|
||||||
|
try writer.interface.flush();
|
||||||
|
|
||||||
|
std.debug.print("info: installed {s}/{s}\n", .{ destination_directory_path, destination_file });
|
||||||
|
}
|
||||||
|
|
||||||
|
fn deleteFile(
|
||||||
|
allocator: std.mem.Allocator,
|
||||||
|
io: std.Io,
|
||||||
|
prefix: []const u8,
|
||||||
|
file: []const u8,
|
||||||
|
warning: []const u8,
|
||||||
|
) !void {
|
||||||
|
const path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix, file });
|
||||||
|
|
||||||
|
std.Io.Dir.cwd().deleteFile(io, path) catch |err| {
|
||||||
|
if (err == error.FileNotFound) {
|
||||||
|
std.debug.print("warn: {s}\n", .{warning});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
|
};
|
||||||
|
|
||||||
|
std.debug.print("info: deleted {s}\n", .{path});
|
||||||
|
}
|
||||||
|
|
||||||
|
fn deleteTree(
|
||||||
|
allocator: std.mem.Allocator,
|
||||||
|
io: std.Io,
|
||||||
|
prefix: []const u8,
|
||||||
|
directory: []const u8,
|
||||||
|
warning: []const u8,
|
||||||
|
) !void {
|
||||||
|
const path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix, directory });
|
||||||
|
|
||||||
|
var dir = std.Io.Dir.cwd().openDir(io, path, .{}) catch |err| {
|
||||||
|
if (err == error.FileNotFound) {
|
||||||
|
std.debug.print("warn: {s}\n", .{warning});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
|
};
|
||||||
|
dir.close(io);
|
||||||
|
|
||||||
|
try std.Io.Dir.cwd().deleteTree(io, path);
|
||||||
|
|
||||||
|
std.debug.print("info: deleted {s}\n", .{path});
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
.{
|
.{
|
||||||
.name = .ly,
|
.name = .ly,
|
||||||
.version = "1.5.0",
|
.version = "1.4.1",
|
||||||
.fingerprint = 0xa148ffcc5dc2cb59,
|
.fingerprint = 0xa148ffcc5dc2cb59,
|
||||||
.minimum_zig_version = "0.16.0",
|
.minimum_zig_version = "0.16.0",
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
|
|
@ -11,10 +11,6 @@
|
||||||
.url = "git+https://github.com/Hejsil/zig-clap#fc1e5cc3f6d9d3001112385ee6256d694e959d2f",
|
.url = "git+https://github.com/Hejsil/zig-clap#fc1e5cc3f6d9d3001112385ee6256d694e959d2f",
|
||||||
.hash = "clap-0.11.0-oBajB7foAQC3Iyn4IVCkUdYaOVVng5IZkSncySTjNig1",
|
.hash = "clap-0.11.0-oBajB7foAQC3Iyn4IVCkUdYaOVVng5IZkSncySTjNig1",
|
||||||
},
|
},
|
||||||
.zlua = .{
|
|
||||||
.url = "git+https://github.com/natecraddock/ziglua?ref=zig-0.16#8f271c82baa5fc43aa02a72f6da020c2025d9436",
|
|
||||||
.hash = "zlua-0.1.0-hGRpC2aABQD4D9PBVH3wAW8k32-I4969MRQ0CpOwoley",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
.paths = .{
|
.paths = .{
|
||||||
"build.zig",
|
"build.zig",
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
# Contributing to Ly
|
|
||||||
|
|
||||||
To contribute to Ly, you have to open a pull request on [Codeberg](https://codeberg.org/fairyglade/ly), as [GitHub](https://github.com/fairyglade/ly) is just a mirror. However, you also have to respect the following rules, otherwise your PR may end up being rejected:
|
|
||||||
|
|
||||||
## AI usage
|
|
||||||
|
|
||||||
While we cannot control your usage of any LLM whatsoever, we do heavily discourage their use for environmental, ethical & moral reasons that you can learn more about on the Internet. However, if you do end up still using them, here are a couple rules you **must absolutely** respect for your PR not to get instantly shot down. Of course, it goes without saying that **all** the other rules in the other sections below **must** be adhered to, even more so when AI is used.
|
|
||||||
|
|
||||||
1. **Communicate through you**, not the AI; as in, responses to reviews or other comments in the PR must be written by you and not an LLM. If English isn't your native language and you have a lot of trouble speaking it, you _may_ use AI, but responses must not be your typical, alienating AI-generated text: https://github.com/realrossmanngroup/no_ai_slop_writing_rules
|
|
||||||
2. Control the code, as in, **don't vibecode**, especially if you don't know Zig. Don't waste the maintainers's time, and **heavily test your code**, as AI-generated code is typically more error-prone in subtle ways (even if they can be better than humans in some other aspects). Finally, don't generate any "summary" or whatever the AI may come up with during the process. **If you cannot understand the generated code, do not contribute it**. Maintainers are busy and are often simple volunteers, so the less work they have to do, the better.
|
|
||||||
3. **Be transparent about AI usage**. Precise what AI model was used in the process, and preferably, how you went about creating your changes (i.e. how did you use AI to make the pull request). The more honest you are about it, the more likely your PR will be accepted and merged into the code base.
|
|
||||||
|
|
||||||
If all the above rules are respected, your changes have much more likely to be accepted into the code base.
|
|
||||||
|
|
||||||
## Code style
|
|
||||||
|
|
||||||
You must follow Zig's [style guide](https://ziglang.org/documentation/master/#Style-Guide). In most cases, all you'll have to do is run `zig fmt` after you have completed your changes, though it does not fix everything, notably variable, function & field naming, as well as the maximum length of aline.
|
|
||||||
|
|
||||||
For the former, please refer to the aforementioned style guide in that case. For the latter, you must respect a maximum line length of **80 characters**. For function calls with many parameters or anything similar that may overflow this limit, consider adding a trailing comma to the list so that `zig fmt` can split it into multiple lines. Ideally, few or no lines end up having to get soft wrapped by an editor having this limit set.
|
|
||||||
|
|
||||||
## Commit names & descriptions
|
|
||||||
|
|
||||||
1. **Commit names must be descriptive**, resorting to the commit description if they are too long. In such cases, the commit name **must** be shortened while still making sense. With that said, no particular convention (emojis, prefixes & suffixes, etc.) is mandated for them, and you are free to adopt any one you think is best or that you are used to.
|
|
||||||
2. **Do not force push**, as PRs will get squashed into a single commit anyway. This erases history and makes it impossible to see the changes done over time and by a particular commit.
|
|
||||||
3. While not a requirement per se, **consider signing your commits** with an SSH or GPG key for security purposes. This ensures to a lesser extent that you are the person who you claim to be, and reduces the potential amount of malicious contributions that could infiltrate the code base.
|
|
||||||
|
|
||||||
## Additional requirements
|
|
||||||
|
|
||||||
Other requirements (such as testing your code) for merging the changes will be available when you open your pull request via the template (which you **must** use), however, these are not stated here because they may not be mandatory in some cases (e.g. if the changes are still work-in-progress), so they may temporarily be ommitted for a certain period of time until the changes are fully ready to be reviewed, for instance.
|
|
||||||
445
install.zig
445
install.zig
|
|
@ -1,445 +0,0 @@
|
||||||
const std = @import("std");
|
|
||||||
|
|
||||||
const PatchMap = std.StringHashMap([]const u8);
|
|
||||||
const InitSystem = enum {
|
|
||||||
systemd,
|
|
||||||
openrc,
|
|
||||||
runit,
|
|
||||||
s6,
|
|
||||||
dinit,
|
|
||||||
sysvinit,
|
|
||||||
freebsd,
|
|
||||||
};
|
|
||||||
const InstallType = enum {
|
|
||||||
installexe,
|
|
||||||
installnoconf,
|
|
||||||
uninstallexe,
|
|
||||||
uninstallnoconf,
|
|
||||||
};
|
|
||||||
|
|
||||||
var dest_directory: []const u8 = undefined;
|
|
||||||
var config_directory: []const u8 = undefined;
|
|
||||||
var prefix_directory: []const u8 = undefined;
|
|
||||||
var executable_name: []const u8 = undefined;
|
|
||||||
var init_system: InitSystem = undefined;
|
|
||||||
|
|
||||||
pub fn main(init: std.process.Init) !void {
|
|
||||||
const io = init.io;
|
|
||||||
const allocator = init.gpa;
|
|
||||||
|
|
||||||
var args = init.minimal.args.iterate();
|
|
||||||
if (!args.skip()) return error.NoProgramName;
|
|
||||||
|
|
||||||
const install_type = std.meta.stringToEnum(InstallType, args.next().?).?;
|
|
||||||
dest_directory = args.next().?;
|
|
||||||
config_directory = args.next().?;
|
|
||||||
prefix_directory = args.next().?;
|
|
||||||
executable_name = args.next().?;
|
|
||||||
init_system = std.meta.stringToEnum(InitSystem, args.next().?).?;
|
|
||||||
const default_tty_str = args.next().?;
|
|
||||||
|
|
||||||
switch (install_type) {
|
|
||||||
.installexe, .installnoconf => {
|
|
||||||
var patch_map = PatchMap.init(allocator);
|
|
||||||
defer patch_map.deinit();
|
|
||||||
|
|
||||||
try patch_map.put("$DEFAULT_TTY", default_tty_str);
|
|
||||||
try patch_map.put("$CONFIG_DIRECTORY", config_directory);
|
|
||||||
try patch_map.put("$PREFIX_DIRECTORY", prefix_directory);
|
|
||||||
try patch_map.put("$EXECUTABLE_NAME", executable_name);
|
|
||||||
|
|
||||||
try installLy(allocator, io, patch_map, install_type == .installexe);
|
|
||||||
try installService(allocator, io, patch_map);
|
|
||||||
},
|
|
||||||
.uninstallexe, .uninstallnoconf => {
|
|
||||||
if (install_type == .uninstallexe) {
|
|
||||||
try deleteTree(allocator, io, config_directory, "/ly", "ly config directory not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
const exe_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ prefix_directory, "/bin/", executable_name });
|
|
||||||
defer allocator.free(exe_path);
|
|
||||||
|
|
||||||
var success = true;
|
|
||||||
std.Io.Dir.cwd().deleteFile(io, exe_path) catch {
|
|
||||||
std.debug.print("warn: ly executable not found\n", .{});
|
|
||||||
success = false;
|
|
||||||
};
|
|
||||||
if (success) std.debug.print("info: deleted {s}\n", .{exe_path});
|
|
||||||
|
|
||||||
try deleteFile(allocator, io, config_directory, "/pam.d/ly", "ly pam file not found");
|
|
||||||
|
|
||||||
switch (init_system) {
|
|
||||||
.systemd => try deleteFile(allocator, io, prefix_directory, "/lib/systemd/system/ly@.service", "systemd service not found"),
|
|
||||||
.openrc => try deleteFile(allocator, io, config_directory, "/init.d/ly", "openrc service not found"),
|
|
||||||
.runit => try deleteTree(allocator, io, config_directory, "/sv/ly", "runit service not found"),
|
|
||||||
.s6 => {
|
|
||||||
try deleteTree(allocator, io, config_directory, "/s6/sv/ly-srv", "s6 service not found");
|
|
||||||
try deleteFile(allocator, io, config_directory, "/s6/adminsv/default/contents.d/ly-srv", "s6 admin service not found");
|
|
||||||
},
|
|
||||||
.dinit => try deleteFile(allocator, io, config_directory, "/dinit.d/ly", "dinit service not found"),
|
|
||||||
.sysvinit => try deleteFile(allocator, io, config_directory, "/init.d/ly", "sysvinit service not found"),
|
|
||||||
.freebsd => try deleteFile(allocator, io, prefix_directory, "/bin/ly_wrapper", "freebsd wrapper not found"),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn installLy(allocator: std.mem.Allocator, io: std.Io, patch_map: PatchMap, install_config: bool) !void {
|
|
||||||
const ly_config_directory = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/ly" });
|
|
||||||
defer allocator.free(ly_config_directory);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, ly_config_directory) catch {
|
|
||||||
std.debug.print("warn: {s} already exists as a directory.\n", .{ly_config_directory});
|
|
||||||
};
|
|
||||||
|
|
||||||
const ly_custom_sessions_directory = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/ly/custom-sessions" });
|
|
||||||
defer allocator.free(ly_custom_sessions_directory);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, ly_custom_sessions_directory) catch {
|
|
||||||
std.debug.print("warn: {s} already exists as a directory.\n", .{ly_custom_sessions_directory});
|
|
||||||
};
|
|
||||||
|
|
||||||
const ly_lang_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/ly/lang" });
|
|
||||||
defer allocator.free(ly_lang_path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, ly_lang_path) catch {
|
|
||||||
std.debug.print("warn: {s} already exists as a directory.\n", .{ly_lang_path});
|
|
||||||
};
|
|
||||||
|
|
||||||
{
|
|
||||||
const exe_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix_directory, "/bin" });
|
|
||||||
defer allocator.free(exe_path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, exe_path) catch {
|
|
||||||
if (!std.mem.eql(u8, dest_directory, "")) {
|
|
||||||
std.debug.print("warn: {s} already exists as a directory.\n", .{exe_path});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var executable_dir = std.Io.Dir.cwd().openDir(io, exe_path, .{}) catch unreachable;
|
|
||||||
defer executable_dir.close(io);
|
|
||||||
|
|
||||||
try installFile(io, "zig-out/bin/ly", executable_dir, exe_path, executable_name, .{});
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
var config_dir = std.Io.Dir.cwd().openDir(io, ly_config_directory, .{}) catch unreachable;
|
|
||||||
defer config_dir.close(io);
|
|
||||||
|
|
||||||
if (install_config) {
|
|
||||||
const patched_config = try patchFile(allocator, io, "res/config.ini", patch_map);
|
|
||||||
defer allocator.free(patched_config);
|
|
||||||
|
|
||||||
try installText(io, patched_config, config_dir, ly_config_directory, "config.ini", .{});
|
|
||||||
|
|
||||||
try installFile(io, "res/startup.sh", config_dir, ly_config_directory, "startup.sh", .{ .permissions = .fromMode(0o755) });
|
|
||||||
}
|
|
||||||
|
|
||||||
const patched_example_config = try patchFile(allocator, io, "res/config.ini", patch_map);
|
|
||||||
defer allocator.free(patched_example_config);
|
|
||||||
|
|
||||||
try installText(io, patched_example_config, config_dir, ly_config_directory, "config.ini.example", .{});
|
|
||||||
|
|
||||||
const patched_setup = try patchFile(allocator, io, "res/setup.sh", patch_map);
|
|
||||||
defer allocator.free(patched_setup);
|
|
||||||
|
|
||||||
try installText(io, patched_setup, config_dir, ly_config_directory, "setup.sh", .{ .permissions = .fromMode(0o755) });
|
|
||||||
|
|
||||||
try installFile(io, "res/example.dur", config_dir, ly_config_directory, "example.dur", .{ .permissions = .fromMode(0o755) });
|
|
||||||
|
|
||||||
try installFile(io, "res/example.lua", config_dir, ly_config_directory, "example.lua", .{ .permissions = .fromMode(0o755) });
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
var custom_sessions_dir = std.Io.Dir.cwd().openDir(io, ly_custom_sessions_directory, .{}) catch unreachable;
|
|
||||||
defer custom_sessions_dir.close(io);
|
|
||||||
|
|
||||||
const patched_readme = try patchFile(allocator, io, "res/custom-sessions/README", patch_map);
|
|
||||||
defer allocator.free(patched_readme);
|
|
||||||
|
|
||||||
try installText(io, patched_readme, custom_sessions_dir, ly_custom_sessions_directory, "README", .{});
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
var lang_dir = std.Io.Dir.cwd().openDir(io, ly_lang_path, .{}) catch unreachable;
|
|
||||||
defer lang_dir.close(io);
|
|
||||||
|
|
||||||
const languages = [_][]const u8{
|
|
||||||
"ar.ini",
|
|
||||||
"bg.ini",
|
|
||||||
"cat.ini",
|
|
||||||
"cs.ini",
|
|
||||||
"de.ini",
|
|
||||||
"en.ini",
|
|
||||||
"eo.ini",
|
|
||||||
"es.ini",
|
|
||||||
"fr.ini",
|
|
||||||
"it.ini",
|
|
||||||
"ja_JP.ini",
|
|
||||||
"ku.ini",
|
|
||||||
"lv.ini",
|
|
||||||
"pl.ini",
|
|
||||||
"pt.ini",
|
|
||||||
"pt_BR.ini",
|
|
||||||
"ro.ini",
|
|
||||||
"ru.ini",
|
|
||||||
"sr.ini",
|
|
||||||
"sr_Cyrl.ini",
|
|
||||||
"sv.ini",
|
|
||||||
"tr.ini",
|
|
||||||
"uk.ini",
|
|
||||||
"zh_CN.ini",
|
|
||||||
"zh_TW.ini",
|
|
||||||
};
|
|
||||||
|
|
||||||
inline for (languages) |language| {
|
|
||||||
try installFile(io, "res/lang/" ++ language, lang_dir, ly_lang_path, language, .{});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
const pam_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/pam.d" });
|
|
||||||
defer allocator.free(pam_path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, pam_path) catch {
|
|
||||||
if (!std.mem.eql(u8, dest_directory, "")) {
|
|
||||||
std.debug.print("warn: {s} already exists as a directory.\n", .{pam_path});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var pam_dir = std.Io.Dir.cwd().openDir(io, pam_path, .{}) catch unreachable;
|
|
||||||
defer pam_dir.close(io);
|
|
||||||
|
|
||||||
try installFile(io, if (init_system == .freebsd) "res/pam.d/ly-freebsd" else "res/pam.d/ly-linux", pam_dir, pam_path, "ly", .{ .permissions = .fromMode(0o644) });
|
|
||||||
try installFile(io, if (init_system == .freebsd) "res/pam.d/ly-freebsd-autologin" else "res/pam.d/ly-linux-autologin", pam_dir, pam_path, "ly-autologin", .{ .permissions = .fromMode(0o644) });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn installService(allocator: std.mem.Allocator, io: std.Io, patch_map: PatchMap) !void {
|
|
||||||
switch (init_system) {
|
|
||||||
.systemd => {
|
|
||||||
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix_directory, "/lib/systemd/system" });
|
|
||||||
defer allocator.free(service_path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
|
||||||
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
|
||||||
defer service_dir.close(io);
|
|
||||||
|
|
||||||
const patched_service = try patchFile(allocator, io, "res/ly@.service", patch_map);
|
|
||||||
defer allocator.free(patched_service);
|
|
||||||
|
|
||||||
try installText(io, patched_service, service_dir, service_path, "ly@.service", .{ .permissions = .fromMode(0o644) });
|
|
||||||
|
|
||||||
const patched_kmsconvt_service = try patchFile(allocator, io, "res/ly-kmsconvt@.service", patch_map);
|
|
||||||
defer allocator.free(patched_kmsconvt_service);
|
|
||||||
|
|
||||||
try installText(io, patched_kmsconvt_service, service_dir, service_path, "ly-kmsconvt@.service", .{ .permissions = .fromMode(0o644) });
|
|
||||||
},
|
|
||||||
.openrc => {
|
|
||||||
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/init.d" });
|
|
||||||
defer allocator.free(service_path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
|
||||||
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
|
||||||
defer service_dir.close(io);
|
|
||||||
|
|
||||||
const patched_service = try patchFile(allocator, io, "res/ly-openrc", patch_map);
|
|
||||||
defer allocator.free(patched_service);
|
|
||||||
|
|
||||||
try installText(io, patched_service, service_dir, service_path, executable_name, .{ .permissions = .fromMode(0o755) });
|
|
||||||
},
|
|
||||||
.runit => {
|
|
||||||
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/sv/ly" });
|
|
||||||
defer allocator.free(service_path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
|
||||||
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
|
||||||
defer service_dir.close(io);
|
|
||||||
|
|
||||||
const supervise_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ service_path, "supervise" });
|
|
||||||
defer allocator.free(supervise_path);
|
|
||||||
|
|
||||||
const patched_conf = try patchFile(allocator, io, "res/ly-runit-service/conf", patch_map);
|
|
||||||
defer allocator.free(patched_conf);
|
|
||||||
|
|
||||||
try installText(io, patched_conf, service_dir, service_path, "conf", .{});
|
|
||||||
|
|
||||||
try installFile(io, "res/ly-runit-service/finish", service_dir, service_path, "finish", .{ .permissions = .fromMode(0o755) });
|
|
||||||
|
|
||||||
const patched_run = try patchFile(allocator, io, "res/ly-runit-service/run", patch_map);
|
|
||||||
defer allocator.free(patched_run);
|
|
||||||
|
|
||||||
try installText(io, patched_run, service_dir, service_path, "run", .{ .permissions = .fromMode(0o755) });
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().symLink(io, "/run/runit/supervise.ly", supervise_path, .{}) catch |err| {
|
|
||||||
if (err == error.PathAlreadyExists) {
|
|
||||||
std.debug.print("warn: /run/runit/supervise.ly already exists as a symbolic link.\n", .{});
|
|
||||||
} else {
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
std.debug.print("info: installed symlink /run/runit/supervise.ly\n", .{});
|
|
||||||
},
|
|
||||||
.s6 => {
|
|
||||||
const admin_service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/s6/adminsv/default/contents.d" });
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, admin_service_path) catch {};
|
|
||||||
defer allocator.free(admin_service_path);
|
|
||||||
|
|
||||||
var admin_service_dir = std.Io.Dir.cwd().openDir(io, admin_service_path, .{}) catch unreachable;
|
|
||||||
defer admin_service_dir.close(io);
|
|
||||||
|
|
||||||
const file = try admin_service_dir.createFile(io, "ly-srv", .{});
|
|
||||||
file.close(io);
|
|
||||||
|
|
||||||
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/s6/sv/ly-srv" });
|
|
||||||
defer allocator.free(service_path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
|
||||||
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
|
||||||
defer service_dir.close(io);
|
|
||||||
|
|
||||||
const patched_run = try patchFile(allocator, io, "res/ly-s6/run", patch_map);
|
|
||||||
defer allocator.free(patched_run);
|
|
||||||
|
|
||||||
try installText(io, patched_run, service_dir, service_path, "run", .{ .permissions = .fromMode(0o755) });
|
|
||||||
|
|
||||||
try installFile(io, "res/ly-s6/type", service_dir, service_path, "type", .{});
|
|
||||||
},
|
|
||||||
.dinit => {
|
|
||||||
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/dinit.d" });
|
|
||||||
defer allocator.free(service_path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
|
||||||
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
|
||||||
defer service_dir.close(io);
|
|
||||||
|
|
||||||
const patched_service = try patchFile(allocator, io, "res/ly-dinit", patch_map);
|
|
||||||
defer allocator.free(patched_service);
|
|
||||||
|
|
||||||
try installText(io, patched_service, service_dir, service_path, "ly", .{});
|
|
||||||
},
|
|
||||||
.sysvinit => {
|
|
||||||
const service_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/init.d" });
|
|
||||||
defer allocator.free(service_path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, service_path) catch {};
|
|
||||||
var service_dir = std.Io.Dir.cwd().openDir(io, service_path, .{}) catch unreachable;
|
|
||||||
defer service_dir.close(io);
|
|
||||||
|
|
||||||
const patched_service = try patchFile(allocator, io, "res/ly-sysvinit", patch_map);
|
|
||||||
defer allocator.free(patched_service);
|
|
||||||
|
|
||||||
try installText(io, patched_service, service_dir, service_path, "ly", .{ .permissions = .fromMode(0o755) });
|
|
||||||
},
|
|
||||||
.freebsd => {
|
|
||||||
const exe_path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix_directory, "/bin" });
|
|
||||||
defer allocator.free(exe_path);
|
|
||||||
|
|
||||||
var executable_dir = std.Io.Dir.cwd().openDir(io, exe_path, .{}) catch unreachable;
|
|
||||||
defer executable_dir.close(io);
|
|
||||||
|
|
||||||
const patched_wrapper = try patchFile(allocator, io, "res/ly-freebsd-wrapper", patch_map);
|
|
||||||
defer allocator.free(patched_wrapper);
|
|
||||||
|
|
||||||
try installText(io, patched_wrapper, executable_dir, exe_path, "ly_wrapper", .{ .permissions = .fromMode(0o755) });
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn installFile(
|
|
||||||
io: std.Io,
|
|
||||||
source_file: []const u8,
|
|
||||||
destination_directory: std.Io.Dir,
|
|
||||||
destination_directory_path: []const u8,
|
|
||||||
destination_file: []const u8,
|
|
||||||
options: std.Io.Dir.CopyFileOptions,
|
|
||||||
) !void {
|
|
||||||
try std.Io.Dir.cwd().copyFile(source_file, destination_directory, destination_file, io, options);
|
|
||||||
std.debug.print("info: installed {s}/{s}\n", .{ destination_directory_path, destination_file });
|
|
||||||
}
|
|
||||||
|
|
||||||
fn patchFile(allocator: std.mem.Allocator, io: std.Io, source_file: []const u8, patch_map: PatchMap) ![]const u8 {
|
|
||||||
var file = try std.Io.Dir.cwd().openFile(io, source_file, .{});
|
|
||||||
defer file.close(io);
|
|
||||||
|
|
||||||
const stat = try file.stat(io);
|
|
||||||
|
|
||||||
var buffer: [4096]u8 = undefined;
|
|
||||||
var reader = file.reader(io, &buffer);
|
|
||||||
var text = try reader.interface.readAlloc(allocator, @intCast(stat.size));
|
|
||||||
|
|
||||||
var iterator = patch_map.iterator();
|
|
||||||
while (iterator.next()) |kv| {
|
|
||||||
const new_text = try std.mem.replaceOwned(u8, allocator, text, kv.key_ptr.*, kv.value_ptr.*);
|
|
||||||
allocator.free(text);
|
|
||||||
text = new_text;
|
|
||||||
}
|
|
||||||
|
|
||||||
return text;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn installText(
|
|
||||||
io: std.Io,
|
|
||||||
text: []const u8,
|
|
||||||
destination_directory: std.Io.Dir,
|
|
||||||
destination_directory_path: []const u8,
|
|
||||||
destination_file: []const u8,
|
|
||||||
options: std.Io.File.CreateFlags,
|
|
||||||
) !void {
|
|
||||||
var file = try destination_directory.createFile(io, destination_file, options);
|
|
||||||
defer file.close(io);
|
|
||||||
|
|
||||||
var buffer: [1024]u8 = undefined;
|
|
||||||
var writer = file.writer(io, &buffer);
|
|
||||||
try writer.interface.writeAll(text);
|
|
||||||
try writer.interface.flush();
|
|
||||||
|
|
||||||
std.debug.print("info: installed {s}/{s}\n", .{ destination_directory_path, destination_file });
|
|
||||||
}
|
|
||||||
|
|
||||||
fn deleteFile(
|
|
||||||
allocator: std.mem.Allocator,
|
|
||||||
io: std.Io,
|
|
||||||
prefix: []const u8,
|
|
||||||
file: []const u8,
|
|
||||||
warning: []const u8,
|
|
||||||
) !void {
|
|
||||||
const path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix, file });
|
|
||||||
defer allocator.free(path);
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().deleteFile(io, path) catch |err| {
|
|
||||||
if (err == error.FileNotFound) {
|
|
||||||
std.debug.print("warn: {s}\n", .{warning});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return err;
|
|
||||||
};
|
|
||||||
|
|
||||||
std.debug.print("info: deleted {s}\n", .{path});
|
|
||||||
}
|
|
||||||
|
|
||||||
fn deleteTree(
|
|
||||||
allocator: std.mem.Allocator,
|
|
||||||
io: std.Io,
|
|
||||||
prefix: []const u8,
|
|
||||||
directory: []const u8,
|
|
||||||
warning: []const u8,
|
|
||||||
) !void {
|
|
||||||
const path = try std.Io.Dir.path.join(allocator, &[_][]const u8{ dest_directory, prefix, directory });
|
|
||||||
defer allocator.free(path);
|
|
||||||
|
|
||||||
var dir = std.Io.Dir.cwd().openDir(io, path, .{}) catch |err| {
|
|
||||||
if (err == error.FileNotFound) {
|
|
||||||
std.debug.print("warn: {s}\n", .{warning});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return err;
|
|
||||||
};
|
|
||||||
dir.close(io);
|
|
||||||
|
|
||||||
try std.Io.Dir.cwd().deleteTree(io, path);
|
|
||||||
|
|
||||||
std.debug.print("info: deleted {s}\n", .{path});
|
|
||||||
}
|
|
||||||
|
|
@ -11,18 +11,12 @@ pub fn build(b: *std.Build) void {
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
const fallback_uid_min = b.option(std.posix.uid_t, "fallback_uid_min", "Set the fallback minimum UID (default is 1000). This value gets embedded into the binary").?;
|
|
||||||
const fallback_uid_max = b.option(std.posix.uid_t, "fallback_uid_max", "Set the fallback maximum UID (default is 60000). This value gets embedded into the binary").?;
|
|
||||||
const build_options = b.addOptions();
|
|
||||||
build_options.addOption(std.posix.uid_t, "fallback_uid_min", fallback_uid_min);
|
|
||||||
build_options.addOption(std.posix.uid_t, "fallback_uid_max", fallback_uid_max);
|
|
||||||
mod.addOptions("build_options", build_options);
|
|
||||||
|
|
||||||
const zigini = b.dependency("zigini", .{ .target = target, .optimize = optimize });
|
const zigini = b.dependency("zigini", .{ .target = target, .optimize = optimize });
|
||||||
mod.addImport("zigini", zigini.module("zigini"));
|
mod.addImport("zigini", zigini.module("zigini"));
|
||||||
|
|
||||||
const translate_c = b.dependency("translate_c", .{
|
const translate_c = b.dependency("translate_c", .{
|
||||||
.target = target,
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
addCImport(b, mod, translate_c, target, optimize, "pam", "#include <security/pam_appl.h>");
|
addCImport(b, mod, translate_c, target, optimize, "pam", "#include <security/pam_appl.h>");
|
||||||
|
|
@ -51,8 +45,6 @@ pub fn build(b: *std.Build) void {
|
||||||
} else if (target.result.os.tag == .freebsd) {
|
} else if (target.result.os.tag == .freebsd) {
|
||||||
addCImport(b, mod, translate_c, target, optimize, "kbio", "#include <sys/kbio.h>");
|
addCImport(b, mod, translate_c, target, optimize, "kbio", "#include <sys/kbio.h>");
|
||||||
addCImport(b, mod, translate_c, target, optimize, "consio", "#include <sys/consio.h>");
|
addCImport(b, mod, translate_c, target, optimize, "consio", "#include <sys/consio.h>");
|
||||||
addCImport(b, mod, translate_c, target, optimize, "sysctl", "#include <sys/sysctl.h>");
|
|
||||||
addCImport(b, mod, translate_c, target, optimize, "reboot", "#include <sys/reboot.h>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const mod_tests = b.addTest(.{
|
const mod_tests = b.addTest(.{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
.{
|
.{
|
||||||
.name = .ly_core,
|
.name = .ly_core,
|
||||||
.version = "1.1.0",
|
.version = "1.0.1",
|
||||||
.fingerprint = 0xddda7afda795472,
|
.fingerprint = 0xddda7afda795472,
|
||||||
.minimum_zig_version = "0.16.0",
|
.minimum_zig_version = "0.16.0",
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
.hash = "zigini-0.5.0-BSkB7e9WAACfyCBABNZiWL3gFMw18GKn3qBcPs8L1Ec1",
|
.hash = "zigini-0.5.0-BSkB7e9WAACfyCBABNZiWL3gFMw18GKn3qBcPs8L1Ec1",
|
||||||
},
|
},
|
||||||
.translate_c = .{
|
.translate_c = .{
|
||||||
.url = "git+https://codeberg.org/ziglang/translate-c?ref=zig-0.16.x#6fe0ffc4549f15c5f2d9432c2b4460ba90ff85ac",
|
.url = "git+https://codeberg.org/ziglang/translate-c#7a1a9fdc4ab00835748a6657ecbb835e3d5d45f7",
|
||||||
.hash = "translate_c-1.0.0-Q_BUWo_5BgD4flHdUhA31zOz0XvZk9k7lQv1ouzyNXj2",
|
.hash = "translate_c-0.0.0-Q_BUWvP1BgCjAk6PWv5286tOlvzD9-X-NkuTzh0KxY0Q",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.paths = .{
|
.paths = .{
|
||||||
|
|
|
||||||
|
|
@ -3,85 +3,50 @@ const interop = @import("interop.zig");
|
||||||
|
|
||||||
const LogFile = @This();
|
const LogFile = @This();
|
||||||
|
|
||||||
maybe_path: ?[]const u8,
|
path: []const u8,
|
||||||
could_open_log_file: bool = undefined,
|
could_open_log_file: bool = undefined,
|
||||||
maybe_file: ?std.Io.File = null,
|
file: std.Io.File = undefined,
|
||||||
buffer: []u8,
|
buffer: []u8,
|
||||||
maybe_file_writer: ?std.Io.File.Writer = null,
|
file_writer: std.Io.File.Writer = undefined,
|
||||||
|
|
||||||
pub fn init(io: std.Io, path: ?[]const u8, buffer: []u8) !LogFile {
|
|
||||||
var log_file = LogFile{
|
|
||||||
.maybe_path = path,
|
|
||||||
.buffer = buffer,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (path) |p| {
|
|
||||||
log_file.could_open_log_file = try openLogFile(io, p, &log_file);
|
|
||||||
} else {
|
|
||||||
std.posix.system.openlog("ly", 0, 0);
|
|
||||||
log_file.could_open_log_file = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
pub fn init(io: std.Io, path: []const u8, buffer: []u8) !LogFile {
|
||||||
|
var log_file = LogFile{ .path = path, .buffer = buffer };
|
||||||
|
log_file.could_open_log_file = try openLogFile(io, path, &log_file);
|
||||||
return log_file;
|
return log_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn reinit(self: *LogFile, io: std.Io) !void {
|
pub fn reinit(self: *LogFile, io: std.Io) !void {
|
||||||
if (self.maybe_path) |path| {
|
self.could_open_log_file = try openLogFile(io, self.path, self);
|
||||||
self.could_open_log_file = try openLogFile(io, path, self);
|
|
||||||
} else {
|
|
||||||
std.posix.system.openlog("ly", 0, 0);
|
|
||||||
self.could_open_log_file = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn deinit(self: *LogFile, io: std.Io) void {
|
pub fn deinit(self: *LogFile, io: std.Io) void {
|
||||||
if (self.maybe_file) |file| {
|
self.file.close(io);
|
||||||
file.close(io);
|
|
||||||
} else {
|
|
||||||
std.posix.system.closelog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn info(self: *LogFile, io: std.Io, category: []const u8, comptime message: []const u8, args: anytype) !void {
|
pub fn info(self: *LogFile, io: std.Io, category: []const u8, comptime message: []const u8, args: anytype) !void {
|
||||||
if (self.maybe_file_writer) |*writer| {
|
var buffer: [128:0]u8 = undefined;
|
||||||
var buffer: [128:0]u8 = undefined;
|
const time = interop.timeAsString(io, &buffer, "%Y-%m-%d %H:%M:%S");
|
||||||
const time = interop.timeAsString(io, &buffer, "%Y-%m-%d %H:%M:%S");
|
|
||||||
|
|
||||||
try writer.interface.print("{s} [info/{s}] ", .{ time, category });
|
try self.file_writer.interface.print("{s} [info/{s}] ", .{ time, category });
|
||||||
try writer.interface.print(message, args);
|
try self.file_writer.interface.print(message, args);
|
||||||
try writer.interface.writeByte('\n');
|
try self.file_writer.interface.writeByte('\n');
|
||||||
try writer.interface.flush();
|
try self.file_writer.interface.flush();
|
||||||
} else {
|
|
||||||
var buffer: [1024]u8 = undefined;
|
|
||||||
const slice = try std.fmt.bufPrint(&buffer, message, args);
|
|
||||||
const msg = try std.fmt.bufPrintZ(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice });
|
|
||||||
|
|
||||||
std.posix.system.syslog(std.posix.LOG.INFO, msg.ptr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn err(self: *LogFile, io: std.Io, category: []const u8, comptime message: []const u8, args: anytype) !void {
|
pub fn err(self: *LogFile, io: std.Io, category: []const u8, comptime message: []const u8, args: anytype) !void {
|
||||||
if (self.maybe_file_writer) |*writer| {
|
var buffer: [128:0]u8 = undefined;
|
||||||
var buffer: [128:0]u8 = undefined;
|
const time = interop.timeAsString(io, &buffer, "%Y-%m-%d %H:%M:%S");
|
||||||
const time = interop.timeAsString(io, &buffer, "%Y-%m-%d %H:%M:%S");
|
|
||||||
|
|
||||||
try writer.interface.print("{s} [err/{s}] ", .{ time, category });
|
try self.file_writer.interface.print("{s} [err/{s}] ", .{ time, category });
|
||||||
try writer.interface.print(message, args);
|
try self.file_writer.interface.print(message, args);
|
||||||
try writer.interface.writeByte('\n');
|
try self.file_writer.interface.writeByte('\n');
|
||||||
try writer.interface.flush();
|
try self.file_writer.interface.flush();
|
||||||
} else {
|
|
||||||
var buffer: [1024]u8 = undefined;
|
|
||||||
const slice = try std.fmt.bufPrint(&buffer, message, args);
|
|
||||||
const msg = try std.fmt.bufPrintZ(buffer[slice.len..], "[info/{s}] {s}", .{ category, slice });
|
|
||||||
|
|
||||||
std.posix.system.syslog(std.posix.LOG.ERR, msg.ptr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn openLogFile(io: std.Io, path: []const u8, log_file: *LogFile) !bool {
|
fn openLogFile(io: std.Io, path: []const u8, log_file: *LogFile) !bool {
|
||||||
var could_open_log_file = true;
|
var could_open_log_file = true;
|
||||||
open_log_file: {
|
open_log_file: {
|
||||||
log_file.maybe_file = std.Io.Dir.cwd().openFile(io, path, .{ .mode = .write_only }) catch std.Io.Dir.cwd().createFile(io, path, .{ .permissions = .fromMode(0o666) }) catch {
|
log_file.file = std.Io.Dir.cwd().openFile(io, path, .{ .mode = .write_only }) catch std.Io.Dir.cwd().createFile(io, path, .{ .permissions = .fromMode(0o666) }) catch {
|
||||||
// If we could neither open an existing log file nor create a new
|
// If we could neither open an existing log file nor create a new
|
||||||
// one, abort.
|
// one, abort.
|
||||||
could_open_log_file = false;
|
could_open_log_file = false;
|
||||||
|
|
@ -90,17 +55,17 @@ fn openLogFile(io: std.Io, path: []const u8, log_file: *LogFile) !bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!could_open_log_file) {
|
if (!could_open_log_file) {
|
||||||
log_file.maybe_file = try std.Io.Dir.openFileAbsolute(io, "/dev/null", .{ .mode = .write_only });
|
log_file.file = try std.Io.Dir.openFileAbsolute(io, "/dev/null", .{ .mode = .write_only });
|
||||||
}
|
}
|
||||||
|
|
||||||
var log_file_writer = log_file.maybe_file.?.writer(io, log_file.buffer);
|
var log_file_writer = log_file.file.writer(io, log_file.buffer);
|
||||||
|
|
||||||
// Seek to the end of the log file
|
// Seek to the end of the log file
|
||||||
if (could_open_log_file) {
|
if (could_open_log_file) {
|
||||||
const stat = try log_file.maybe_file.?.stat(io);
|
const stat = try log_file.file.stat(io);
|
||||||
try log_file_writer.seekTo(stat.size);
|
try log_file_writer.seekTo(stat.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
log_file.maybe_file_writer = log_file_writer;
|
log_file.file_writer = log_file_writer;
|
||||||
return could_open_log_file;
|
return could_open_log_file;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
const build_options = @import("build_options");
|
|
||||||
const UidRange = @import("UidRange.zig");
|
const UidRange = @import("UidRange.zig");
|
||||||
const pwd = @import("pwd");
|
const pwd = @import("pwd");
|
||||||
const stdlib = @import("stdlib");
|
const stdlib = @import("stdlib");
|
||||||
|
|
@ -14,9 +13,6 @@ pub const utmp = @import("utmp");
|
||||||
// Exists for X11 support only
|
// Exists for X11 support only
|
||||||
pub const xcb = @import("xcb");
|
pub const xcb = @import("xcb");
|
||||||
|
|
||||||
// FreeBSD only
|
|
||||||
pub const sysctl = @import("sysctl");
|
|
||||||
|
|
||||||
pub const TimeOfDay = struct {
|
pub const TimeOfDay = struct {
|
||||||
seconds: i64,
|
seconds: i64,
|
||||||
microseconds: i64,
|
microseconds: i64,
|
||||||
|
|
@ -28,7 +24,7 @@ pub const UsernameEntry = struct {
|
||||||
gid: std.posix.gid_t,
|
gid: std.posix.gid_t,
|
||||||
home: ?[]const u8,
|
home: ?[]const u8,
|
||||||
shell: ?[]const u8,
|
shell: ?[]const u8,
|
||||||
passwd_struct: [*]pwd.passwd,
|
passwd_struct: [*c]pwd.passwd,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Contains the platform-specific code
|
// Contains the platform-specific code
|
||||||
|
|
@ -149,50 +145,25 @@ fn PlatformStruct() type {
|
||||||
|
|
||||||
var iterator = std.mem.splitScalar(u8, login_defs_buffer, '\n');
|
var iterator = std.mem.splitScalar(u8, login_defs_buffer, '\n');
|
||||||
var uid_range = UidRange{};
|
var uid_range = UidRange{};
|
||||||
var uid_min_Found = false;
|
var nameFound = false;
|
||||||
var uid_max_Found = false;
|
|
||||||
|
|
||||||
while (iterator.next()) |line| {
|
while (iterator.next()) |line| {
|
||||||
const trimmed_line = std.mem.trim(u8, line, " \n\r\t");
|
const trimmed_line = std.mem.trim(u8, line, " \n\r\t");
|
||||||
|
|
||||||
if (std.mem.startsWith(u8, trimmed_line, "UID_MIN")) {
|
if (std.mem.startsWith(u8, trimmed_line, "UID_MIN")) {
|
||||||
uid_range.uid_min = try parseValue(std.posix.uid_t, "UID_MIN", trimmed_line);
|
uid_range.uid_min = try parseValue(std.posix.uid_t, "UID_MIN", trimmed_line);
|
||||||
uid_min_Found = true;
|
nameFound = true;
|
||||||
} else if (std.mem.startsWith(u8, trimmed_line, "UID_MAX")) {
|
} else if (std.mem.startsWith(u8, trimmed_line, "UID_MAX")) {
|
||||||
uid_range.uid_max = try parseValue(std.posix.uid_t, "UID_MAX", trimmed_line);
|
uid_range.uid_max = try parseValue(std.posix.uid_t, "UID_MAX", trimmed_line);
|
||||||
uid_max_Found = true;
|
nameFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(uid_min_Found or uid_max_Found)) {
|
if (!nameFound) return error.UidNameNotFound;
|
||||||
return error.UidNameNotFound;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!uid_min_Found) {
|
|
||||||
uid_range.uid_min = build_options.fallback_uid_min;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!uid_max_Found) {
|
|
||||||
uid_range.uid_max = build_options.fallback_uid_max;
|
|
||||||
}
|
|
||||||
|
|
||||||
return uid_range;
|
return uid_range;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn shutdownSystemImpl() !void {
|
|
||||||
std.posix.system.sync();
|
|
||||||
if (isError(std.os.linux.reboot(.MAGIC1, .MAGIC2, .POWER_OFF, null))) {
|
|
||||||
return error.CouldntShutdown;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn rebootSystemImpl() !void {
|
|
||||||
std.posix.system.sync();
|
|
||||||
if (isError(std.os.linux.reboot(.MAGIC1, .MAGIC2, .RESTART, null))) {
|
|
||||||
return error.CouldntShutdown;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parseValue(comptime T: type, name: []const u8, buffer: []const u8) !T {
|
fn parseValue(comptime T: type, name: []const u8, buffer: []const u8) !T {
|
||||||
var iterator = std.mem.splitAny(u8, buffer, " \t");
|
var iterator = std.mem.splitAny(u8, buffer, " \t");
|
||||||
var maybe_value: ?T = null;
|
var maybe_value: ?T = null;
|
||||||
|
|
@ -223,7 +194,6 @@ fn PlatformStruct() type {
|
||||||
.freebsd => struct {
|
.freebsd => struct {
|
||||||
pub const kbio = @import("kbio");
|
pub const kbio = @import("kbio");
|
||||||
pub const consio = @import("consio");
|
pub const consio = @import("consio");
|
||||||
pub const reboot = @import("reboot");
|
|
||||||
|
|
||||||
pub const LedState = c_int;
|
pub const LedState = c_int;
|
||||||
pub const get_led_state = kbio.KDGETLED;
|
pub const get_led_state = kbio.KDGETLED;
|
||||||
|
|
@ -258,18 +228,6 @@ fn PlatformStruct() type {
|
||||||
.uid_max = FREEBSD_UID_MAX,
|
.uid_max = FREEBSD_UID_MAX,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn shutdownSystemImpl() !void {
|
|
||||||
if (isError(unistd.reboot(reboot.RB_POWEROFF))) {
|
|
||||||
return error.CouldntShutdown;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn rebootSystemImpl() !void {
|
|
||||||
if (isError(unistd.reboot(reboot.RB_AUTOBOOT))) {
|
|
||||||
return error.CouldntReboot;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
else => @compileError("Unsupported target: " ++ builtin.os.tag),
|
else => @compileError("Unsupported target: " ++ builtin.os.tag),
|
||||||
};
|
};
|
||||||
|
|
@ -277,6 +235,7 @@ fn PlatformStruct() type {
|
||||||
|
|
||||||
const platform_struct = PlatformStruct();
|
const platform_struct = PlatformStruct();
|
||||||
|
|
||||||
|
// TODO 0.16.0: Can we get away with this?
|
||||||
pub fn isError(result: anytype) bool {
|
pub fn isError(result: anytype) bool {
|
||||||
if (@typeInfo(@TypeOf(result)).int.signedness == .signed) {
|
if (@typeInfo(@TypeOf(result)).int.signedness == .signed) {
|
||||||
return result < 0;
|
return result < 0;
|
||||||
|
|
@ -381,8 +340,8 @@ pub fn setEnvironmentVariable(allocator: std.mem.Allocator, name: []const u8, va
|
||||||
if (status != 0) return error.SetEnvironmentVariableFailed;
|
if (status != 0) return error.SetEnvironmentVariableFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn putEnvironmentVariable(name_and_value: []u8) !void {
|
pub fn putEnvironmentVariable(name_and_value: [*c]u8) !void {
|
||||||
const status = stdlib.putenv(name_and_value.ptr);
|
const status = stdlib.putenv(name_and_value);
|
||||||
if (status != 0) return error.PutEnvironmentVariableFailed;
|
if (status != 0) return error.PutEnvironmentVariableFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -423,11 +382,3 @@ pub fn closePasswordDatabase() void {
|
||||||
pub fn getUserIdRange(allocator: std.mem.Allocator, io: std.Io, file_path: []const u8) !UidRange {
|
pub fn getUserIdRange(allocator: std.mem.Allocator, io: std.Io, file_path: []const u8) !UidRange {
|
||||||
return platform_struct.getUserIdRange(allocator, io, file_path);
|
return platform_struct.getUserIdRange(allocator, io, file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn shutdownSystem() !void {
|
|
||||||
try platform_struct.shutdownSystemImpl();
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn rebootSystem() !void {
|
|
||||||
try platform_struct.rebootSystemImpl();
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,10 @@ pub fn build(b: *std.Build) void {
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
const fallback_uid_min = b.option(std.posix.uid_t, "fallback_uid_min", "Set the fallback minimum UID (default is 1000). This value gets embedded into the binary");
|
|
||||||
const fallback_uid_max = b.option(std.posix.uid_t, "fallback_uid_max", "Set the fallback maximum UID (default is 60000). This value gets embedded into the binary");
|
|
||||||
|
|
||||||
const ly_core = b.dependency("ly_core", .{
|
const ly_core = b.dependency("ly_core", .{
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.enable_x11_support = enable_x11_support,
|
.enable_x11_support = enable_x11_support,
|
||||||
.fallback_uid_min = fallback_uid_min,
|
|
||||||
.fallback_uid_max = fallback_uid_max,
|
|
||||||
});
|
});
|
||||||
mod.addImport("ly-core", ly_core.module("ly-core"));
|
mod.addImport("ly-core", ly_core.module("ly-core"));
|
||||||
|
|
||||||
|
|
@ -30,6 +25,7 @@ pub fn build(b: *std.Build) void {
|
||||||
|
|
||||||
const translate_c_dep = b.dependency("translate_c", .{
|
const translate_c_dep = b.dependency("translate_c", .{
|
||||||
.target = target,
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
const termbox2: Translator = .init(translate_c_dep, .{
|
const termbox2: Translator = .init(translate_c_dep, .{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
.{
|
.{
|
||||||
.name = .ly_ui,
|
.name = .ly_ui,
|
||||||
.version = "1.1.0",
|
.version = "1.0.1",
|
||||||
.fingerprint = 0x8d11bf85a74ec803,
|
.fingerprint = 0x8d11bf85a74ec803,
|
||||||
.minimum_zig_version = "0.16.0",
|
.minimum_zig_version = "0.16.0",
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
.hash = "N-V-__8AAAUXBQD6Fwpi9m0MBqWXFFaqW5l1lVrJC2Ynj7a-",
|
.hash = "N-V-__8AAAUXBQD6Fwpi9m0MBqWXFFaqW5l1lVrJC2Ynj7a-",
|
||||||
},
|
},
|
||||||
.translate_c = .{
|
.translate_c = .{
|
||||||
.url = "git+https://codeberg.org/ziglang/translate-c?ref=zig-0.16.x#6fe0ffc4549f15c5f2d9432c2b4460ba90ff85ac",
|
.url = "git+https://codeberg.org/ziglang/translate-c#7a1a9fdc4ab00835748a6657ecbb835e3d5d45f7",
|
||||||
.hash = "translate_c-1.0.0-Q_BUWo_5BgD4flHdUhA31zOz0XvZk9k7lQv1ouzyNXj2",
|
.hash = "translate_c-0.0.0-Q_BUWvP1BgCjAk6PWv5286tOlvzD9-X-NkuTzh0KxY0Q",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.paths = .{
|
.paths = .{
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ pub fn init(ch: u32, fg: u32, bg: u32) Cell {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn put(self: Cell, x: usize, y: usize) !void {
|
pub fn put(self: Cell, x: usize, y: usize) void {
|
||||||
if (self.ch == 0) return;
|
if (self.ch == 0) return;
|
||||||
|
|
||||||
try TerminalBuffer.setCell(x, y, self);
|
TerminalBuffer.setCell(x, y, self);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,55 +103,24 @@ pub fn init(
|
||||||
random: Random,
|
random: Random,
|
||||||
) !TerminalBuffer {
|
) !TerminalBuffer {
|
||||||
// Initialize termbox
|
// Initialize termbox
|
||||||
var err = termbox.tb_init();
|
_ = termbox.tb_init();
|
||||||
if (err != 0) {
|
|
||||||
try log_file.err(
|
|
||||||
io,
|
|
||||||
"tui",
|
|
||||||
"failed to initialise termbox2: {s}, term: {s}",
|
|
||||||
.{ termbox.tb_strerror(err), std.c.getenv("TERM").? },
|
|
||||||
);
|
|
||||||
return error.TermboxInitFailed;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.full_color) {
|
if (options.full_color) {
|
||||||
err = termbox.tb_set_output_mode(termbox.TB_OUTPUT_TRUECOLOR);
|
_ = termbox.tb_set_output_mode(termbox.TB_OUTPUT_TRUECOLOR);
|
||||||
if (err != 0) {
|
try log_file.info(io, "tui", "termbox2 set to 24-bit color output mode", .{});
|
||||||
try log_file.err(
|
|
||||||
io,
|
|
||||||
"tui",
|
|
||||||
"failed to set termbox2 output mode to 24-bit color: {s}",
|
|
||||||
.{termbox.tb_strerror(err)},
|
|
||||||
);
|
|
||||||
return error.TermboxSetOutputModeFailed;
|
|
||||||
}
|
|
||||||
try log_file.info(
|
|
||||||
io,
|
|
||||||
"tui",
|
|
||||||
"termbox2 set to 24-bit color output mode",
|
|
||||||
.{},
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
try log_file.info(
|
try log_file.info(io, "tui", "termbox2 set to eight-color output mode", .{});
|
||||||
io,
|
|
||||||
"tui",
|
|
||||||
"termbox2 set to eight-color output mode",
|
|
||||||
.{},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ = termbox.tb_clear();
|
||||||
|
|
||||||
// Let's take some precautions here and clear the back buffer as well
|
// Let's take some precautions here and clear the back buffer as well
|
||||||
try clearScreen(true);
|
try clearBackBuffer();
|
||||||
|
|
||||||
const width = getWidth();
|
const width: usize = @intCast(termbox.tb_width());
|
||||||
const height = getHeight();
|
const height: usize = @intCast(termbox.tb_height());
|
||||||
|
|
||||||
try log_file.info(
|
try log_file.info(io, "tui", "screen resolution is {d}x{d}", .{ width, height });
|
||||||
io,
|
|
||||||
"tui",
|
|
||||||
"screen resolution is {d}x{d}",
|
|
||||||
.{ width, height },
|
|
||||||
);
|
|
||||||
|
|
||||||
return .{
|
return .{
|
||||||
.log_file = log_file,
|
.log_file = log_file,
|
||||||
|
|
@ -194,7 +163,7 @@ pub fn init(
|
||||||
|
|
||||||
pub fn deinit(self: *TerminalBuffer) void {
|
pub fn deinit(self: *TerminalBuffer) void {
|
||||||
self.keybinds.deinit();
|
self.keybinds.deinit();
|
||||||
TerminalBuffer.shutdown() catch {};
|
TerminalBuffer.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn runEventLoop(
|
pub fn runEventLoop(
|
||||||
|
|
@ -269,8 +238,7 @@ pub fn runEventLoop(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't care about present errors here
|
TerminalBuffer.presentBuffer();
|
||||||
TerminalBuffer.presentBuffer() catch {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inactivity_event_fn) |inactivity_fn| {
|
if (inactivity_event_fn) |inactivity_fn| {
|
||||||
|
|
@ -370,35 +338,31 @@ pub fn getHeight() usize {
|
||||||
return @intCast(termbox.tb_height());
|
return @intCast(termbox.tb_height());
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setCursor(x: usize, y: usize) !void {
|
pub fn setCursor(x: usize, y: usize) void {
|
||||||
if (termbox.tb_set_cursor(@intCast(x), @intCast(y)) != 0) {
|
_ = termbox.tb_set_cursor(@intCast(x), @intCast(y));
|
||||||
return error.TermboxSetCursorFailed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clearScreen(clear_back_buffer: bool) !void {
|
pub fn clearScreen(clear_back_buffer: bool) !void {
|
||||||
if (termbox.tb_clear() != 0) return error.TermboxClearFailed;
|
_ = termbox.tb_clear();
|
||||||
if (clear_back_buffer) try clearBackBuffer();
|
if (clear_back_buffer) try clearBackBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn shutdown() !void {
|
pub fn shutdown() void {
|
||||||
if (termbox.tb_shutdown() != 0) return error.TermboxShutdownFailed;
|
_ = termbox.tb_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn presentBuffer() !void {
|
pub fn presentBuffer() void {
|
||||||
if (termbox.tb_present() != 0) return error.TermboxPresentFailed;
|
_ = termbox.tb_present();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn getCell(x: usize, y: usize) ?Cell {
|
pub fn getCell(x: usize, y: usize) ?Cell {
|
||||||
var maybe_cell: ?*termbox.tb_cell = undefined;
|
var maybe_cell: ?*termbox.tb_cell = undefined;
|
||||||
if (termbox.tb_get_cell(
|
_ = termbox.tb_get_cell(
|
||||||
@intCast(x),
|
@intCast(x),
|
||||||
@intCast(y),
|
@intCast(y),
|
||||||
1,
|
1,
|
||||||
&maybe_cell,
|
&maybe_cell,
|
||||||
) != 0) {
|
);
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (maybe_cell) |cell| {
|
if (maybe_cell) |cell| {
|
||||||
return Cell.init(cell.ch, cell.fg, cell.bg);
|
return Cell.init(cell.ch, cell.fg, cell.bg);
|
||||||
|
|
@ -407,32 +371,29 @@ pub fn getCell(x: usize, y: usize) ?Cell {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setCell(x: usize, y: usize, cell: Cell) !void {
|
pub fn setCell(x: usize, y: usize, cell: Cell) void {
|
||||||
if (termbox.tb_set_cell(
|
_ = termbox.tb_set_cell(
|
||||||
@intCast(x),
|
@intCast(x),
|
||||||
@intCast(y),
|
@intCast(y),
|
||||||
cell.ch,
|
cell.ch,
|
||||||
cell.fg,
|
cell.fg,
|
||||||
cell.bg,
|
cell.bg,
|
||||||
) != 0) {
|
);
|
||||||
return error.TermboxSetCellFailed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setCellBoundsChecked(self: *TerminalBuffer, x: isize, y: isize, cell: Cell) !void {
|
pub fn setCellBoundsChecked(self: *TerminalBuffer, x: isize, y: isize, cell: Cell) void {
|
||||||
if (0 <= x and x < self.width and 0 <= y and y < self.height) {
|
if (0 <= x and x < self.width and 0 <= y and y < self.height) {
|
||||||
try cell.put(@intCast(x), @intCast(y));
|
cell.put(@intCast(x), @intCast(y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn reclaim(self: TerminalBuffer) !void {
|
pub fn reclaim(self: TerminalBuffer) !void {
|
||||||
if (self.termios) |termios| {
|
if (self.termios) |termios| {
|
||||||
// Take back control of the TTY
|
// Take back control of the TTY
|
||||||
const err = termbox.tb_init();
|
_ = termbox.tb_init();
|
||||||
if (err != 0 and err != termbox.TB_ERR_INIT_ALREADY) return error.TermboxReinitFailed;
|
|
||||||
|
|
||||||
if (self.full_color and termbox.tb_set_output_mode(termbox.TB_OUTPUT_TRUECOLOR) != 0) {
|
if (self.full_color) {
|
||||||
return error.TermboxSetOutputModeFailed;
|
_ = termbox.tb_set_output_mode(termbox.TB_OUTPUT_TRUECOLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
try std.posix.tcsetattr(std.posix.STDIN_FILENO, .FLUSH, termios);
|
try std.posix.tcsetattr(std.posix.STDIN_FILENO, .FLUSH, termios);
|
||||||
|
|
@ -503,14 +464,14 @@ pub fn drawText(
|
||||||
y: usize,
|
y: usize,
|
||||||
fg: u32,
|
fg: u32,
|
||||||
bg: u32,
|
bg: u32,
|
||||||
) !void {
|
) void {
|
||||||
|
const yc: c_int = @intCast(y);
|
||||||
const utf8view = std.unicode.Utf8View.init(text) catch return;
|
const utf8view = std.unicode.Utf8View.init(text) catch return;
|
||||||
var utf8 = utf8view.iterator();
|
var utf8 = utf8view.iterator();
|
||||||
|
|
||||||
var i = x;
|
var i: c_int = @intCast(x);
|
||||||
while (utf8.nextCodepoint()) |codepoint| : (i += @intCast(termbox.tb_wcwidth(codepoint))) {
|
while (utf8.nextCodepoint()) |codepoint| : (i += termbox.tb_wcwidth(codepoint)) {
|
||||||
const cell = Cell.init(codepoint, fg, bg);
|
_ = termbox.tb_set_cell(i, yc, codepoint, fg, bg);
|
||||||
try cell.put(i, y);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -521,16 +482,15 @@ pub fn drawConfinedText(
|
||||||
max_length: usize,
|
max_length: usize,
|
||||||
fg: u32,
|
fg: u32,
|
||||||
bg: u32,
|
bg: u32,
|
||||||
) !void {
|
) void {
|
||||||
|
const yc: c_int = @intCast(y);
|
||||||
const utf8view = std.unicode.Utf8View.init(text) catch return;
|
const utf8view = std.unicode.Utf8View.init(text) catch return;
|
||||||
var utf8 = utf8view.iterator();
|
var utf8 = utf8view.iterator();
|
||||||
|
|
||||||
var i = x;
|
var i: c_int = @intCast(x);
|
||||||
while (utf8.nextCodepoint()) |codepoint| : (i += @intCast(termbox.tb_wcwidth(codepoint))) {
|
while (utf8.nextCodepoint()) |codepoint| : (i += termbox.tb_wcwidth(codepoint)) {
|
||||||
if (i - x >= max_length) break;
|
if (i - @as(c_int, @intCast(x)) >= max_length) break;
|
||||||
|
_ = termbox.tb_set_cell(i, yc, codepoint, fg, bg);
|
||||||
const cell = Cell.init(codepoint, fg, bg);
|
|
||||||
try cell.put(i, y);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -541,9 +501,9 @@ pub fn drawCharMultiple(
|
||||||
length: usize,
|
length: usize,
|
||||||
fg: u32,
|
fg: u32,
|
||||||
bg: u32,
|
bg: u32,
|
||||||
) !void {
|
) void {
|
||||||
const cell = Cell.init(char, fg, bg);
|
const cell = Cell.init(char, fg, bg);
|
||||||
for (0..length) |xx| try cell.put(x + xx, y);
|
for (0..length) |xx| cell.put(x + xx, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Every codepoint is assumed to have a width of 1.
|
// Every codepoint is assumed to have a width of 1.
|
||||||
|
|
@ -561,8 +521,6 @@ pub fn strWidth(str: []const u8) usize {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clearBackBuffer() !void {
|
fn clearBackBuffer() !void {
|
||||||
if (termbox.global.initialized == 0) return;
|
|
||||||
|
|
||||||
// Clear the TTY because termbox2 doesn't seem to do it properly
|
// Clear the TTY because termbox2 doesn't seem to do it properly
|
||||||
const capability = termbox.global.caps[termbox.TB_CAP_CLEAR_SCREEN];
|
const capability = termbox.global.caps[termbox.TB_CAP_CLEAR_SCREEN];
|
||||||
const capability_slice = std.mem.span(capability);
|
const capability_slice = std.mem.span(capability);
|
||||||
|
|
@ -579,9 +537,9 @@ fn parseKeybind(self: *TerminalBuffer, io: std.Io, keybind: []const u8) !keyboar
|
||||||
while (iterator.next()) |item| {
|
while (iterator.next()) |item| {
|
||||||
var found = false;
|
var found = false;
|
||||||
|
|
||||||
inline for (comptime std.meta.fieldNames(keyboard.Key)) |name| {
|
inline for (std.meta.fields(keyboard.Key)) |field| {
|
||||||
if (std.ascii.eqlIgnoreCase(name, item)) {
|
if (std.ascii.eqlIgnoreCase(field.name, item)) {
|
||||||
@field(key, name) = true;
|
@field(key, field.name) = true;
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ fn alphaBlit(x: usize, y: usize, tb_width: usize, tb_height: usize, cells: [CHAR
|
||||||
for (0..CHAR_HEIGHT) |yy| {
|
for (0..CHAR_HEIGHT) |yy| {
|
||||||
for (0..CHAR_WIDTH) |xx| {
|
for (0..CHAR_WIDTH) |xx| {
|
||||||
const cell = cells[yy * CHAR_WIDTH + xx];
|
const cell = cells[yy * CHAR_WIDTH + xx];
|
||||||
cell.put(x + xx, y + yy) catch {};
|
cell.put(x + xx, y + yy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,29 +129,29 @@ fn draw(self: *Box) void {
|
||||||
self.bg,
|
self.bg,
|
||||||
);
|
);
|
||||||
|
|
||||||
left_up.put(self.left_pos.x - 1, self.left_pos.y - 1) catch {};
|
left_up.put(self.left_pos.x - 1, self.left_pos.y - 1);
|
||||||
right_up.put(self.right_pos.x, self.left_pos.y - 1) catch {};
|
right_up.put(self.right_pos.x, self.left_pos.y - 1);
|
||||||
left_down.put(self.left_pos.x - 1, self.right_pos.y) catch {};
|
left_down.put(self.left_pos.x - 1, self.right_pos.y);
|
||||||
right_down.put(self.right_pos.x, self.right_pos.y) catch {};
|
right_down.put(self.right_pos.x, self.right_pos.y);
|
||||||
|
|
||||||
for (0..self.width) |i| {
|
for (0..self.width) |i| {
|
||||||
top.put(self.left_pos.x + i, self.left_pos.y - 1) catch {};
|
top.put(self.left_pos.x + i, self.left_pos.y - 1);
|
||||||
bottom.put(self.left_pos.x + i, self.right_pos.y) catch {};
|
bottom.put(self.left_pos.x + i, self.right_pos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
top.ch = self.buffer.box_chars.left;
|
top.ch = self.buffer.box_chars.left;
|
||||||
bottom.ch = self.buffer.box_chars.right;
|
bottom.ch = self.buffer.box_chars.right;
|
||||||
|
|
||||||
for (0..self.height) |i| {
|
for (0..self.height) |i| {
|
||||||
top.put(self.left_pos.x - 1, self.left_pos.y + i) catch {};
|
top.put(self.left_pos.x - 1, self.left_pos.y + i);
|
||||||
bottom.put(self.right_pos.x, self.left_pos.y + i) catch {};
|
bottom.put(self.right_pos.x, self.left_pos.y + i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.blank_box) {
|
if (self.blank_box) {
|
||||||
for (0..self.height) |y| {
|
for (0..self.height) |y| {
|
||||||
for (0..self.width) |x| {
|
for (0..self.width) |x| {
|
||||||
self.buffer.blank_cell.put(self.left_pos.x + x, self.left_pos.y + y) catch {};
|
self.buffer.blank_cell.put(self.left_pos.x + x, self.left_pos.y + y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +164,7 @@ fn draw(self: *Box) void {
|
||||||
self.width,
|
self.width,
|
||||||
self.title_fg,
|
self.title_fg,
|
||||||
self.bg,
|
self.bg,
|
||||||
) catch {};
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.bottom_title) |title| {
|
if (self.bottom_title) |title| {
|
||||||
|
|
@ -175,7 +175,7 @@ fn draw(self: *Box) void {
|
||||||
self.width,
|
self.width,
|
||||||
self.title_fg,
|
self.title_fg,
|
||||||
self.bg,
|
self.bg,
|
||||||
) catch {};
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ fn draw(self: *Label) void {
|
||||||
width,
|
width,
|
||||||
self.fg,
|
self.fg,
|
||||||
self.bg,
|
self.bg,
|
||||||
) catch {};
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,7 +127,7 @@ fn draw(self: *Label) void {
|
||||||
self.component_pos.y,
|
self.component_pos.y,
|
||||||
self.fg,
|
self.fg,
|
||||||
self.bg,
|
self.bg,
|
||||||
) catch {};
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(self: *Label, ctx: *anyopaque) !void {
|
fn update(self: *Label, ctx: *anyopaque) !void {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const TerminalBuffer = @import("../TerminalBuffer.zig");
|
||||||
const Position = @import("../Position.zig");
|
const Position = @import("../Position.zig");
|
||||||
const Widget = @import("../Widget.zig");
|
const Widget = @import("../Widget.zig");
|
||||||
|
|
||||||
const DynamicString = std.ArrayList(u8);
|
const DynamicString = std.ArrayListUnmanaged(u8);
|
||||||
|
|
||||||
const Text = @This();
|
const Text = @This();
|
||||||
|
|
||||||
|
|
@ -131,23 +131,19 @@ pub fn handle(self: *Text, maybe_key: ?keyboard.Key) !void {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.masked and self.maybe_mask == null) {
|
if (self.masked and self.maybe_mask == null) {
|
||||||
try TerminalBuffer.setCursor(
|
TerminalBuffer.setCursor(
|
||||||
self.component_pos.x,
|
self.component_pos.x,
|
||||||
self.component_pos.y,
|
self.component_pos.y,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try TerminalBuffer.setCursor(
|
TerminalBuffer.setCursor(
|
||||||
self.component_pos.x + (self.cursor - self.visible_start),
|
self.component_pos.x + (self.cursor - self.visible_start),
|
||||||
self.component_pos.y,
|
self.component_pos.y,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn writeText(self: *Text, str: []const u8) !void {
|
|
||||||
for (str) |c| try self.write(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn draw(self: *Text) void {
|
fn draw(self: *Text) void {
|
||||||
if (self.masked) {
|
if (self.masked) {
|
||||||
if (self.maybe_mask) |mask| {
|
if (self.maybe_mask) |mask| {
|
||||||
|
|
@ -163,7 +159,7 @@ fn draw(self: *Text) void {
|
||||||
length,
|
length,
|
||||||
self.fg,
|
self.fg,
|
||||||
self.bg,
|
self.bg,
|
||||||
) catch {};
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -186,7 +182,7 @@ fn draw(self: *Text) void {
|
||||||
self.component_pos.y,
|
self.component_pos.y,
|
||||||
self.fg,
|
self.fg,
|
||||||
self.bg,
|
self.bg,
|
||||||
) catch {};
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn goLeft(ptr: *anyopaque) !bool {
|
fn goLeft(ptr: *anyopaque) !bool {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ const Position = @import("../Position.zig");
|
||||||
pub fn CyclableLabel(comptime ItemType: type, comptime ChangeItemType: type) type {
|
pub fn CyclableLabel(comptime ItemType: type, comptime ChangeItemType: type) type {
|
||||||
return struct {
|
return struct {
|
||||||
const Allocator = std.mem.Allocator;
|
const Allocator = std.mem.Allocator;
|
||||||
const ItemList = std.ArrayList(ItemType);
|
const ItemList = std.ArrayListUnmanaged(ItemType);
|
||||||
const DrawItemFn = *const fn (*Self, ItemType, usize, usize, usize) void;
|
const DrawItemFn = *const fn (*Self, ItemType, usize, usize, usize) void;
|
||||||
const ChangeItemFn = *const fn (ItemType, ?ChangeItemType) void;
|
const ChangeItemFn = *const fn (ItemType, ?ChangeItemType) void;
|
||||||
|
|
||||||
|
|
@ -105,8 +105,8 @@ pub fn CyclableLabel(comptime ItemType: type, comptime ChangeItemType: type) typ
|
||||||
self.current = self.list.items.len - 1;
|
self.current = self.list.items.len - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle(self: *Self, _: ?keyboard.Key) !void {
|
pub fn handle(self: *Self, _: ?keyboard.Key) void {
|
||||||
try TerminalBuffer.setCursor(
|
TerminalBuffer.setCursor(
|
||||||
self.component_pos.x + self.cursor + 2,
|
self.component_pos.x + self.cursor + 2,
|
||||||
self.component_pos.y,
|
self.component_pos.y,
|
||||||
);
|
);
|
||||||
|
|
@ -119,11 +119,11 @@ pub fn CyclableLabel(comptime ItemType: type, comptime ChangeItemType: type) typ
|
||||||
var left_arrow = Cell.init('<', self.fg, self.bg);
|
var left_arrow = Cell.init('<', self.fg, self.bg);
|
||||||
var right_arrow = Cell.init('>', self.fg, self.bg);
|
var right_arrow = Cell.init('>', self.fg, self.bg);
|
||||||
|
|
||||||
left_arrow.put(self.component_pos.x, self.component_pos.y) catch {};
|
left_arrow.put(self.component_pos.x, self.component_pos.y);
|
||||||
right_arrow.put(
|
right_arrow.put(
|
||||||
self.component_pos.x + self.width - 1,
|
self.component_pos.x + self.width - 1,
|
||||||
self.component_pos.y,
|
self.component_pos.y,
|
||||||
) catch {};
|
);
|
||||||
|
|
||||||
const current_item = self.list.items[self.current];
|
const current_item = self.list.items[self.current];
|
||||||
const x = self.component_pos.x + 2;
|
const x = self.component_pos.x + 2;
|
||||||
|
|
|
||||||
|
|
@ -113,14 +113,14 @@ pub const Key = packed struct {
|
||||||
pub fn getEnabledPrintableAscii(self: Key) ?u8 {
|
pub fn getEnabledPrintableAscii(self: Key) ?u8 {
|
||||||
if (self.ctrl or self.alt) return null;
|
if (self.ctrl or self.alt) return null;
|
||||||
|
|
||||||
inline for (comptime std.meta.fieldNames(Key)) |name| {
|
inline for (std.meta.fields(Key)) |field| {
|
||||||
if (name.len == 1 and std.ascii.isPrint(name[0]) and @field(self, name)) {
|
if (field.name.len == 1 and std.ascii.isPrint(field.name[0]) and @field(self, field.name)) {
|
||||||
if (self.shift) {
|
if (self.shift) {
|
||||||
if (!std.ascii.isAlphanumeric(name[0])) return null;
|
if (!std.ascii.isAlphanumeric(field.name[0])) return null;
|
||||||
return std.ascii.toUpper(name[0]);
|
return std.ascii.toUpper(field.name[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return name[0];
|
return field.name[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -167,12 +167,6 @@ pub fn getKeyList(allocator: Allocator, tb_event: termbox.tb_event) !KeyList {
|
||||||
21 => key.right = true,
|
21 => key.right = true,
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code >= 18 and code <= 21) {
|
|
||||||
// https://github.com/termbox/termbox2/blob/605398fa79108412976191e062ea14bd4bd30213/termbox2.h#L446
|
|
||||||
key.ctrl = false;
|
|
||||||
key.shift = false;
|
|
||||||
}
|
|
||||||
} else if (tb_event.ch < 128) {
|
} else if (tb_event.ch < 128) {
|
||||||
const code = if (tb_event.ch == 0 and tb_event.key < 128) tb_event.key else tb_event.ch;
|
const code = if (tb_event.ch == 0 and tb_event.key < 128) tb_event.key else tb_event.ch;
|
||||||
|
|
||||||
|
|
|
||||||
62
readme.md
62
readme.md
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_Note: the above animation can be found [here](https://codeberg.org/fairyglade/ly-community/src/branch/main/animations/dur/blackhole-smooth-240x67.dur)!_
|
_Note: the above animation can be found [here](https://codeberg.org/attachments/f336d6ac-8331-4323-91fc-0e4619803401)!_
|
||||||
|
|
||||||
Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD, designed with portability in mind and doesn't require systemd to run.
|
Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD, designed with portability in mind and doesn't require systemd to run.
|
||||||
|
|
||||||
|
|
@ -14,7 +14,7 @@ Join us on Matrix over at [#ly-dm:matrix.org](https://matrix.to/#/#ly-dm:matrix.
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
- Compile-time:
|
- Compile-time:
|
||||||
- zig 0.16.x (you must use a **release version** of zig; check that `zig version` does not have a `-dev*` suffix)
|
- zig 0.16.x
|
||||||
|
|
||||||
- libc
|
- libc
|
||||||
|
|
||||||
|
|
@ -39,38 +39,13 @@ Join us on Matrix over at [#ly-dm:matrix.org](https://matrix.to/#/#ly-dm:matrix.
|
||||||
|
|
||||||
### Fedora
|
### Fedora
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> You may encounter issues with SELinux on Fedora. It is recommended to add a rule for Ly as it currently does not ship one.
|
||||||
|
|
||||||
```
|
```
|
||||||
# dnf install kernel-devel pam-devel libxcb-devel zig xorg-x11-xauth xorg-x11-server brightnessctl
|
# dnf install kernel-devel pam-devel libxcb-devel zig xorg-x11-xauth xorg-x11-server brightnessctl
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> Distributions using SELinux such as Fedora and openSUSE Tumbleweed may encounter issues. If you encounter such issues, such as session launch failures, proceed with the following steps:
|
|
||||||
>
|
|
||||||
> ```
|
|
||||||
> # ausearch -m avc -ts recent
|
|
||||||
> ```
|
|
||||||
>
|
|
||||||
> If SELinux is denying process context transition, you will see this output:
|
|
||||||
>
|
|
||||||
> ```
|
|
||||||
> denied { transition } for pid=XXXX comm="ly" path="/usr/bin/bash"
|
|
||||||
> scontext=system_u:system_r:unconfined_service_t:s0
|
|
||||||
> tcontext=unconfined_u:unconfined_r:unconfined_t:s0
|
|
||||||
> tclass=process permissive=0
|
|
||||||
> ```
|
|
||||||
>
|
|
||||||
> Pipe this output into `audit2allow` to generate a security module package. This will persist regardless of changes to filesystem permissions:
|
|
||||||
>
|
|
||||||
> ```
|
|
||||||
> # ausearch -m avc -ts recent | audit2allow -M ly-local
|
|
||||||
> ```
|
|
||||||
>
|
|
||||||
> ```
|
|
||||||
> # semodule -i ly-local.pp
|
|
||||||
> ```
|
|
||||||
>
|
|
||||||
> _This fix has been confirmed on Fedora 39 and 44 and openSUSE Tumbleweed. (#494)_
|
|
||||||
|
|
||||||
### FreeBSD
|
### FreeBSD
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
@ -81,10 +56,6 @@ Join us on Matrix over at [#ly-dm:matrix.org](https://matrix.to/#/#ly-dm:matrix.
|
||||||
|
|
||||||
[](https://repology.org/project/ly-display-manager/versions)
|
[](https://repology.org/project/ly-display-manager/versions)
|
||||||
|
|
||||||
## Custom animations & user scripts
|
|
||||||
|
|
||||||
If you want to pimp your Ly installation even further than what the traditional configuration file allows you to, a [community repository](https://codeberg.org/fairyglade/ly-community) exists containing custom animations & scripts, so go check it out!
|
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
Every environment that works on other login managers also should work on Ly.
|
Every environment that works on other login managers also should work on Ly.
|
||||||
|
|
@ -124,9 +95,6 @@ $ zig build run
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> While you can run Ly in a terminal emulator as root, it is **not** recommended. If you want to test Ly, please enable its service (as described below) and reboot your machine.
|
> While you can run Ly in a terminal emulator as root, it is **not** recommended. If you want to test Ly, please enable its service (as described below) and reboot your machine.
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> You can, however, test your configuration file changes like that. Note that you must do Ctrl+C in order to exit Ly.
|
|
||||||
|
|
||||||
The next sections will explain how to use Ly with a variety of init systems. Detailed explanation is only given for systemd, but should be applicable for all.
|
The next sections will explain how to use Ly with a variety of init systems. Detailed explanation is only given for systemd, but should be applicable for all.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
|
|
@ -162,6 +130,12 @@ Then, similarly to the previous command, you need to enable the Ly service:
|
||||||
# systemctl disable getty@tty2.service
|
# systemctl disable getty@tty2.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
On platforms that use systemd-logind to dynamically start `autovt@.service` instances when the switch to a new tty occurs, any ly instances for ttys _except the default tty_ need to be enabled using a different mechanism: To autostart ly on switch to `tty2`, do not enable any `ly` unit directly, instead symlink `autovt@tty2.service` to `ly@tty2.service` within `/usr/lib/systemd/system/` (analogous for every other tty you want to enable ly on).
|
||||||
|
|
||||||
|
The target of the symlink, `ly@ttyN.service`, does not actually exist, but systemd nevertheless recognizes that the instanciation of `autovt@.service` with `%I` equal to `ttyN` now points to an instanciation of `ly@.service` with `%I` set to `ttyN`.
|
||||||
|
|
||||||
|
Compare to `man 5 logind.conf`, especially regarding the `NAutoVTs=` and `ReserveVT=` parameters.
|
||||||
|
|
||||||
On non-systemd systems, you can change the TTY Ly will run on by editing the corresponding service file for your platform.
|
On non-systemd systems, you can change the TTY Ly will run on by editing the corresponding service file for your platform.
|
||||||
|
|
||||||
### OpenRC
|
### OpenRC
|
||||||
|
|
@ -174,7 +148,7 @@ On non-systemd systems, you can change the TTY Ly will run on by editing the cor
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> On Gentoo, Alpine and potentially others, you also **must** comment out the appropriate line for the TTY in /etc/inittab.
|
> On Gentoo specifically, you also **must** comment out the appropriate line for the TTY in /etc/inittab.
|
||||||
|
|
||||||
### runit
|
### runit
|
||||||
|
|
||||||
|
|
@ -240,7 +214,7 @@ ttyv1 "/usr/libexec/getty Ly" xterm on secure
|
||||||
|
|
||||||
### Updating
|
### Updating
|
||||||
|
|
||||||
You can also install Ly without overriding the current configuration file. This is called **updating**. To update, simply run:
|
You can also install Ly without overrding the current configuration file. This is called **updating**. To update, simply run:
|
||||||
|
|
||||||
```
|
```
|
||||||
# zig build installnoconf
|
# zig build installnoconf
|
||||||
|
|
@ -252,19 +226,13 @@ You can, of course, still select the init system of your choice when using this
|
||||||
|
|
||||||
You can find all the configuration in `/etc/ly/config.ini`. The file is fully commented, and includes the default values.
|
You can find all the configuration in `/etc/ly/config.ini`. The file is fully commented, and includes the default values.
|
||||||
|
|
||||||
You may also check the validity of your configuration file (i.e. if there are any errors in it) with the following command:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ ly --validate-config /etc/ly/config.ini
|
|
||||||
```
|
|
||||||
|
|
||||||
## Controls
|
## Controls
|
||||||
|
|
||||||
Use the Up/Down arrow keys to change the current field, and the Left/Right arrow keys to scroll through the different fields (whether it be the info line, the desktop environment, or the username). The info line is where messages and errors are displayed.
|
Use the Up/Down arrow keys to change the current field, and the Left/Right arrow keys to scroll through the different fields (whether it be the info line, the desktop environment, or the username). The info line is where messages and errors are displayed.
|
||||||
|
|
||||||
## A note on .xinitrc
|
## A note on .xinitrc
|
||||||
|
|
||||||
If your `.xinitrc` file doesn't work, make sure it is executable and includes a shebang. This file is supposed to be a shell script! Quoting from `xinit`'s man page:
|
If your `.xinitrc` file doesn't work ,make sure it is executable and includes a shebang. This file is supposed to be a shell script! Quoting from `xinit`'s man page:
|
||||||
|
|
||||||
> If no specific client program is given on the command line, xinit will look for a file in the user's home directory called .xinitrc to run as a shell script to start up client programs.
|
> If no specific client program is given on the command line, xinit will look for a file in the user's home directory called .xinitrc to run as a shell script to start up client programs.
|
||||||
|
|
||||||
|
|
@ -276,7 +244,7 @@ A typical shebang for a shell script looks like this:
|
||||||
|
|
||||||
## Tips
|
## Tips
|
||||||
|
|
||||||
- The numlock and capslock states are printed in the top-right corner.
|
- The numlock and capslock state is printed in the top-right corner.
|
||||||
|
|
||||||
- Use the F1 and F2 keys to respectively shutdown and reboot.
|
- Use the F1 and F2 keys to respectively shutdown and reboot.
|
||||||
|
|
||||||
|
|
|
||||||
111
res/config.ini
111
res/config.ini
|
|
@ -25,7 +25,6 @@ allow_empty_password = true
|
||||||
# colormix -> Color mixing shader
|
# colormix -> Color mixing shader
|
||||||
# gameoflife -> John Conway's Game of Life
|
# gameoflife -> John Conway's Game of Life
|
||||||
# dur_file -> .dur file format (https://github.com/cmang/durdraw/tree/master)
|
# dur_file -> .dur file format (https://github.com/cmang/durdraw/tree/master)
|
||||||
# lua -> user-made animation written in LuaJIT
|
|
||||||
animation = none
|
animation = none
|
||||||
|
|
||||||
# Delay between each animation frame in milliseconds
|
# Delay between each animation frame in milliseconds
|
||||||
|
|
@ -47,6 +46,11 @@ asterisk = *
|
||||||
# If set to 0, the animation will never be played
|
# If set to 0, the animation will never be played
|
||||||
auth_fails = 10
|
auth_fails = 10
|
||||||
|
|
||||||
|
# Identifier for battery whose charge to display at top left
|
||||||
|
# Primary battery is usually BAT0 or BAT1
|
||||||
|
# If set to null, battery status won't be shown
|
||||||
|
battery_id = null
|
||||||
|
|
||||||
# Automatic login configuration
|
# Automatic login configuration
|
||||||
# This feature allows Ly to automatically log in a user without password prompt.
|
# This feature allows Ly to automatically log in a user without password prompt.
|
||||||
# IMPORTANT: Both auto_login_user and auto_login_session must be set for this to work.
|
# IMPORTANT: Both auto_login_user and auto_login_session must be set for this to work.
|
||||||
|
|
@ -71,12 +75,6 @@ auto_login_session = null
|
||||||
# If null, automatic login is disabled
|
# If null, automatic login is disabled
|
||||||
auto_login_user = null
|
auto_login_user = null
|
||||||
|
|
||||||
# Identifier for battery whose charge to display at top left
|
|
||||||
# Primary battery is usually BAT0 or BAT1
|
|
||||||
# If set to null, battery status won't be shown
|
|
||||||
# Unused on FreeBSD (a sysctl is used there)
|
|
||||||
battery_id = null
|
|
||||||
|
|
||||||
# Background color id
|
# Background color id
|
||||||
bg = 0x00000000
|
bg = 0x00000000
|
||||||
|
|
||||||
|
|
@ -99,14 +97,6 @@ blank_box = true
|
||||||
# Border foreground color id
|
# Border foreground color id
|
||||||
border_fg = 0x00FFFFFF
|
border_fg = 0x00FFFFFF
|
||||||
|
|
||||||
# Relative horizontal position from the end of the screen
|
|
||||||
# default: 0.5
|
|
||||||
box_position_h = 0.5
|
|
||||||
|
|
||||||
# Relative vertical position from the bottom of the screen
|
|
||||||
# default: 0.5
|
|
||||||
box_position_v = 0.5
|
|
||||||
|
|
||||||
# Title to show at the top of the main box
|
# Title to show at the top of the main box
|
||||||
# If set to null, none will be shown
|
# If set to null, none will be shown
|
||||||
box_title = null
|
box_title = null
|
||||||
|
|
@ -114,15 +104,13 @@ box_title = null
|
||||||
# Brightness decrease command
|
# Brightness decrease command
|
||||||
brightness_down_cmd = $PREFIX_DIRECTORY/bin/brightnessctl -q -n s 10%-
|
brightness_down_cmd = $PREFIX_DIRECTORY/bin/brightnessctl -q -n s 10%-
|
||||||
|
|
||||||
# Brightness decrease key combination
|
# Brightness decrease key combination, or null to disable
|
||||||
# If null, the keybind is disabled and isn't shown
|
|
||||||
brightness_down_key = F5
|
brightness_down_key = F5
|
||||||
|
|
||||||
# Brightness increase command
|
# Brightness increase command
|
||||||
brightness_up_cmd = $PREFIX_DIRECTORY/bin/brightnessctl -q -n s +10%
|
brightness_up_cmd = $PREFIX_DIRECTORY/bin/brightnessctl -q -n s +10%
|
||||||
|
|
||||||
# Brightness increase key combination
|
# Brightness increase key combination, or null to disable
|
||||||
# If null, the keybind is disabled and isn't shown
|
|
||||||
brightness_up_key = F6
|
brightness_up_key = F6
|
||||||
|
|
||||||
# Erase password input on failure
|
# Erase password input on failure
|
||||||
|
|
@ -155,43 +143,6 @@ colormix_col2 = 0x000000FF
|
||||||
# Color mixing animation third color id
|
# Color mixing animation third color id
|
||||||
colormix_col3 = 0x20000000
|
colormix_col3 = 0x20000000
|
||||||
|
|
||||||
# Screen corners customization
|
|
||||||
# Keywords:
|
|
||||||
# shutdown -> Shutdown key
|
|
||||||
# restart -> Restart key
|
|
||||||
# britup -> Brightness up key
|
|
||||||
# britdown -> Brightness down key
|
|
||||||
# password -> Toggle password key
|
|
||||||
# clock -> Clock (format defined by 'clock' option)
|
|
||||||
# tty -> Active TTY number
|
|
||||||
# battery -> Battery percentage
|
|
||||||
# version -> Ly version string
|
|
||||||
# numlock -> Numlock state
|
|
||||||
# capslock -> Capslock state
|
|
||||||
# labels -> All custom info labels (lbl:)
|
|
||||||
# binds -> All custom keybind hints (cmd:)
|
|
||||||
# lbl:name -> Specific custom info label
|
|
||||||
# cmd:key -> Specific custom keybind hint
|
|
||||||
#
|
|
||||||
# If using a keyword that groups multiple labels into one (e.g. labels, binds),
|
|
||||||
# they'll be placed horizontally
|
|
||||||
#
|
|
||||||
# Also, the order defines the vertical stack (first item is at the edge)
|
|
||||||
# If items are separted by commas, they'll be placed horizontally
|
|
||||||
# It is possible to have both horizontal and vertical items on the same corner
|
|
||||||
|
|
||||||
# Bottom left
|
|
||||||
corner_bottom_left = version
|
|
||||||
|
|
||||||
# Bottom right
|
|
||||||
corner_bottom_right = labels
|
|
||||||
|
|
||||||
# Top left
|
|
||||||
corner_top_left = shutdown,restart,britup,britdown,password battery
|
|
||||||
|
|
||||||
# Top right
|
|
||||||
corner_top_right = clock numlock,capslock
|
|
||||||
|
|
||||||
# For custom binds: the horizontal limit in characters for each
|
# For custom binds: the horizontal limit in characters for each
|
||||||
# line of custom binds before moving on to the next.
|
# line of custom binds before moving on to the next.
|
||||||
# If null, defaults to the width of the terminal instead.
|
# If null, defaults to the width of the terminal instead.
|
||||||
|
|
@ -287,9 +238,24 @@ gameoflife_frame_delay = 6
|
||||||
# 0.7+ -> Dense, chaotic patterns
|
# 0.7+ -> Dense, chaotic patterns
|
||||||
gameoflife_initial_density = 0.4
|
gameoflife_initial_density = 0.4
|
||||||
|
|
||||||
|
# Command executed when pressing hibernate key (can be null)
|
||||||
|
hibernate_cmd = null
|
||||||
|
|
||||||
|
# Specifies the key combination used for hibernate
|
||||||
|
hibernate_key = F4
|
||||||
|
|
||||||
# Remove main box borders
|
# Remove main box borders
|
||||||
hide_borders = false
|
hide_borders = false
|
||||||
|
|
||||||
|
# Remove power management command hints
|
||||||
|
hide_key_hints = false
|
||||||
|
|
||||||
|
# Remove keyboard lock states from the top right corner
|
||||||
|
hide_keyboard_locks = false
|
||||||
|
|
||||||
|
# Remove version number from the top left corner
|
||||||
|
hide_version_string = false
|
||||||
|
|
||||||
# Command executed when no input is detected for a certain time
|
# Command executed when no input is detected for a certain time
|
||||||
# If null, no command will be executed
|
# If null, no command will be executed
|
||||||
inactivity_cmd = null
|
inactivity_cmd = null
|
||||||
|
|
@ -324,11 +290,7 @@ login_defs_path = /etc/login.defs
|
||||||
# no need to add `exec "$@"` at the end
|
# no need to add `exec "$@"` at the end
|
||||||
logout_cmd = null
|
logout_cmd = null
|
||||||
|
|
||||||
# The file pointing to the Lua file to be used when using the Lua animation option
|
|
||||||
lua_animation_file = $CONFIG_DIRECTORY/ly/example.lua
|
|
||||||
|
|
||||||
# General log file path
|
# General log file path
|
||||||
# If null, syslog will be used instead
|
|
||||||
ly_log = /var/log/ly.log
|
ly_log = /var/log/ly.log
|
||||||
|
|
||||||
# Main box horizontal margin
|
# Main box horizontal margin
|
||||||
|
|
@ -344,13 +306,14 @@ numlock = false
|
||||||
# If null, ly doesn't set a path
|
# If null, ly doesn't set a path
|
||||||
path = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
path = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
|
||||||
|
# Command executed when pressing restart_key
|
||||||
|
restart_cmd = /sbin/shutdown -r now
|
||||||
|
|
||||||
# Specifies the key combination used for restart
|
# Specifies the key combination used for restart
|
||||||
# If null, the keybind is disabled and isn't shown
|
|
||||||
restart_key = F2
|
restart_key = F2
|
||||||
|
|
||||||
# Absolute directory for the save file
|
# Save the current desktop and login as defaults, and load them on startup
|
||||||
# If null, current desktop & login won't be saved nor loaded
|
save = true
|
||||||
save_file_dir = $CONFIG_DIRECTORY/ly
|
|
||||||
|
|
||||||
# Service name (set to ly to use the provided pam config file)
|
# Service name (set to ly to use the provided pam config file)
|
||||||
service_name = ly
|
service_name = ly
|
||||||
|
|
@ -372,13 +335,25 @@ setup_cmd = $CONFIG_DIRECTORY/ly/setup.sh
|
||||||
shell = true
|
shell = true
|
||||||
|
|
||||||
# Specifies the key combination used for showing the password
|
# Specifies the key combination used for showing the password
|
||||||
# If null, the keybind is disabled and isn't shown
|
|
||||||
show_password_key = F7
|
show_password_key = F7
|
||||||
|
|
||||||
|
# Display the active TTY number (e.g. tty3) to the right of the clock in the top right corner
|
||||||
|
# If the clock is disabled, the TTY label occupies the top right corner on its own
|
||||||
|
# If false, the TTY number will not be shown
|
||||||
|
show_tty = false
|
||||||
|
|
||||||
|
# Command executed when pressing shutdown_key
|
||||||
|
shutdown_cmd = /sbin/shutdown $PLATFORM_SHUTDOWN_ARG now
|
||||||
|
|
||||||
# Specifies the key combination used for shutdown
|
# Specifies the key combination used for shutdown
|
||||||
# If null, the keybind is disabled and isn't shown
|
|
||||||
shutdown_key = F1
|
shutdown_key = F1
|
||||||
|
|
||||||
|
# Command executed when pressing sleep key (can be null)
|
||||||
|
sleep_cmd = null
|
||||||
|
|
||||||
|
# Specifies the key combination used for sleep
|
||||||
|
sleep_key = F3
|
||||||
|
|
||||||
# Command executed when starting Ly (before the TTY is taken control of)
|
# Command executed when starting Ly (before the TTY is taken control of)
|
||||||
# See file at path below for an example of changing the default TTY colors
|
# See file at path below for an example of changing the default TTY colors
|
||||||
start_cmd = $CONFIG_DIRECTORY/ly/startup.sh
|
start_cmd = $CONFIG_DIRECTORY/ly/startup.sh
|
||||||
|
|
@ -386,10 +361,6 @@ start_cmd = $CONFIG_DIRECTORY/ly/startup.sh
|
||||||
# Center the session name.
|
# Center the session name.
|
||||||
text_in_center = false
|
text_in_center = false
|
||||||
|
|
||||||
# If true, user will need to manually type username instead of selecting from the list
|
|
||||||
# of discovered users
|
|
||||||
type_username = false
|
|
||||||
|
|
||||||
# Default vi mode
|
# Default vi mode
|
||||||
# normal -> normal mode
|
# normal -> normal mode
|
||||||
# insert -> insert mode
|
# insert -> insert mode
|
||||||
|
|
|
||||||
119
res/example.lua
119
res/example.lua
|
|
@ -1,119 +0,0 @@
|
||||||
-- [[
|
|
||||||
-- This is an example of using LuaJIT to create a custom animation in Ly, in this case
|
|
||||||
-- bouncing squares that change colors.
|
|
||||||
--
|
|
||||||
-- You are given the following `ly` table:
|
|
||||||
-- {
|
|
||||||
-- height: number -- The height of the terminal
|
|
||||||
-- width: number -- The width of the terminal
|
|
||||||
-- putCell(byte, fg, bg, x, y) -- Draw a cell.
|
|
||||||
-- All arguments to this function are integers, and
|
|
||||||
-- must be in the unsigned 32-bit integer range: 0 to 2^32-1.
|
|
||||||
-- If an argument cannot be converted to this range, it will throw
|
|
||||||
-- an error.
|
|
||||||
--
|
|
||||||
-- For reference, the XY coordinates (0,0) draw a cell on the top-left
|
|
||||||
-- of the terminal, where the positive-X axis moves right and the
|
|
||||||
-- positive-Y axis moves down.
|
|
||||||
--
|
|
||||||
-- For arguments fg and bg: they are colors in the format
|
|
||||||
-- 0xSSRRGGBB, where SS is for styling. See your
|
|
||||||
-- config.ini for more details.
|
|
||||||
--
|
|
||||||
-- For the byte argument, you may use string.byte to fill this argument.
|
|
||||||
--
|
|
||||||
-- putRect(byte, fg, bg, x, y, w, h) -- Draw a rectangle.
|
|
||||||
-- Arguments are the same as putCell except for w and h, which are also
|
|
||||||
-- unsigned integers. The rectangle will be drawn from the top-left, with
|
|
||||||
-- argument w extending it to the right and argument h extending downwards.
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- putLabel(str, fg, bg, x, y) -- Draw text in argument str. See putCell()
|
|
||||||
-- for info on the rest of the arguments.
|
|
||||||
--
|
|
||||||
-- clock() -- The time, in microseconds.
|
|
||||||
-- }
|
|
||||||
--
|
|
||||||
-- A function named `draw()` must be declared in the script. This is ran every
|
|
||||||
-- frame.
|
|
||||||
--
|
|
||||||
-- In addition to the base library, you are also given the following standard
|
|
||||||
-- libraries:
|
|
||||||
-- bit (A library exclusive to LuaJIT, see https://bitop.luajit.org/api.html)
|
|
||||||
-- math
|
|
||||||
-- string
|
|
||||||
-- table
|
|
||||||
--
|
|
||||||
-- The std libraries io and debug are NOT included.
|
|
||||||
--
|
|
||||||
-- ]]
|
|
||||||
|
|
||||||
-- You should probably copy FPS and FPS_COUNT into any future LuaJIT animations
|
|
||||||
-- you create.
|
|
||||||
local FPS_COUNT = 40
|
|
||||||
local function FPS()
|
|
||||||
return (1 / FPS_COUNT) * 1000000
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local SQUARE_WIDTH = 10
|
|
||||||
local SQUARE_HEIGHT = 5
|
|
||||||
|
|
||||||
local SQUARE_COUNT = 25
|
|
||||||
|
|
||||||
local squares = {}
|
|
||||||
|
|
||||||
for i = 1, SQUARE_COUNT do
|
|
||||||
local vx = 1
|
|
||||||
local vy = 1
|
|
||||||
if math.random(1, 2) == 2 then vx = -vx end
|
|
||||||
if math.random(1, 2) == 2 then vy = -vy end
|
|
||||||
squares[#squares + 1] = {
|
|
||||||
x = math.random(1, ly.width - SQUARE_WIDTH),
|
|
||||||
y = math.random(1, ly.height - SQUARE_HEIGHT),
|
|
||||||
vx = vx,
|
|
||||||
vy = vy,
|
|
||||||
color = math.random(0xFFFFFF)
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local timer = ly.clock()
|
|
||||||
local perf = ly.clock()
|
|
||||||
|
|
||||||
function draw()
|
|
||||||
-- Rather than progressing the animation by frame, do it based on
|
|
||||||
-- seconds, via ly.clock(). In this timeframe, you can update the animation
|
|
||||||
-- state.
|
|
||||||
-- DO NOT DRAW CELLS IN THIS TIMEFRAME. You will get flickering.
|
|
||||||
|
|
||||||
-- if this check passes, we can update the animation
|
|
||||||
if timer + FPS() < ly.clock() then
|
|
||||||
for i, v in ipairs(squares) do
|
|
||||||
v.x = v.x + v.vx
|
|
||||||
v.y = v.y + v.vy
|
|
||||||
if v.x == 0 then
|
|
||||||
v.vx = 1; v.color = math.random(0xFFFFFF)
|
|
||||||
end
|
|
||||||
if v.x + SQUARE_WIDTH >= ly.width - 1 then
|
|
||||||
v.vx = -1; v.color = math.random(0xFFFFFF)
|
|
||||||
end
|
|
||||||
if v.y == 0 then
|
|
||||||
v.vy = 1; v.color = math.random(0xFFFFFF)
|
|
||||||
end
|
|
||||||
if v.y + SQUARE_HEIGHT >= ly.height - 1 then
|
|
||||||
v.vy = -1; v.color = math.random(0xFFFFFF)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
timer = ly.clock()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
for i, v in ipairs(squares) do
|
|
||||||
ly.putRect(string.byte(' '), 0, v.color, v.x, v.y, SQUARE_WIDTH, SQUARE_HEIGHT)
|
|
||||||
end
|
|
||||||
|
|
||||||
local new_perf = ly.clock()
|
|
||||||
local str = "FT: " .. ((new_perf - perf) / 1000) .. "ms"
|
|
||||||
ly.putLabel(str, 0x00FFFFFF, 0, (ly.width / 2) - (string.len(str) / 2), ly.height - 1)
|
|
||||||
perf = new_perf
|
|
||||||
end
|
|
||||||
|
|
@ -2,29 +2,29 @@ authenticating = جاري المصادقة...
|
||||||
brightness_down = خفض السطوع
|
brightness_down = خفض السطوع
|
||||||
brightness_up = رفع السطوع
|
brightness_up = رفع السطوع
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = مخصص
|
|
||||||
custom_info_err_output_long = الإخراج طويل جداً
|
|
||||||
custom_info_err_no_output = لا يوجد إخراج
|
|
||||||
custom_info_err_no_output_error = ، خطأ محتمل
|
|
||||||
err_alloc = فشل في تخصيص الذاكرة
|
err_alloc = فشل في تخصيص الذاكرة
|
||||||
err_args = تعذر تحليل وسيطات سطر الأوامر
|
|
||||||
err_autologin_session = لم يتم العثور على جلسة تسجيل الدخول التلقائي
|
|
||||||
err_bounds = out-of-bounds index
|
err_bounds = out-of-bounds index
|
||||||
err_brightness_change = فشل في تغيير سطوع الشاشة
|
err_brightness_change = فشل في تغيير سطوع الشاشة
|
||||||
err_chdir = فشل في فتح مجلد المنزل
|
err_chdir = فشل في فتح مجلد المنزل
|
||||||
err_clock_too_long = نص الساعة طويل جداً
|
|
||||||
err_config = فشل في تفسير ملف الإعدادات
|
err_config = فشل في تفسير ملف الإعدادات
|
||||||
err_crawl = فشل الزحف في أدلة الجلسة
|
|
||||||
err_dgn_oob = رسالة سجل (Log)
|
err_dgn_oob = رسالة سجل (Log)
|
||||||
err_domain = اسم نطاق غير صالح
|
err_domain = اسم نطاق غير صالح
|
||||||
err_empty_password = لا يُسمح بكلمة مرور فارغة
|
err_empty_password = لا يُسمح بكلمة مرور فارغة
|
||||||
err_envlist = فشل في جلب قائمة المتغيرات البيئية
|
err_envlist = فشل في جلب قائمة المتغيرات البيئية
|
||||||
err_get_active_tty = فشل الحصول على tty النشط
|
|
||||||
err_hibernate = فشل تنفيذ أمر الإسبات
|
|
||||||
err_hostname = فشل في جلب اسم المضيف (Hostname)
|
err_hostname = فشل في جلب اسم المضيف (Hostname)
|
||||||
err_inactivity = فشل تنفيذ أمر عدم النشاط
|
|
||||||
err_lock_state = فشل الحصول على حالة القفل
|
|
||||||
err_log = فشل فتح ملف السجل
|
|
||||||
err_mlock = فشل في تأمين ذاكرة كلمة المرور (mlock)
|
err_mlock = فشل في تأمين ذاكرة كلمة المرور (mlock)
|
||||||
err_null = مؤشر فارغ (Null pointer)
|
err_null = مؤشر فارغ (Null pointer)
|
||||||
err_numlock = فشل في ضبط Num Lock
|
err_numlock = فشل في ضبط Num Lock
|
||||||
|
|
@ -50,12 +50,12 @@ err_perm_group = فشل في تخفيض صلاحيات المجموعة (Group p
|
||||||
err_perm_user = فشل في تخفيض صلاحيات المستخدم (User permissions)
|
err_perm_user = فشل في تخفيض صلاحيات المستخدم (User permissions)
|
||||||
err_pwnam = فشل في جلب معلومات المستخدم
|
err_pwnam = فشل في جلب معلومات المستخدم
|
||||||
err_sleep = فشل في تنفيذ أمر sleep
|
err_sleep = فشل في تنفيذ أمر sleep
|
||||||
err_start = فشل تنفيذ أمر البدء
|
|
||||||
err_battery = فشل تحميل حالة البطارية
|
|
||||||
err_switch_tty = فشل تبديل tty
|
|
||||||
err_tty_ctrl = فشل في نقل تحكم الطرفية (TTY)
|
err_tty_ctrl = فشل في نقل تحكم الطرفية (TTY)
|
||||||
err_no_users = لم يتم العثور على مستخدمين
|
|
||||||
err_uid_range = فشل الحصول الديناميكي على نطاق uid
|
|
||||||
err_user_gid = فشل في تعيين معرّف المجموعة (GID) للمستخدم
|
err_user_gid = فشل في تعيين معرّف المجموعة (GID) للمستخدم
|
||||||
err_user_init = فشل في تهيئة بيانات المستخدم
|
err_user_init = فشل في تهيئة بيانات المستخدم
|
||||||
err_user_uid = فشل في تعيين معرّف المستخدم (UID)
|
err_user_uid = فشل في تعيين معرّف المستخدم (UID)
|
||||||
|
|
@ -63,11 +63,11 @@ err_xauth = فشل في تنفيذ أمر xauth
|
||||||
err_xcb_conn = فشل في الاتصال بمكتبة XCB
|
err_xcb_conn = فشل في الاتصال بمكتبة XCB
|
||||||
err_xsessions_dir = فشل في العثور على مجلد Xsessions
|
err_xsessions_dir = فشل في العثور على مجلد Xsessions
|
||||||
err_xsessions_open = فشل في فتح مجلد Xsessions
|
err_xsessions_open = فشل في فتح مجلد Xsessions
|
||||||
hibernate = إسبات
|
|
||||||
insert = ادخال
|
insert = ادخال
|
||||||
login = تسجيل الدخول
|
login = تسجيل الدخول
|
||||||
logout = تم تسجيل خروجك
|
logout = تم تسجيل خروجك
|
||||||
no_x11_support = دعم x11 معطّل في وقت الترجمة
|
no_x11_support = تم تعطيل دعم x11 اثناء وقت الـ compile
|
||||||
normal = عادي
|
normal = عادي
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = اخر
|
other = اخر
|
||||||
|
|
@ -76,7 +76,7 @@ restart = اعادة التشغيل
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = ايقاف التشغيل
|
shutdown = ايقاف التشغيل
|
||||||
sleep = وضع السكون
|
sleep = وضع السكون
|
||||||
toggle_password = إظهار/إخفاء كلمة المرور
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = x11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -2,29 +2,29 @@ authenticating = autenticant...
|
||||||
brightness_down = abaixar brillantor
|
brightness_down = abaixar brillantor
|
||||||
brightness_up = apujar brillantor
|
brightness_up = apujar brillantor
|
||||||
capslock = Bloq Majús
|
capslock = Bloq Majús
|
||||||
custom = personalitzat
|
|
||||||
custom_info_err_output_long = sortida massa llarga
|
|
||||||
custom_info_err_no_output = sense sortida
|
|
||||||
custom_info_err_no_output_error = , possible error
|
|
||||||
err_alloc = assignació de memòria fallida
|
err_alloc = assignació de memòria fallida
|
||||||
err_args = no s'han pogut analitzar els arguments de la línia d'ordres
|
|
||||||
err_autologin_session = no s'ha trobat la sessió d'inici de sessió automàtic
|
|
||||||
err_bounds = índex fora de límits
|
err_bounds = índex fora de límits
|
||||||
err_brightness_change = error en canviar la brillantor
|
err_brightness_change = error en canviar la brillantor
|
||||||
err_chdir = error en obrir la carpeta home
|
err_chdir = error en obrir la carpeta home
|
||||||
err_clock_too_long = la cadena del rellotge és massa llarga
|
|
||||||
err_config = no s'ha pogut analitzar el fitxer de configuració
|
|
||||||
err_crawl = no s'han pogut explorar els directoris de sessió
|
|
||||||
err_dgn_oob = missatge de registre
|
err_dgn_oob = missatge de registre
|
||||||
err_domain = domini invàlid
|
err_domain = domini invàlid
|
||||||
err_empty_password = no es permet la contrasenya buida
|
|
||||||
err_envlist = error en obtenir l'envlist
|
err_envlist = error en obtenir l'envlist
|
||||||
err_get_active_tty = no s'ha pogut obtenir el tty actiu
|
|
||||||
err_hibernate = no s'ha pogut executar l'ordre d'hibernació
|
|
||||||
err_hostname = error en obtenir el nom de l'amfitrió
|
err_hostname = error en obtenir el nom de l'amfitrió
|
||||||
err_inactivity = no s'ha pogut executar l'ordre d'inactivitat
|
|
||||||
err_lock_state = no s'ha pogut obtenir l'estat de bloqueig
|
|
||||||
err_log = no s'ha pogut obrir el fitxer de registre
|
|
||||||
err_mlock = error en bloquejar la memòria de clau
|
err_mlock = error en bloquejar la memòria de clau
|
||||||
err_null = punter nul
|
err_null = punter nul
|
||||||
err_numlock = error en establir el Bloq num
|
err_numlock = error en establir el Bloq num
|
||||||
|
|
@ -49,13 +49,13 @@ err_perm_dir = error en canviar el directori actual
|
||||||
err_perm_group = error en degradar els permisos de grup
|
err_perm_group = error en degradar els permisos de grup
|
||||||
err_perm_user = error en degradar els permisos de l'usuari
|
err_perm_user = error en degradar els permisos de l'usuari
|
||||||
err_pwnam = error en obtenir la informació de l'usuari
|
err_pwnam = error en obtenir la informació de l'usuari
|
||||||
err_sleep = no s'ha pogut executar l'ordre de suspensió
|
|
||||||
err_start = no s'ha pogut executar l'ordre d'inici
|
|
||||||
err_battery = no s'ha pogut carregar l'estat de la bateria
|
|
||||||
err_switch_tty = no s'ha pogut canviar de tty
|
|
||||||
err_tty_ctrl = ha fallat la transferència del control tty
|
|
||||||
err_no_users = no s'han trobat usuaris
|
|
||||||
err_uid_range = no s'ha pogut obtenir dinàmicament el rang d'uid
|
|
||||||
err_user_gid = error en establir el GID de l'usuari
|
err_user_gid = error en establir el GID de l'usuari
|
||||||
err_user_init = error en inicialitzar usuari
|
err_user_init = error en inicialitzar usuari
|
||||||
err_user_uid = error en establir l'UID de l'usuari
|
err_user_uid = error en establir l'UID de l'usuari
|
||||||
|
|
@ -63,20 +63,20 @@ err_xauth = error en la comanda xauth
|
||||||
err_xcb_conn = error en la connexió xcb
|
err_xcb_conn = error en la connexió xcb
|
||||||
err_xsessions_dir = error en trobar la carpeta de sessions
|
err_xsessions_dir = error en trobar la carpeta de sessions
|
||||||
err_xsessions_open = error en obrir la carpeta de sessions
|
err_xsessions_open = error en obrir la carpeta de sessions
|
||||||
hibernate = hibernar
|
|
||||||
insert = inserir
|
insert = inserir
|
||||||
login = iniciar sessió
|
login = iniciar sessió
|
||||||
logout = sessió tancada
|
logout = sessió tancada
|
||||||
no_x11_support = suport x11 desactivat en temps de compilació
|
no_x11_support = el suport per x11 ha estat desactivat en la compilació
|
||||||
normal = normal
|
normal = normal
|
||||||
numlock = Bloq Num
|
numlock = Bloq Num
|
||||||
other = altres
|
|
||||||
password = Clau
|
password = Clau
|
||||||
restart = reiniciar
|
restart = reiniciar
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = aturar
|
shutdown = aturar
|
||||||
sleep = suspendre
|
sleep = suspendre
|
||||||
toggle_password = mostrar/amagar contrasenya
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = x11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
authenticating = ověřování...
|
|
||||||
brightness_down = snížit jas
|
|
||||||
brightness_up = zvýšit jas
|
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = vlastní
|
|
||||||
custom_info_err_output_long = výstup je příliš dlouhý
|
|
||||||
custom_info_err_no_output = žádný výstup
|
|
||||||
custom_info_err_no_output_error = , možná chyba
|
|
||||||
err_alloc = alokace paměti selhala
|
err_alloc = alokace paměti selhala
|
||||||
err_args = nelze analyzovat argumenty příkazového řádku
|
|
||||||
err_autologin_session = relace automatického přihlášení nebyla nalezena
|
|
||||||
err_bounds = index je mimo hranice pole
|
err_bounds = index je mimo hranice pole
|
||||||
err_brightness_change = nepodařilo se změnit jas
|
|
||||||
err_chdir = nelze otevřít domovský adresář
|
err_chdir = nelze otevřít domovský adresář
|
||||||
err_clock_too_long = řetězec hodin je příliš dlouhý
|
|
||||||
err_config = nelze analyzovat konfigurační soubor
|
|
||||||
err_crawl = nepodařilo se prohledat adresáře relací
|
|
||||||
err_dgn_oob = zpráva protokolu
|
err_dgn_oob = zpráva protokolu
|
||||||
err_domain = neplatná doména
|
err_domain = neplatná doména
|
||||||
err_empty_password = prázdné heslo není povoleno
|
|
||||||
err_envlist = nepodařilo se získat seznam proměnných prostředí
|
|
||||||
err_get_active_tty = nepodařilo se získat aktivní tty
|
|
||||||
err_hibernate = nepodařilo se spustit příkaz hibernace
|
|
||||||
err_hostname = nelze získat název hostitele
|
err_hostname = nelze získat název hostitele
|
||||||
err_inactivity = nepodařilo se spustit příkaz nečinnosti
|
|
||||||
err_lock_state = nepodařilo se získat stav zámku
|
|
||||||
err_log = nepodařilo se otevřít soubor protokolu
|
|
||||||
err_mlock = uzamčení paměti hesel selhalo
|
err_mlock = uzamčení paměti hesel selhalo
|
||||||
err_null = nulový ukazatel
|
err_null = nulový ukazatel
|
||||||
err_numlock = nepodařilo se nastavit numlock
|
|
||||||
err_pam = pam transakce selhala
|
err_pam = pam transakce selhala
|
||||||
err_pam_abort = pam transakce přerušena
|
err_pam_abort = pam transakce přerušena
|
||||||
err_pam_acct_expired = platnost účtu vypršela
|
err_pam_acct_expired = platnost účtu vypršela
|
||||||
|
|
@ -49,34 +49,34 @@ err_perm_dir = nepodařilo se změnit adresář
|
||||||
err_perm_group = nepodařilo se snížit skupinová oprávnění
|
err_perm_group = nepodařilo se snížit skupinová oprávnění
|
||||||
err_perm_user = nepodařilo se snížit uživatelská oprávnění
|
err_perm_user = nepodařilo se snížit uživatelská oprávnění
|
||||||
err_pwnam = nelze získat informace o uživateli
|
err_pwnam = nelze získat informace o uživateli
|
||||||
err_sleep = nepodařilo se spustit příkaz spánku
|
|
||||||
err_start = nepodařilo se spustit příkaz spuštění
|
|
||||||
err_battery = nepodařilo se načíst stav baterie
|
|
||||||
err_switch_tty = nepodařilo se přepnout tty
|
|
||||||
err_tty_ctrl = přenos řízení tty selhal
|
|
||||||
err_no_users = nebyli nalezeni žádní uživatelé
|
|
||||||
err_uid_range = nepodařilo se dynamicky získat rozsah uid
|
|
||||||
err_user_gid = nastavení GID uživatele selhalo
|
err_user_gid = nastavení GID uživatele selhalo
|
||||||
err_user_init = inicializace uživatele selhala
|
err_user_init = inicializace uživatele selhala
|
||||||
err_user_uid = nastavení UID uživateli selhalo
|
err_user_uid = nastavení UID uživateli selhalo
|
||||||
err_xauth = příkaz xauth selhal
|
|
||||||
err_xcb_conn = připojení xcb selhalo
|
|
||||||
err_xsessions_dir = nepodařilo se najít složku relací
|
err_xsessions_dir = nepodařilo se najít složku relací
|
||||||
err_xsessions_open = nepodařilo se otevřít složku relací
|
err_xsessions_open = nepodařilo se otevřít složku relací
|
||||||
hibernate = hibernace
|
|
||||||
insert = vložit
|
|
||||||
login = uživatel
|
login = uživatel
|
||||||
logout = odhlášen
|
logout = odhlášen
|
||||||
no_x11_support = podpora x11 zakázána při kompilaci
|
|
||||||
normal = normální
|
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = jiné
|
|
||||||
password = heslo
|
password = heslo
|
||||||
restart = restartovat
|
restart = restartovat
|
||||||
shell = příkazový řádek
|
shell = příkazový řádek
|
||||||
shutdown = vypnout
|
shutdown = vypnout
|
||||||
sleep = uspat
|
|
||||||
toggle_password = zobrazit/skrýt heslo
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -2,29 +2,29 @@ authenticating = authentifizieren...
|
||||||
brightness_down = Helligkeit-
|
brightness_down = Helligkeit-
|
||||||
brightness_up = Helligkeit+
|
brightness_up = Helligkeit+
|
||||||
capslock = Feststelltaste
|
capslock = Feststelltaste
|
||||||
custom = benutzerdefiniert
|
|
||||||
custom_info_err_output_long = Ausgabe zu lang
|
|
||||||
custom_info_err_no_output = keine Ausgabe
|
|
||||||
custom_info_err_no_output_error = , möglicher Fehler
|
|
||||||
err_alloc = Speicherzuweisung fehlgeschlagen
|
err_alloc = Speicherzuweisung fehlgeschlagen
|
||||||
err_args = Kommandozeilenargumente konnten nicht verarbeitet werden
|
|
||||||
err_autologin_session = Autologin-Sitzung nicht gefunden
|
|
||||||
err_bounds = Index ausserhalb des Bereichs
|
err_bounds = Index ausserhalb des Bereichs
|
||||||
err_brightness_change = Helligkeitsänderung fehlgeschlagen
|
err_brightness_change = Helligkeitsänderung fehlgeschlagen
|
||||||
err_chdir = Fehler beim Oeffnen des Home-Ordners
|
err_chdir = Fehler beim Oeffnen des Home-Ordners
|
||||||
err_clock_too_long = Uhrzeitzeichenkette zu lang
|
|
||||||
err_config = Fehler beim Verarbeiten der Konfigurationsdatei
|
err_config = Fehler beim Verarbeiten der Konfigurationsdatei
|
||||||
err_crawl = Sitzungsverzeichnisse konnten nicht durchsucht werden
|
|
||||||
err_dgn_oob = Diagnose-Nachricht
|
err_dgn_oob = Diagnose-Nachricht
|
||||||
err_domain = Ungueltige Domain
|
err_domain = Ungueltige Domain
|
||||||
err_empty_password = Leeres Passwort nicht zugelassen
|
err_empty_password = Leeres Passwort nicht zugelassen
|
||||||
err_envlist = Fehler beim Abrufen der Umgebungs-Variablen
|
err_envlist = Fehler beim Abrufen der Umgebungs-Variablen
|
||||||
err_get_active_tty = Aktives tty konnte nicht ermittelt werden
|
|
||||||
err_hibernate = Ruhezustand-Befehl konnte nicht ausgeführt werden
|
|
||||||
err_hostname = Abrufen des Hostnames fehlgeschlagen
|
err_hostname = Abrufen des Hostnames fehlgeschlagen
|
||||||
err_inactivity = Inaktivitätsbefehl konnte nicht ausgeführt werden
|
|
||||||
err_lock_state = Sperrstatus konnte nicht ermittelt werden
|
|
||||||
err_log = Protokolldatei konnte nicht geöffnet werden
|
|
||||||
err_mlock = Sperren des Passwortspeichers fehlgeschlagen
|
err_mlock = Sperren des Passwortspeichers fehlgeschlagen
|
||||||
err_null = Null Pointer
|
err_null = Null Pointer
|
||||||
err_numlock = Numlock konnte nicht aktiviert werden
|
err_numlock = Numlock konnte nicht aktiviert werden
|
||||||
|
|
@ -50,12 +50,12 @@ err_perm_group = Fehler beim Heruntersetzen der Gruppenberechtigungen
|
||||||
err_perm_user = Fehler beim Heruntersetzen der Nutzerberechtigungen
|
err_perm_user = Fehler beim Heruntersetzen der Nutzerberechtigungen
|
||||||
err_pwnam = Abrufen der Benutzerinformationen fehlgeschlagen
|
err_pwnam = Abrufen der Benutzerinformationen fehlgeschlagen
|
||||||
err_sleep = Sleep-Befehl fehlgeschlagen
|
err_sleep = Sleep-Befehl fehlgeschlagen
|
||||||
err_start = Startbefehl konnte nicht ausgeführt werden
|
|
||||||
err_battery = Akkustand konnte nicht geladen werden
|
|
||||||
err_switch_tty = tty konnte nicht gewechselt werden
|
|
||||||
err_tty_ctrl = Fehler bei der TTY-Uebergabe
|
err_tty_ctrl = Fehler bei der TTY-Uebergabe
|
||||||
err_no_users = Keine Benutzer gefunden
|
|
||||||
err_uid_range = uid-Bereich konnte nicht dynamisch ermittelt werden
|
|
||||||
err_user_gid = Fehler beim Setzen der Gruppen-ID
|
err_user_gid = Fehler beim Setzen der Gruppen-ID
|
||||||
err_user_init = Nutzer-Initialisierung fehlgeschlagen
|
err_user_init = Nutzer-Initialisierung fehlgeschlagen
|
||||||
err_user_uid = Setzen der Benutzer-ID fehlgeschlagen
|
err_user_uid = Setzen der Benutzer-ID fehlgeschlagen
|
||||||
|
|
@ -63,11 +63,11 @@ err_xauth = Xauth-Befehl fehlgeschlagen
|
||||||
err_xcb_conn = xcb-Verbindung fehlgeschlagen
|
err_xcb_conn = xcb-Verbindung fehlgeschlagen
|
||||||
err_xsessions_dir = Fehler beim Finden des Sitzungsordners
|
err_xsessions_dir = Fehler beim Finden des Sitzungsordners
|
||||||
err_xsessions_open = Fehler beim Oeffnen des Sitzungsordners
|
err_xsessions_open = Fehler beim Oeffnen des Sitzungsordners
|
||||||
hibernate = Ruhezustand
|
|
||||||
insert = Einfügen
|
insert = Einfügen
|
||||||
login = Nutzer
|
login = Nutzer
|
||||||
logout = Abmelden
|
logout = Abmelden
|
||||||
no_x11_support = x11-Unterstützung zur Kompilierzeit deaktiviert
|
no_x11_support = X11-Support bei Kompilierung deaktiviert
|
||||||
normal = Normal
|
normal = Normal
|
||||||
numlock = Numlock
|
numlock = Numlock
|
||||||
other = Andere
|
other = Andere
|
||||||
|
|
@ -76,7 +76,7 @@ restart = Neustarten
|
||||||
shell = Shell
|
shell = Shell
|
||||||
shutdown = Herunterfahren
|
shutdown = Herunterfahren
|
||||||
sleep = Sleep
|
sleep = Sleep
|
||||||
toggle_password = Passwort anzeigen/verbergen
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = X11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ brightness_down = malpliigi helecon
|
||||||
brightness_up = pliigi helecon
|
brightness_up = pliigi helecon
|
||||||
capslock = majuskla baskulo
|
capslock = majuskla baskulo
|
||||||
custom = propra
|
custom = propra
|
||||||
custom_info_err_output_long = eligo tro longa
|
|
||||||
custom_info_err_no_output = neniu eligo
|
|
||||||
custom_info_err_no_output_error = , ebla eraro
|
|
||||||
err_alloc = malsukcesis memorasignon
|
err_alloc = malsukcesis memorasignon
|
||||||
err_args = ne povas analizi argumentojn de komanda linio
|
err_args = ne povas analizi argumentojn de komanda linio
|
||||||
err_autologin_session = aŭtomatan ensalutan seancon ne trovis
|
err_autologin_session = aŭtomatan ensalutan seancon ne trovis
|
||||||
|
|
@ -76,7 +76,7 @@ restart = restartigi
|
||||||
shell = ŝelo
|
shell = ŝelo
|
||||||
shutdown = malŝalti
|
shutdown = malŝalti
|
||||||
sleep = memordormi
|
sleep = memordormi
|
||||||
toggle_password = montri/kaŝi pasvorton
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = x11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -2,32 +2,32 @@ authenticating = autenticando...
|
||||||
brightness_down = bajar brillo
|
brightness_down = bajar brillo
|
||||||
brightness_up = subir brillo
|
brightness_up = subir brillo
|
||||||
capslock = Bloq Mayús
|
capslock = Bloq Mayús
|
||||||
custom = personalizado
|
|
||||||
custom_info_err_output_long = salida demasiado larga
|
|
||||||
custom_info_err_no_output = sin salida
|
|
||||||
custom_info_err_no_output_error = , posible error
|
|
||||||
err_alloc = asignación de memoria fallida
|
err_alloc = asignación de memoria fallida
|
||||||
err_args = no se pudieron analizar los argumentos de la línea de comandos
|
|
||||||
err_autologin_session = no se encontró la sesión de inicio de sesión automático
|
|
||||||
err_bounds = índice fuera de límites
|
err_bounds = índice fuera de límites
|
||||||
err_brightness_change = no se pudo cambiar el brillo
|
|
||||||
err_chdir = error al abrir la carpeta home
|
err_chdir = error al abrir la carpeta home
|
||||||
err_clock_too_long = la cadena del reloj es demasiado larga
|
|
||||||
err_config = no se pudo analizar el archivo de configuración
|
|
||||||
err_crawl = no se pudieron explorar los directorios de sesión
|
|
||||||
err_dgn_oob = mensaje de registro
|
err_dgn_oob = mensaje de registro
|
||||||
err_domain = dominio inválido
|
err_domain = dominio inválido
|
||||||
err_empty_password = no se permite contraseña vacía
|
|
||||||
err_envlist = no se pudo obtener la lista de variables de entorno
|
|
||||||
err_get_active_tty = no se pudo obtener el tty activo
|
|
||||||
err_hibernate = no se pudo ejecutar el comando de hibernación
|
|
||||||
err_hostname = error al obtener el nombre de host
|
err_hostname = error al obtener el nombre de host
|
||||||
err_inactivity = no se pudo ejecutar el comando de inactividad
|
|
||||||
err_lock_state = no se pudo obtener el estado de bloqueo
|
|
||||||
err_log = no se pudo abrir el archivo de registro
|
|
||||||
err_mlock = error al bloquear la contraseña de memoria
|
err_mlock = error al bloquear la contraseña de memoria
|
||||||
err_null = puntero nulo
|
err_null = puntero nulo
|
||||||
err_numlock = no se pudo configurar numlock
|
|
||||||
err_pam = error en la transacción pam
|
err_pam = error en la transacción pam
|
||||||
err_pam_abort = transacción pam abortada
|
err_pam_abort = transacción pam abortada
|
||||||
err_pam_acct_expired = cuenta expirada
|
err_pam_acct_expired = cuenta expirada
|
||||||
|
|
@ -49,25 +49,25 @@ err_perm_dir = error al cambiar el directorio actual
|
||||||
err_perm_group = error al degradar los permisos del grupo
|
err_perm_group = error al degradar los permisos del grupo
|
||||||
err_perm_user = error al degradar los permisos del usuario
|
err_perm_user = error al degradar los permisos del usuario
|
||||||
err_pwnam = error al obtener la información del usuario
|
err_pwnam = error al obtener la información del usuario
|
||||||
err_sleep = no se pudo ejecutar el comando de suspensión
|
|
||||||
err_start = no se pudo ejecutar el comando de inicio
|
|
||||||
err_battery = no se pudo cargar el estado de la batería
|
|
||||||
err_switch_tty = no se pudo cambiar de tty
|
|
||||||
err_tty_ctrl = falló la transferencia de control tty
|
|
||||||
err_no_users = no se encontraron usuarios
|
|
||||||
err_uid_range = no se pudo obtener dinámicamente el rango de uid
|
|
||||||
err_user_gid = error al establecer el GID del usuario
|
err_user_gid = error al establecer el GID del usuario
|
||||||
err_user_init = error al inicializar usuario
|
err_user_init = error al inicializar usuario
|
||||||
err_user_uid = error al establecer el UID del usuario
|
err_user_uid = error al establecer el UID del usuario
|
||||||
err_xauth = falló el comando xauth
|
|
||||||
err_xcb_conn = falló la conexión xcb
|
|
||||||
err_xsessions_dir = error al buscar la carpeta de sesiones
|
err_xsessions_dir = error al buscar la carpeta de sesiones
|
||||||
err_xsessions_open = error al abrir la carpeta de sesiones
|
err_xsessions_open = error al abrir la carpeta de sesiones
|
||||||
hibernate = hibernar
|
|
||||||
insert = insertar
|
insert = insertar
|
||||||
login = usuario
|
login = usuario
|
||||||
logout = cerrar sesión
|
logout = cerrar sesión
|
||||||
no_x11_support = soporte x11 desactivado en tiempo de compilación
|
no_x11_support = soporte para x11 deshabilitado en tiempo de compilación
|
||||||
normal = normal
|
normal = normal
|
||||||
numlock = Bloq Num
|
numlock = Bloq Num
|
||||||
other = otro
|
other = otro
|
||||||
|
|
@ -76,7 +76,7 @@ restart = reiniciar
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = apagar
|
shutdown = apagar
|
||||||
sleep = suspender
|
sleep = suspender
|
||||||
toggle_password = mostrar/ocultar contraseña
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
authenticating = autenticazione in corso...
|
|
||||||
brightness_down = diminuisci luminosità
|
|
||||||
brightness_up = aumenta luminosità
|
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = personalizzato
|
|
||||||
custom_info_err_output_long = output troppo lungo
|
|
||||||
custom_info_err_no_output = nessun output
|
|
||||||
custom_info_err_no_output_error = , possibile errore
|
|
||||||
err_alloc = impossibile allocare memoria
|
err_alloc = impossibile allocare memoria
|
||||||
err_args = impossibile analizzare gli argomenti della riga di comando
|
|
||||||
err_autologin_session = sessione di accesso automatico non trovata
|
|
||||||
err_bounds = indice fuori limite
|
err_bounds = indice fuori limite
|
||||||
err_brightness_change = impossibile modificare la luminosità
|
|
||||||
err_chdir = impossibile aprire home directory
|
err_chdir = impossibile aprire home directory
|
||||||
err_clock_too_long = stringa dell'orologio troppo lunga
|
|
||||||
err_config = impossibile analizzare il file di configurazione
|
|
||||||
err_crawl = impossibile esplorare le directory delle sessioni
|
|
||||||
err_dgn_oob = messaggio log
|
err_dgn_oob = messaggio log
|
||||||
err_domain = dominio non valido
|
err_domain = dominio non valido
|
||||||
err_empty_password = password vuota non consentita
|
|
||||||
err_envlist = impossibile ottenere la lista delle variabili d'ambiente
|
|
||||||
err_get_active_tty = impossibile ottenere il tty attivo
|
|
||||||
err_hibernate = impossibile eseguire il comando di ibernazione
|
|
||||||
err_hostname = impossibile ottenere hostname
|
err_hostname = impossibile ottenere hostname
|
||||||
err_inactivity = impossibile eseguire il comando di inattività
|
|
||||||
err_lock_state = impossibile ottenere lo stato di blocco
|
|
||||||
err_log = impossibile aprire il file di log
|
|
||||||
err_mlock = impossibile ottenere lock per la password in memoria
|
err_mlock = impossibile ottenere lock per la password in memoria
|
||||||
err_null = puntatore nullo
|
err_null = puntatore nullo
|
||||||
err_numlock = impossibile impostare il numlock
|
|
||||||
err_pam = transazione PAM fallita
|
err_pam = transazione PAM fallita
|
||||||
err_pam_abort = transazione PAM interrotta
|
err_pam_abort = transazione PAM interrotta
|
||||||
err_pam_acct_expired = account scaduto
|
err_pam_acct_expired = account scaduto
|
||||||
|
|
@ -49,34 +49,34 @@ err_perm_dir = impossibile cambiare directory corrente
|
||||||
err_perm_group = impossibile ridurre permessi gruppo
|
err_perm_group = impossibile ridurre permessi gruppo
|
||||||
err_perm_user = impossibile ridurre permessi utente
|
err_perm_user = impossibile ridurre permessi utente
|
||||||
err_pwnam = impossibile ottenere dati utente
|
err_pwnam = impossibile ottenere dati utente
|
||||||
err_sleep = impossibile eseguire il comando di sospensione
|
|
||||||
err_start = impossibile eseguire il comando di avvio
|
|
||||||
err_battery = impossibile caricare lo stato della batteria
|
|
||||||
err_switch_tty = impossibile cambiare tty
|
|
||||||
err_tty_ctrl = trasferimento del controllo tty fallito
|
|
||||||
err_no_users = nessun utente trovato
|
|
||||||
err_uid_range = impossibile ottenere dinamicamente l'intervallo uid
|
|
||||||
err_user_gid = impossibile impostare GID utente
|
err_user_gid = impossibile impostare GID utente
|
||||||
err_user_init = impossibile inizializzare utente
|
err_user_init = impossibile inizializzare utente
|
||||||
err_user_uid = impossible impostare UID utente
|
err_user_uid = impossible impostare UID utente
|
||||||
err_xauth = comando xauth fallito
|
|
||||||
err_xcb_conn = connessione xcb fallita
|
|
||||||
err_xsessions_dir = impossibile localizzare cartella sessioni
|
err_xsessions_dir = impossibile localizzare cartella sessioni
|
||||||
err_xsessions_open = impossibile aprire cartella sessioni
|
err_xsessions_open = impossibile aprire cartella sessioni
|
||||||
hibernate = ibernazione
|
|
||||||
insert = inserisci
|
|
||||||
login = username
|
login = username
|
||||||
logout = scollegato
|
logout = scollegato
|
||||||
no_x11_support = supporto x11 disabilitato in fase di compilazione
|
|
||||||
normal = normale
|
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = altro
|
|
||||||
password = password
|
password = password
|
||||||
restart = riavvio
|
restart = riavvio
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = arresto
|
shutdown = arresto
|
||||||
sleep = sospendi
|
|
||||||
toggle_password = mostra/nascondi password
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -2,29 +2,29 @@ authenticating = 認証中...
|
||||||
brightness_down = 明るさを下げる
|
brightness_down = 明るさを下げる
|
||||||
brightness_up = 明るさを上げる
|
brightness_up = 明るさを上げる
|
||||||
capslock = CapsLock
|
capslock = CapsLock
|
||||||
custom = カスタム
|
|
||||||
custom_info_err_output_long = 出力が長すぎます
|
|
||||||
custom_info_err_no_output = 出力なし
|
|
||||||
custom_info_err_no_output_error = 、エラーの可能性あり
|
|
||||||
err_alloc = メモリ割り当て失敗
|
err_alloc = メモリ割り当て失敗
|
||||||
err_args = コマンドライン引数を解析できません
|
|
||||||
err_autologin_session = 自動ログインセッションが見つかりません
|
|
||||||
err_bounds = 境界外インデックス
|
err_bounds = 境界外インデックス
|
||||||
err_brightness_change = 明るさの変更に失敗しました
|
err_brightness_change = 明るさの変更に失敗しました
|
||||||
err_chdir = ホームフォルダを開けませんでした
|
err_chdir = ホームフォルダを開けませんでした
|
||||||
err_clock_too_long = 時計の文字列が長すぎます
|
|
||||||
err_config = 設定ファイルを解析できません
|
err_config = 設定ファイルを解析できません
|
||||||
err_crawl = セッションディレクトリのクロールに失敗しました
|
|
||||||
err_dgn_oob = ログメッセージ
|
err_dgn_oob = ログメッセージ
|
||||||
err_domain = 無効なドメイン
|
err_domain = 無効なドメイン
|
||||||
err_empty_password = 空のパスワードは許可されていません
|
err_empty_password = 空のパスワードは許可されていません
|
||||||
err_envlist = 環境変数リストの取得に失敗しました
|
err_envlist = 環境変数リストの取得に失敗しました
|
||||||
err_get_active_tty = アクティブなttyの取得に失敗しました
|
|
||||||
err_hibernate = 休止状態コマンドの実行に失敗しました
|
|
||||||
err_hostname = ホスト名の取得に失敗しました
|
err_hostname = ホスト名の取得に失敗しました
|
||||||
err_inactivity = 無操作コマンドの実行に失敗しました
|
|
||||||
err_lock_state = ロック状態の取得に失敗しました
|
|
||||||
err_log = ログファイルを開けませんでした
|
|
||||||
err_mlock = パスワードメモリのロックに失敗しました
|
err_mlock = パスワードメモリのロックに失敗しました
|
||||||
err_null = ヌルポインタ
|
err_null = ヌルポインタ
|
||||||
err_numlock = NumLockの設定に失敗しました
|
err_numlock = NumLockの設定に失敗しました
|
||||||
|
|
@ -50,12 +50,12 @@ err_perm_group = グループ権限のダウングレードに失敗しました
|
||||||
err_perm_user = ユーザー権限のダウングレードに失敗しました
|
err_perm_user = ユーザー権限のダウングレードに失敗しました
|
||||||
err_pwnam = ユーザー情報の取得に失敗しました
|
err_pwnam = ユーザー情報の取得に失敗しました
|
||||||
err_sleep = スリープコマンドの実行に失敗しました
|
err_sleep = スリープコマンドの実行に失敗しました
|
||||||
err_start = 起動コマンドの実行に失敗しました
|
|
||||||
err_battery = バッテリー状態の読み込みに失敗しました
|
|
||||||
err_switch_tty = ttyの切り替えに失敗しました
|
|
||||||
err_tty_ctrl = TTY制御の転送に失敗しました
|
err_tty_ctrl = TTY制御の転送に失敗しました
|
||||||
err_no_users = ユーザーが見つかりません
|
|
||||||
err_uid_range = uidの範囲を動的に取得できませんでした
|
|
||||||
err_user_gid = ユーザーGIDの設定に失敗しました
|
err_user_gid = ユーザーGIDの設定に失敗しました
|
||||||
err_user_init = ユーザーの初期化に失敗しました
|
err_user_init = ユーザーの初期化に失敗しました
|
||||||
err_user_uid = ユーザーUIDの設定に失敗しました
|
err_user_uid = ユーザーUIDの設定に失敗しました
|
||||||
|
|
@ -63,11 +63,11 @@ err_xauth = xauthコマンドの実行に失敗しました
|
||||||
err_xcb_conn = XCB接続に失敗しました
|
err_xcb_conn = XCB接続に失敗しました
|
||||||
err_xsessions_dir = セッションフォルダが見つかりませんでした
|
err_xsessions_dir = セッションフォルダが見つかりませんでした
|
||||||
err_xsessions_open = セッションフォルダを開けませんでした
|
err_xsessions_open = セッションフォルダを開けませんでした
|
||||||
hibernate = 休止状態
|
|
||||||
insert = 挿入
|
insert = 挿入
|
||||||
login = ログイン
|
login = ログイン
|
||||||
logout = ログアウト済み
|
logout = ログアウト済み
|
||||||
no_x11_support = x11サポートはコンパイル時に無効化されています
|
no_x11_support = X11サポートはコンパイル時に無効化されています
|
||||||
normal = 通常
|
normal = 通常
|
||||||
numlock = NumLock
|
numlock = NumLock
|
||||||
other = その他
|
other = その他
|
||||||
|
|
@ -76,7 +76,7 @@ restart = 再起動
|
||||||
shell = シェル
|
shell = シェル
|
||||||
shutdown = シャットダウン
|
shutdown = シャットダウン
|
||||||
sleep = スリープ
|
sleep = スリープ
|
||||||
toggle_password = パスワードの表示/非表示
|
|
||||||
wayland = Wayland
|
wayland = Wayland
|
||||||
x11 = x11
|
x11 = X11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ brightness_down = ronahiyê kêm bike
|
||||||
brightness_up = ronahiyê bilind bike
|
brightness_up = ronahiyê bilind bike
|
||||||
capslock = tîpên girdek (capslock)
|
capslock = tîpên girdek (capslock)
|
||||||
custom = kesane
|
custom = kesane
|
||||||
custom_info_err_output_long = encam pir dirêj e
|
|
||||||
custom_info_err_no_output = encam tune
|
|
||||||
custom_info_err_no_output_error = , xeletiya mimkun
|
|
||||||
err_alloc = veqetandina bîrê têk çû
|
err_alloc = veqetandina bîrê têk çû
|
||||||
err_args = argumanên rêzika fermanê nehatin analîzkirin
|
err_args = argumanên rêzika fermanê nehatin analîzkirin
|
||||||
err_autologin_session = danişîna têketina xweber nehate dîtin
|
err_autologin_session = danişîna têketina xweber nehate dîtin
|
||||||
|
|
@ -76,7 +76,7 @@ restart = ji nû ve bide destpêkirin
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = vemirîne
|
shutdown = vemirîne
|
||||||
sleep = têxîne xewê
|
sleep = têxîne xewê
|
||||||
toggle_password = şîfre nîşan bide/veşêre
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = x11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -3,26 +3,26 @@ brightness_down = samazināt spilgtumu
|
||||||
brightness_up = palielināt spilgtumu
|
brightness_up = palielināt spilgtumu
|
||||||
capslock = caps lock
|
capslock = caps lock
|
||||||
custom = pielāgots
|
custom = pielāgots
|
||||||
custom_info_err_output_long = izvade pārāk gara
|
|
||||||
custom_info_err_no_output = nav izvades
|
|
||||||
custom_info_err_no_output_error = , iespējama kļūda
|
|
||||||
err_alloc = neizdevās atmiņas piešķiršana
|
err_alloc = neizdevās atmiņas piešķiršana
|
||||||
err_args = nevar parsēt komandrindas argumentus
|
|
||||||
err_autologin_session = automātiskās pieteikšanās sesija nav atrasta
|
|
||||||
err_bounds = indekss ārpus robežām
|
err_bounds = indekss ārpus robežām
|
||||||
err_brightness_change = neizdevās mainīt spilgtumu
|
err_brightness_change = neizdevās mainīt spilgtumu
|
||||||
err_chdir = neizdevās atvērt mājas mapi
|
err_chdir = neizdevās atvērt mājas mapi
|
||||||
err_clock_too_long = pulksteņa virkne pārāk gara
|
err_clock_too_long = pulksteņa virkne pārāk gara
|
||||||
err_config = neizdevās parsēt konfigurācijas failu
|
err_config = neizdevās parsēt konfigurācijas failu
|
||||||
err_crawl = neizdevās pārlūkot sesiju direktorijus
|
|
||||||
err_dgn_oob = žurnāla ziņojums
|
err_dgn_oob = žurnāla ziņojums
|
||||||
err_domain = nederīgs domēns
|
err_domain = nederīgs domēns
|
||||||
err_empty_password = tukša parole nav atļauta
|
err_empty_password = tukša parole nav atļauta
|
||||||
err_envlist = neizdevās iegūt vides mainīgo sarakstu
|
err_envlist = neizdevās iegūt vides mainīgo sarakstu
|
||||||
err_get_active_tty = neizdevās iegūt aktīvo tty
|
err_get_active_tty = neizdevās iegūt aktīvo tty
|
||||||
err_hibernate = neizdevās izpildīt hibernācijas komandu
|
|
||||||
err_hostname = neizdevās iegūt hostname
|
err_hostname = neizdevās iegūt hostname
|
||||||
err_inactivity = neizdevās izpildīt neaktivitātes komandu
|
|
||||||
err_lock_state = neizdevās iegūt bloķēšanas stāvokli
|
err_lock_state = neizdevās iegūt bloķēšanas stāvokli
|
||||||
err_log = neizdevās atvērt žurnāla failu
|
err_log = neizdevās atvērt žurnāla failu
|
||||||
err_mlock = neizdevās bloķēt paroles atmiņu
|
err_mlock = neizdevās bloķēt paroles atmiņu
|
||||||
|
|
@ -50,12 +50,12 @@ err_perm_group = neizdevās pazemināt grupas atļaujas
|
||||||
err_perm_user = neizdevās pazemināt lietotāja atļaujas
|
err_perm_user = neizdevās pazemināt lietotāja atļaujas
|
||||||
err_pwnam = neizdevās iegūt lietotāja informāciju
|
err_pwnam = neizdevās iegūt lietotāja informāciju
|
||||||
err_sleep = neizdevās izpildīt miega komandu
|
err_sleep = neizdevās izpildīt miega komandu
|
||||||
err_start = neizdevās izpildīt startēšanas komandu
|
|
||||||
err_battery = neizdevās ielādēt akumulatora stāvokli
|
err_battery = neizdevās ielādēt akumulatora stāvokli
|
||||||
err_switch_tty = neizdevās pārslēgt tty
|
err_switch_tty = neizdevās pārslēgt tty
|
||||||
err_tty_ctrl = tty vadības nodošana neizdevās
|
err_tty_ctrl = tty vadības nodošana neizdevās
|
||||||
err_no_users = lietotāji nav atrasti
|
err_no_users = lietotāji nav atrasti
|
||||||
err_uid_range = neizdevās dinamiski iegūt uid diapazonu
|
|
||||||
err_user_gid = neizdevās iestatīt lietotāja GID
|
err_user_gid = neizdevās iestatīt lietotāja GID
|
||||||
err_user_init = neizdevās inicializēt lietotāju
|
err_user_init = neizdevās inicializēt lietotāju
|
||||||
err_user_uid = neizdevās iestatīt lietotāja UID
|
err_user_uid = neizdevās iestatīt lietotāja UID
|
||||||
|
|
@ -63,7 +63,7 @@ err_xauth = xauth komanda neizdevās
|
||||||
err_xcb_conn = xcb savienojums neizdevās
|
err_xcb_conn = xcb savienojums neizdevās
|
||||||
err_xsessions_dir = neizdevās atrast sesiju mapi
|
err_xsessions_dir = neizdevās atrast sesiju mapi
|
||||||
err_xsessions_open = neizdevās atvērt sesiju mapi
|
err_xsessions_open = neizdevās atvērt sesiju mapi
|
||||||
hibernate = hibernācija
|
|
||||||
insert = ievietot
|
insert = ievietot
|
||||||
login = lietotājs
|
login = lietotājs
|
||||||
logout = iziet
|
logout = iziet
|
||||||
|
|
@ -76,7 +76,7 @@ restart = restartēt
|
||||||
shell = terminālis
|
shell = terminālis
|
||||||
shutdown = izslēgt
|
shutdown = izslēgt
|
||||||
sleep = snauda
|
sleep = snauda
|
||||||
toggle_password = rādīt/slēpt paroli
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = x11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -3,26 +3,26 @@ brightness_down = zmniejsz jasność
|
||||||
brightness_up = zwiększ jasność
|
brightness_up = zwiększ jasność
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = własny
|
custom = własny
|
||||||
custom_info_err_output_long = wyjście zbyt długie
|
|
||||||
custom_info_err_no_output = brak wyjścia
|
|
||||||
custom_info_err_no_output_error = , możliwy błąd
|
|
||||||
err_alloc = nieudana alokacja pamięci
|
err_alloc = nieudana alokacja pamięci
|
||||||
err_args = nie można przetworzyć argumentów wiersza poleceń
|
|
||||||
err_autologin_session = nie znaleziono sesji autologowania
|
err_autologin_session = nie znaleziono sesji autologowania
|
||||||
err_bounds = indeks poza zakresem
|
err_bounds = indeks poza zakresem
|
||||||
err_brightness_change = nie udało się zmienić jasności
|
err_brightness_change = nie udało się zmienić jasności
|
||||||
err_chdir = nie udało się otworzyć folderu domowego
|
err_chdir = nie udało się otworzyć folderu domowego
|
||||||
err_clock_too_long = ciąg znaków zegara jest za długi
|
err_clock_too_long = ciąg znaków zegara jest za długi
|
||||||
err_config = nie można przetworzyć pliku konfiguracyjnego
|
err_config = nie można przetworzyć pliku konfiguracyjnego
|
||||||
err_crawl = nie udało się przeszukać katalogów sesji
|
|
||||||
err_dgn_oob = wiadomość loga
|
err_dgn_oob = wiadomość loga
|
||||||
err_domain = niepoprawna domena
|
err_domain = niepoprawna domena
|
||||||
err_empty_password = puste hasło jest niedozwolone
|
err_empty_password = puste hasło jest niedozwolone
|
||||||
err_envlist = nie udało się pobrać listy zmiennych środowiskowych
|
err_envlist = nie udało się pobrać listy zmiennych środowiskowych
|
||||||
err_get_active_tty = nie udało się uzyskać aktywnego tty
|
err_get_active_tty = nie udało się uzyskać aktywnego tty
|
||||||
err_hibernate = nie udało się wykonać polecenia hibernacji
|
|
||||||
err_hostname = nie udało się uzyskać nazwy hosta
|
err_hostname = nie udało się uzyskać nazwy hosta
|
||||||
err_inactivity = nie udało się wykonać polecenia nieaktywności
|
|
||||||
err_lock_state = nie udało się uzyskać stanu blokady
|
err_lock_state = nie udało się uzyskać stanu blokady
|
||||||
err_log = nie udało się otworzyć pliku logu
|
err_log = nie udało się otworzyć pliku logu
|
||||||
err_mlock = nie udało się zablokować pamięci haseł
|
err_mlock = nie udało się zablokować pamięci haseł
|
||||||
|
|
@ -50,12 +50,12 @@ err_perm_group = nie udało się obniżyć uprawnień grupy
|
||||||
err_perm_user = nie udało się obniżyć uprawnień użytkownika
|
err_perm_user = nie udało się obniżyć uprawnień użytkownika
|
||||||
err_pwnam = nie udało się uzyskać informacji o użytkowniku
|
err_pwnam = nie udało się uzyskać informacji o użytkowniku
|
||||||
err_sleep = nie udało się wykonać polecenia sleep
|
err_sleep = nie udało się wykonać polecenia sleep
|
||||||
err_start = nie udało się wykonać polecenia startowego
|
|
||||||
err_battery = nie udało się sprawdzić statusu baterii
|
err_battery = nie udało się sprawdzić statusu baterii
|
||||||
err_switch_tty = nie można przełączyć tty
|
err_switch_tty = nie można przełączyć tty
|
||||||
err_tty_ctrl = nie udało się przekazać kontroli tty
|
err_tty_ctrl = nie udało się przekazać kontroli tty
|
||||||
err_no_users = nie znaleziono żadnego użytkownika
|
err_no_users = nie znaleziono żadnego użytkownika
|
||||||
err_uid_range = nie udało się dynamicznie pobrać zakresu uid
|
|
||||||
err_user_gid = nie udało się ustawić GID użytkownika
|
err_user_gid = nie udało się ustawić GID użytkownika
|
||||||
err_user_init = nie udało się zainicjalizować użytkownika
|
err_user_init = nie udało się zainicjalizować użytkownika
|
||||||
err_user_uid = nie udało się ustawić UID użytkownika
|
err_user_uid = nie udało się ustawić UID użytkownika
|
||||||
|
|
@ -63,11 +63,11 @@ err_xauth = polecenie xauth nie powiodło się
|
||||||
err_xcb_conn = połączenie xcb nie powiodło się
|
err_xcb_conn = połączenie xcb nie powiodło się
|
||||||
err_xsessions_dir = nie udało się znaleźć folderu sesji
|
err_xsessions_dir = nie udało się znaleźć folderu sesji
|
||||||
err_xsessions_open = nie udało się otworzyć folderu sesji
|
err_xsessions_open = nie udało się otworzyć folderu sesji
|
||||||
hibernate = hibernuj
|
|
||||||
insert = wstaw
|
insert = wstaw
|
||||||
login = login
|
login = login
|
||||||
logout = wylogowano
|
logout = wylogowano
|
||||||
no_x11_support = obsługa x11 wyłączona podczas kompilacji
|
no_x11_support = wsparcie X11 wyłączone podczas kompilacji
|
||||||
normal = normalny
|
normal = normalny
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = inny
|
other = inny
|
||||||
|
|
@ -76,7 +76,7 @@ restart = uruchom ponownie
|
||||||
shell = powłoka
|
shell = powłoka
|
||||||
shutdown = wyłącz
|
shutdown = wyłącz
|
||||||
sleep = uśpij
|
sleep = uśpij
|
||||||
toggle_password = Pokaż/ukryj hasło
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = x11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
authenticating = a autenticar...
|
|
||||||
brightness_down = diminuir brilho
|
|
||||||
brightness_up = aumentar brilho
|
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = personalizado
|
|
||||||
custom_info_err_output_long = saída demasiado longa
|
|
||||||
custom_info_err_no_output = sem saída
|
|
||||||
custom_info_err_no_output_error = , possível erro
|
|
||||||
err_alloc = erro na atribuição de memória
|
err_alloc = erro na atribuição de memória
|
||||||
err_args = não foi possível analisar os argumentos da linha de comandos
|
|
||||||
err_autologin_session = sessão de início de sessão automático não encontrada
|
|
||||||
err_bounds = índice fora de limites
|
err_bounds = índice fora de limites
|
||||||
err_brightness_change = não foi possível alterar o brilho
|
|
||||||
err_chdir = erro ao abrir a pasta home
|
err_chdir = erro ao abrir a pasta home
|
||||||
err_clock_too_long = a cadeia de caracteres do relógio é demasiado longa
|
|
||||||
err_config = não foi possível analisar o ficheiro de configuração
|
|
||||||
err_crawl = não foi possível explorar os diretórios de sessão
|
|
||||||
err_dgn_oob = mensagem de registo
|
err_dgn_oob = mensagem de registo
|
||||||
err_domain = domínio inválido
|
err_domain = domínio inválido
|
||||||
err_empty_password = palavra-passe vazia não é permitida
|
|
||||||
err_envlist = não foi possível obter a lista de variáveis de ambiente
|
|
||||||
err_get_active_tty = não foi possível obter o tty ativo
|
|
||||||
err_hibernate = não foi possível executar o comando de hibernação
|
|
||||||
err_hostname = erro ao obter o nome do host
|
err_hostname = erro ao obter o nome do host
|
||||||
err_inactivity = não foi possível executar o comando de inatividade
|
|
||||||
err_lock_state = não foi possível obter o estado de bloqueio
|
|
||||||
err_log = não foi possível abrir o ficheiro de registo
|
|
||||||
err_mlock = erro de bloqueio de memória
|
err_mlock = erro de bloqueio de memória
|
||||||
err_null = ponteiro nulo
|
err_null = ponteiro nulo
|
||||||
err_numlock = não foi possível definir o numlock
|
|
||||||
err_pam = erro na transação pam
|
err_pam = erro na transação pam
|
||||||
err_pam_abort = transação pam abortada
|
err_pam_abort = transação pam abortada
|
||||||
err_pam_acct_expired = conta expirada
|
err_pam_acct_expired = conta expirada
|
||||||
|
|
@ -49,34 +49,34 @@ err_perm_dir = erro ao alterar o diretório atual
|
||||||
err_perm_group = erro ao reduzir as permissões do grupo
|
err_perm_group = erro ao reduzir as permissões do grupo
|
||||||
err_perm_user = erro ao reduzir as permissões do utilizador
|
err_perm_user = erro ao reduzir as permissões do utilizador
|
||||||
err_pwnam = erro ao obter informação do utilizador
|
err_pwnam = erro ao obter informação do utilizador
|
||||||
err_sleep = não foi possível executar o comando de suspensão
|
|
||||||
err_start = não foi possível executar o comando de início
|
|
||||||
err_battery = não foi possível carregar o estado da bateria
|
|
||||||
err_switch_tty = não foi possível mudar de tty
|
|
||||||
err_tty_ctrl = falhou a transferência de controlo do tty
|
|
||||||
err_no_users = nenhum utilizador encontrado
|
|
||||||
err_uid_range = não foi possível obter dinamicamente o intervalo de uid
|
|
||||||
err_user_gid = erro ao definir o GID do utilizador
|
err_user_gid = erro ao definir o GID do utilizador
|
||||||
err_user_init = erro ao iniciar o utilizador
|
err_user_init = erro ao iniciar o utilizador
|
||||||
err_user_uid = erro ao definir o UID do utilizador
|
err_user_uid = erro ao definir o UID do utilizador
|
||||||
err_xauth = o comando xauth falhou
|
|
||||||
err_xcb_conn = a ligação xcb falhou
|
|
||||||
err_xsessions_dir = erro ao localizar a pasta das sessões
|
err_xsessions_dir = erro ao localizar a pasta das sessões
|
||||||
err_xsessions_open = erro ao abrir a pasta das sessões
|
err_xsessions_open = erro ao abrir a pasta das sessões
|
||||||
hibernate = hibernar
|
|
||||||
insert = inserir
|
|
||||||
login = iniciar sessão
|
login = iniciar sessão
|
||||||
logout = terminar sessão
|
logout = terminar sessão
|
||||||
no_x11_support = suporte a x11 desativado em tempo de compilação
|
|
||||||
normal = normal
|
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = outro
|
|
||||||
password = palavra-passe
|
password = palavra-passe
|
||||||
restart = reiniciar
|
restart = reiniciar
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = encerrar
|
shutdown = encerrar
|
||||||
sleep = suspender
|
|
||||||
toggle_password = mostrar/ocultar palavra-passe
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,39 @@
|
||||||
authenticating = autenticando...
|
|
||||||
brightness_down = diminuir brilho
|
|
||||||
brightness_up = aumentar brilho
|
|
||||||
capslock = caixa alta
|
capslock = caixa alta
|
||||||
custom = personalizado
|
|
||||||
custom_info_err_output_long = saída muito longa
|
|
||||||
custom_info_err_no_output = sem saída
|
|
||||||
custom_info_err_no_output_error = , possível erro
|
|
||||||
err_alloc = alocação de memória malsucedida
|
err_alloc = alocação de memória malsucedida
|
||||||
err_args = não foi possível analisar os argumentos da linha de comando
|
|
||||||
err_autologin_session = sessão de login automático não encontrada
|
|
||||||
err_bounds = índice fora de limites
|
err_bounds = índice fora de limites
|
||||||
err_brightness_change = não foi possível alterar o brilho
|
|
||||||
err_chdir = não foi possível abrir o diretório home
|
err_chdir = não foi possível abrir o diretório home
|
||||||
err_clock_too_long = a string do relógio é muito longa
|
|
||||||
err_config = não foi possível analisar o arquivo de configuração
|
|
||||||
err_crawl = não foi possível explorar os diretórios de sessão
|
|
||||||
err_dgn_oob = mensagem de log
|
err_dgn_oob = mensagem de log
|
||||||
err_domain = domínio inválido
|
err_domain = domínio inválido
|
||||||
err_empty_password = senha vazia não é permitida
|
|
||||||
err_envlist = não foi possível obter a lista de variáveis de ambiente
|
|
||||||
err_get_active_tty = não foi possível obter o tty ativo
|
|
||||||
err_hibernate = não foi possível executar o comando de hibernação
|
|
||||||
err_hostname = não foi possível obter o nome do host
|
err_hostname = não foi possível obter o nome do host
|
||||||
err_inactivity = não foi possível executar o comando de inatividade
|
|
||||||
err_lock_state = não foi possível obter o estado de bloqueio
|
|
||||||
err_log = não foi possível abrir o arquivo de log
|
|
||||||
err_mlock = bloqueio da memória de senha malsucedido
|
err_mlock = bloqueio da memória de senha malsucedido
|
||||||
err_null = ponteiro nulo
|
err_null = ponteiro nulo
|
||||||
err_numlock = não foi possível definir o numlock
|
|
||||||
err_pam = transação pam malsucedida
|
err_pam = transação pam malsucedida
|
||||||
err_pam_abort = transação pam abortada
|
err_pam_abort = transação pam abortada
|
||||||
err_pam_acct_expired = conta expirada
|
err_pam_acct_expired = conta expirada
|
||||||
err_pam_auth = erro de autenticação
|
err_pam_auth = erro de autenticação
|
||||||
err_pam_authinfo_unavail = não foi possível obter informações do usuário
|
err_pam_authinfo_unavail = não foi possível obter informações do usuário
|
||||||
err_pam_authok_reqd = token expirado
|
err_pam_authok_reqd = token expirada
|
||||||
err_pam_buf = erro de buffer de memória
|
err_pam_buf = erro de buffer de memória
|
||||||
err_pam_cred_err = erro para definir credenciais
|
err_pam_cred_err = erro para definir credenciais
|
||||||
err_pam_cred_expired = credenciais expiradas
|
err_pam_cred_expired = credenciais expiradas
|
||||||
|
|
@ -49,34 +49,34 @@ err_perm_dir = não foi possível alterar o diretório atual
|
||||||
err_perm_group = não foi possível reduzir as permissões de grupo
|
err_perm_group = não foi possível reduzir as permissões de grupo
|
||||||
err_perm_user = não foi possível reduzir as permissões de usuário
|
err_perm_user = não foi possível reduzir as permissões de usuário
|
||||||
err_pwnam = não foi possível obter informações do usuário
|
err_pwnam = não foi possível obter informações do usuário
|
||||||
err_sleep = não foi possível executar o comando de suspensão
|
|
||||||
err_start = não foi possível executar o comando de início
|
|
||||||
err_battery = não foi possível carregar o status da bateria
|
|
||||||
err_switch_tty = não foi possível mudar de tty
|
|
||||||
err_tty_ctrl = a transferência de controle do tty falhou
|
|
||||||
err_no_users = nenhum usuário encontrado
|
|
||||||
err_uid_range = não foi possível obter dinamicamente o intervalo de uid
|
|
||||||
err_user_gid = não foi possível definir o GID do usuário
|
err_user_gid = não foi possível definir o GID do usuário
|
||||||
err_user_init = não foi possível iniciar o usuário
|
err_user_init = não foi possível iniciar o usuário
|
||||||
err_user_uid = não foi possível definir o UID do usuário
|
err_user_uid = não foi possível definir o UID do usuário
|
||||||
err_xauth = o comando xauth falhou
|
|
||||||
err_xcb_conn = a conexão xcb falhou
|
|
||||||
err_xsessions_dir = não foi possível encontrar a pasta das sessões
|
err_xsessions_dir = não foi possível encontrar a pasta das sessões
|
||||||
err_xsessions_open = não foi possível abrir a pasta das sessões
|
err_xsessions_open = não foi possível abrir a pasta das sessões
|
||||||
hibernate = hibernar
|
|
||||||
insert = inserir
|
|
||||||
login = conectar
|
login = conectar
|
||||||
logout = desconectado
|
logout = desconectado
|
||||||
no_x11_support = suporte a x11 desativado em tempo de compilação
|
|
||||||
normal = normal
|
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = outro
|
|
||||||
password = senha
|
password = senha
|
||||||
restart = reiniciar
|
restart = reiniciar
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = desligar
|
shutdown = desligar
|
||||||
sleep = suspender
|
|
||||||
toggle_password = mostrar/ocultar senha
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
108
res/lang/ro.ini
108
res/lang/ro.ini
|
|
@ -1,34 +1,34 @@
|
||||||
authenticating = autentificare...
|
|
||||||
brightness_down = scade luminozitatea
|
|
||||||
brightness_up = crește luminozitatea
|
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = personalizat
|
|
||||||
custom_info_err_output_long = ieșire prea lungă
|
|
||||||
custom_info_err_no_output = fără ieșire
|
|
||||||
custom_info_err_no_output_error = , posibil eroare
|
|
||||||
err_alloc = alocare de memorie eșuată
|
|
||||||
err_args = imposibil de analizat argumentele liniei de comandă
|
|
||||||
err_autologin_session = sesiunea de autentificare automată nu a fost găsită
|
|
||||||
err_bounds = index în afara limitelor
|
|
||||||
err_brightness_change = imposibil de schimbat luminozitatea
|
|
||||||
err_chdir = imposibil de deschis folderul de acasă
|
|
||||||
err_clock_too_long = șirul de ceas este prea lung
|
|
||||||
err_config = imposibil de analizat fișierul de configurare
|
|
||||||
err_crawl = imposibil de explorat directoarele de sesiune
|
|
||||||
err_dgn_oob = mesaj jurnal
|
|
||||||
err_domain = domeniu invalid
|
|
||||||
err_empty_password = parola goală nu este permisă
|
|
||||||
err_envlist = imposibil de obținut lista de variabile de mediu
|
|
||||||
err_get_active_tty = imposibil de obținut tty-ul activ
|
|
||||||
err_hibernate = imposibil de executat comanda de hibernare
|
|
||||||
err_hostname = imposibil de obținut numele gazdei
|
|
||||||
err_inactivity = imposibil de executat comanda de inactivitate
|
|
||||||
err_lock_state = imposibil de obținut starea de blocare
|
|
||||||
err_log = imposibil de deschis fișierul jurnal
|
|
||||||
err_mlock = imposibil de blocat memoria parolei
|
|
||||||
err_null = pointer nul
|
|
||||||
err_numlock = imposibil de setat numlock
|
|
||||||
err_pam = tranzacție pam eșuată
|
|
||||||
err_pam_abort = tranzacţie pam anulată
|
err_pam_abort = tranzacţie pam anulată
|
||||||
err_pam_acct_expired = cont expirat
|
err_pam_acct_expired = cont expirat
|
||||||
err_pam_auth = eroare de autentificare
|
err_pam_auth = eroare de autentificare
|
||||||
|
|
@ -44,39 +44,39 @@ err_pam_perm_denied = acces interzis
|
||||||
err_pam_session = eroare de sesiune
|
err_pam_session = eroare de sesiune
|
||||||
err_pam_sys = eroare de sistem
|
err_pam_sys = eroare de sistem
|
||||||
err_pam_user_unknown = utilizator necunoscut
|
err_pam_user_unknown = utilizator necunoscut
|
||||||
err_path = imposibil de setat calea
|
|
||||||
err_perm_dir = nu s-a putut schimba dosarul (folder-ul) curent
|
err_perm_dir = nu s-a putut schimba dosarul (folder-ul) curent
|
||||||
err_perm_group = nu s-a putut face downgrade permisiunilor de grup
|
err_perm_group = nu s-a putut face downgrade permisiunilor de grup
|
||||||
err_perm_user = nu s-a putut face downgrade permisiunilor de utilizator
|
err_perm_user = nu s-a putut face downgrade permisiunilor de utilizator
|
||||||
err_pwnam = imposibil de obținut informații despre utilizator
|
|
||||||
err_sleep = imposibil de executat comanda de repaus
|
|
||||||
err_start = imposibil de executat comanda de pornire
|
|
||||||
err_battery = imposibil de încărcat starea bateriei
|
|
||||||
err_switch_tty = imposibil de comutat tty
|
|
||||||
err_tty_ctrl = transferul controlului tty a eșuat
|
|
||||||
err_no_users = niciun utilizator găsit
|
|
||||||
err_uid_range = imposibil de obținut dinamic intervalul uid
|
|
||||||
err_user_gid = imposibil de setat GID-ul utilizatorului
|
|
||||||
err_user_init = imposibil de inițializa utilizatorul
|
|
||||||
err_user_uid = imposibil de setat UID-ul utilizatorului
|
|
||||||
err_xauth = comanda xauth a eșuat
|
|
||||||
err_xcb_conn = conexiunea xcb a eșuat
|
|
||||||
err_xsessions_dir = imposibil de găsit folderul de sesiuni
|
|
||||||
err_xsessions_open = imposibil de deschis folderul de sesiuni
|
|
||||||
hibernate = hibernare
|
|
||||||
insert = inserare
|
|
||||||
login = utilizator
|
login = utilizator
|
||||||
logout = opreşte sesiunea
|
logout = opreşte sesiunea
|
||||||
no_x11_support = suportul x11 dezactivat la compilare
|
|
||||||
normal = normal
|
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = altul
|
|
||||||
password = parolă
|
password = parolă
|
||||||
restart = resetează
|
restart = resetează
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = opreşte sistemul
|
shutdown = opreşte sistemul
|
||||||
sleep = repaus
|
|
||||||
toggle_password = afișare/ascundere parolă
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -3,26 +3,26 @@ brightness_down = уменьшить яркость
|
||||||
brightness_up = увеличить яркость
|
brightness_up = увеличить яркость
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = пользовательский
|
custom = пользовательский
|
||||||
custom_info_err_output_long = вывод слишком длинный
|
|
||||||
custom_info_err_no_output = нет вывода
|
|
||||||
custom_info_err_no_output_error = , возможная ошибка
|
|
||||||
err_alloc = не удалось выделить память
|
err_alloc = не удалось выделить память
|
||||||
err_args = не удалось разобрать аргументы командной строки
|
|
||||||
err_autologin_session = не найдена сессия с автологином
|
err_autologin_session = не найдена сессия с автологином
|
||||||
err_bounds = за пределами индекса
|
err_bounds = за пределами индекса
|
||||||
err_brightness_change = не удалось изменить яркость
|
err_brightness_change = не удалось изменить яркость
|
||||||
err_chdir = не удалось открыть домашнюю папку
|
err_chdir = не удалось открыть домашнюю папку
|
||||||
err_clock_too_long = строка часов слишком длинная
|
err_clock_too_long = строка часов слишком длинная
|
||||||
err_config = не удалось разобрать файл конфигурации
|
err_config = не удалось разобрать файл конфигурации
|
||||||
err_crawl = не удалось просканировать каталоги сессии
|
|
||||||
err_dgn_oob = отладочное сообщение (log)
|
err_dgn_oob = отладочное сообщение (log)
|
||||||
err_domain = неверный домен
|
err_domain = неверный домен
|
||||||
err_empty_password = пустой пароль не допустим
|
err_empty_password = пустой пароль не допустим
|
||||||
err_envlist = не удалось получить список переменных среды
|
err_envlist = не удалось получить список переменных среды
|
||||||
err_get_active_tty = не удалось получить активный tty
|
err_get_active_tty = не удалось получить активный tty
|
||||||
err_hibernate = не удалось выполнить команду гибернации
|
|
||||||
err_hostname = не удалось получить имя хоста
|
err_hostname = не удалось получить имя хоста
|
||||||
err_inactivity = не удалось выполнить команду бездействия
|
|
||||||
err_lock_state = не удалось получить состояние lock
|
err_lock_state = не удалось получить состояние lock
|
||||||
err_log = не удалось открыть файл log
|
err_log = не удалось открыть файл log
|
||||||
err_mlock = сбой блокировки памяти
|
err_mlock = сбой блокировки памяти
|
||||||
|
|
@ -50,12 +50,12 @@ err_perm_group = не удалось понизить права доступа
|
||||||
err_perm_user = не удалось понизить права доступа пользователя
|
err_perm_user = не удалось понизить права доступа пользователя
|
||||||
err_pwnam = не удалось получить информацию о пользователе
|
err_pwnam = не удалось получить информацию о пользователе
|
||||||
err_sleep = не удалось выполнить команду sleep
|
err_sleep = не удалось выполнить команду sleep
|
||||||
err_start = не удалось выполнить команду запуска
|
|
||||||
err_battery = не удалось получить статус батареи
|
err_battery = не удалось получить статус батареи
|
||||||
err_switch_tty = не удалось переключить tty
|
err_switch_tty = не удалось переключить tty
|
||||||
err_tty_ctrl = передача управления tty не удалась
|
err_tty_ctrl = передача управления tty не удалась
|
||||||
err_no_users = пользователи не найдены
|
err_no_users = пользователи не найдены
|
||||||
err_uid_range = не удалось динамически получить диапазон uid
|
|
||||||
err_user_gid = не удалось установить GID пользователя
|
err_user_gid = не удалось установить GID пользователя
|
||||||
err_user_init = не удалось инициализировать пользователя
|
err_user_init = не удалось инициализировать пользователя
|
||||||
err_user_uid = не удалось установить UID пользователя
|
err_user_uid = не удалось установить UID пользователя
|
||||||
|
|
@ -63,11 +63,11 @@ err_xauth = команда xauth не выполнена
|
||||||
err_xcb_conn = ошибка подключения xcb
|
err_xcb_conn = ошибка подключения xcb
|
||||||
err_xsessions_dir = не удалось найти сессионную папку
|
err_xsessions_dir = не удалось найти сессионную папку
|
||||||
err_xsessions_open = не удалось открыть сессионную папку
|
err_xsessions_open = не удалось открыть сессионную папку
|
||||||
hibernate = гибернация
|
|
||||||
insert = вставка
|
insert = вставка
|
||||||
login = логин
|
login = логин
|
||||||
logout = вышел из системы
|
logout = вышел из системы
|
||||||
no_x11_support = поддержка x11 отключена при компиляции
|
no_x11_support = поддержка x11 отключена во время компиляции
|
||||||
normal = обычный
|
normal = обычный
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = прочие
|
other = прочие
|
||||||
|
|
@ -76,7 +76,7 @@ restart = перезагрузить
|
||||||
shell = оболочка
|
shell = оболочка
|
||||||
shutdown = выключить
|
shutdown = выключить
|
||||||
sleep = сон
|
sleep = сон
|
||||||
toggle_password = показать/скрыть пароль
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = x11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
128
res/lang/sr.ini
128
res/lang/sr.ini
|
|
@ -1,82 +1,82 @@
|
||||||
authenticating = autentifikacija...
|
|
||||||
brightness_down = smanji osvetljenost
|
|
||||||
brightness_up = povećaj osvetljenost
|
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = prilagođeno
|
|
||||||
custom_info_err_output_long = izlaz predugačak
|
|
||||||
custom_info_err_no_output = nema izlaza
|
|
||||||
custom_info_err_no_output_error = , moguća greška
|
|
||||||
err_alloc = neuspješna alokacija memorije
|
err_alloc = neuspijesna alokacija memorije
|
||||||
err_args = nije moguće raščlaniti argumente komandne linije
|
|
||||||
err_autologin_session = sesija automatske prijave nije pronađena
|
|
||||||
err_bounds = izvan granica indeksa
|
err_bounds = izvan granica indeksa
|
||||||
err_brightness_change = nije uspela promena osvetljenosti
|
|
||||||
err_chdir = neuspješno otvaranje home foldera
|
err_chdir = neuspijesno otvaranje home foldera
|
||||||
err_clock_too_long = niska sata je preduga
|
|
||||||
err_config = nije moguće raščlaniti konfiguracioni fajl
|
|
||||||
err_crawl = nije uspelo skeniranje direktorijuma sesija
|
|
||||||
err_dgn_oob = log poruka
|
err_dgn_oob = log poruka
|
||||||
err_domain = nevažeći domen
|
err_domain = nevazeci domen
|
||||||
err_empty_password = prazna lozinka nije dozvoljena
|
|
||||||
err_envlist = nije uspelo dobijanje liste promenljivih okruženja
|
|
||||||
err_get_active_tty = nije uspelo dobijanje aktivnog tty
|
|
||||||
err_hibernate = nije uspelo izvršavanje komande hibernacije
|
|
||||||
err_hostname = neuspješno traženje hostname-a
|
err_hostname = neuspijesno trazenje hostname-a
|
||||||
err_inactivity = nije uspelo izvršavanje komande neaktivnosti
|
|
||||||
err_lock_state = nije uspelo dobijanje stanja zaključavanja
|
|
||||||
err_log = nije uspelo otvaranje fajla dnevnika
|
|
||||||
err_mlock = neuspješno zaključavanje memorije lozinke
|
err_mlock = neuspijesno zakljucavanje memorije lozinke
|
||||||
err_null = null pokazivač
|
err_null = null pokazivac
|
||||||
err_numlock = nije uspelo postavljanje numlock
|
|
||||||
err_pam = pam transakcija neuspješna
|
err_pam = pam transakcija neuspijesna
|
||||||
err_pam_abort = pam transakcija prekinuta
|
err_pam_abort = pam transakcija prekinuta
|
||||||
err_pam_acct_expired = nalog istekao
|
err_pam_acct_expired = nalog istekao
|
||||||
err_pam_auth = greška pri autentikaciji
|
err_pam_auth = greska pri autentikaciji
|
||||||
err_pam_authinfo_unavail = neuspješno uzimanje informacija o korisniku
|
err_pam_authinfo_unavail = neuspjelo uzimanje informacija o korisniku
|
||||||
err_pam_authok_reqd = token istekao
|
err_pam_authok_reqd = token istekao
|
||||||
err_pam_buf = greška bafera memorije
|
err_pam_buf = greska bafera memorije
|
||||||
err_pam_cred_err = neuspješno postavljanje kredencijala
|
err_pam_cred_err = neuspjelo postavljanje kredencijala
|
||||||
err_pam_cred_expired = kredencijali istekli
|
err_pam_cred_expired = kredencijali istekli
|
||||||
err_pam_cred_insufficient = nedovoljni kredencijali
|
err_pam_cred_insufficient = nedovoljni kredencijali
|
||||||
err_pam_cred_unavail = neuspješno uzimanje kredencijala
|
err_pam_cred_unavail = neuspjelo uzimanje kredencijala
|
||||||
err_pam_maxtries = dostignut maksimalan broj pokušaja
|
err_pam_maxtries = dostignut maksimalan broj pokusaja
|
||||||
err_pam_perm_denied = nedozvoljeno
|
err_pam_perm_denied = nedozovoljeno
|
||||||
err_pam_session = greška sesije
|
err_pam_session = greska sesije
|
||||||
err_pam_sys = greška sistema
|
err_pam_sys = greska sistema
|
||||||
err_pam_user_unknown = nepoznat korisnik
|
err_pam_user_unknown = nepoznat korisnik
|
||||||
err_path = neuspješno postavljanje path-a
|
err_path = neuspjelo postavljanje path-a
|
||||||
err_perm_dir = neuspješno mijenjanje foldera
|
err_perm_dir = neuspjelo mijenjanje foldera
|
||||||
err_perm_group = neuspješno snižavanje dozvola grupe
|
err_perm_group = neuspjesno snizavanje dozvola grupe
|
||||||
err_perm_user = neuspješno snižavanje dozvola korisnika
|
err_perm_user = neuspijesno snizavanje dozvola korisnika
|
||||||
err_pwnam = neuspješno skupljanje informacija o korisniku
|
err_pwnam = neuspijesno skupljanje informacija o korisniku
|
||||||
err_sleep = nije uspelo izvršavanje komande spavanja
|
|
||||||
err_start = nije uspelo izvršavanje komande pokretanja
|
|
||||||
err_battery = nije uspelo učitavanje statusa baterije
|
|
||||||
err_switch_tty = nije uspelo prebacivanje tty
|
|
||||||
err_tty_ctrl = prenos kontrole tty nije uspeo
|
|
||||||
err_no_users = nisu pronađeni korisnici
|
|
||||||
err_uid_range = nije uspelo dinamičko dobijanje opsega uid
|
|
||||||
err_user_gid = neuspješno postavljanje korisničkog GID-a
|
err_user_gid = neuspijesno postavljanje korisničkog GID-a
|
||||||
err_user_init = neuspješna inicijalizacija korisnika
|
err_user_init = neuspijensa inicijalizacija korisnika
|
||||||
err_user_uid = neuspješno postavljanje UID-a korisnika
|
err_user_uid = neuspijesno postavljanje UID-a korisnika
|
||||||
err_xauth = komanda xauth nije uspela
|
|
||||||
err_xcb_conn = xcb veza nije uspela
|
|
||||||
err_xsessions_dir = neuspješno pronalaženje foldera sesija
|
err_xsessions_dir = neuspijesno pronalazenje foldera sesija
|
||||||
err_xsessions_open = neuspješno otvaranje foldera sesija
|
err_xsessions_open = neuspijesno otvaranje foldera sesija
|
||||||
hibernate = hibernacija
|
|
||||||
insert = umetni
|
|
||||||
login = korisnik
|
login = korisnik
|
||||||
logout = izlogovan
|
logout = izlogovan
|
||||||
no_x11_support = x11 podrška onemogućena tokom prevođenja
|
|
||||||
normal = normalno
|
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = ostalo
|
|
||||||
password = lozinka
|
password = lozinka
|
||||||
restart = ponovo pokreni
|
restart = ponovo pokreni
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = ugasi
|
shutdown = ugasi
|
||||||
sleep = uspavaj
|
|
||||||
toggle_password = prikaži/sakrij lozinku
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
authenticating = аутентификација...
|
|
||||||
brightness_down = смањи осветљеност
|
|
||||||
brightness_up = повећај осветљеност
|
|
||||||
capslock = capslock
|
|
||||||
custom = прилагођено
|
|
||||||
custom_info_err_output_long = излаз предугачак
|
|
||||||
custom_info_err_no_output = нема излаза
|
|
||||||
custom_info_err_no_output_error = , могућа грешка
|
|
||||||
err_alloc = неуспешна алокација меморије
|
|
||||||
err_args = није могуће рашчланити аргументе командне линије
|
|
||||||
err_autologin_session = сесија аутоматске пријаве није пронађена
|
|
||||||
err_bounds = изван граница индекса
|
|
||||||
err_brightness_change = није успела промена осветљености
|
|
||||||
err_chdir = неуспешно отварање home фолдера
|
|
||||||
err_clock_too_long = ниска сата је предуга
|
|
||||||
err_config = није могуће рашчланити конфигурациони фајл
|
|
||||||
err_crawl = није успело скенирање директоријума сесија
|
|
||||||
err_dgn_oob = лог порука
|
|
||||||
err_domain = неважећи домен
|
|
||||||
err_empty_password = празна лозинка није дозвољена
|
|
||||||
err_envlist = није успело добијање листе променљивих окружења
|
|
||||||
err_get_active_tty = није успело добијање активног tty
|
|
||||||
err_hibernate = није успело извршавање команде хибернације
|
|
||||||
err_hostname = неуспешно тражење hostname-а
|
|
||||||
err_inactivity = није успело извршавање команде неактивности
|
|
||||||
err_lock_state = није успело добијање стања закључавања
|
|
||||||
err_log = није успело отварање фајла дневника
|
|
||||||
err_mlock = неуспешно закључавање меморије лозинке
|
|
||||||
err_null = null показивач
|
|
||||||
err_numlock = није успело постављање numlock
|
|
||||||
err_pam = pam трансакција неуспешна
|
|
||||||
err_pam_abort = pam трансакција прекинута
|
|
||||||
err_pam_acct_expired = налог истекао
|
|
||||||
err_pam_auth = грешка при аутентикацији
|
|
||||||
err_pam_authinfo_unavail = неуспешно узимање информација о кориснику
|
|
||||||
err_pam_authok_reqd = токен истекао
|
|
||||||
err_pam_buf = грешка бафера меморије
|
|
||||||
err_pam_cred_err = неуспешно постављање акредитива
|
|
||||||
err_pam_cred_expired = акредитиви истекли
|
|
||||||
err_pam_cred_insufficient = недовољни акредитиви
|
|
||||||
err_pam_cred_unavail = неуспешно узимање акредитива
|
|
||||||
err_pam_maxtries = достигнут максималан број покушаја
|
|
||||||
err_pam_perm_denied = недозвољено
|
|
||||||
err_pam_session = грешка сесије
|
|
||||||
err_pam_sys = грешка система
|
|
||||||
err_pam_user_unknown = непознат корисник
|
|
||||||
err_path = неуспешно постављање путање
|
|
||||||
err_perm_dir = неуспешно мењање фолдера
|
|
||||||
err_perm_group = неуспешно снижавање дозвола групе
|
|
||||||
err_perm_user = неуспешно снижавање дозвола корисника
|
|
||||||
err_pwnam = неуспешно прикупљање информација о кориснику
|
|
||||||
err_sleep = није успело извршавање команде спавања
|
|
||||||
err_start = није успело извршавање команде покретања
|
|
||||||
err_battery = није успело учитавање статуса батерије
|
|
||||||
err_switch_tty = није успело пребацивање tty
|
|
||||||
err_tty_ctrl = пренос контроле tty није успео
|
|
||||||
err_no_users = нису пронађени корисници
|
|
||||||
err_uid_range = није успело динамичко добијање опсега uid
|
|
||||||
err_user_gid = неуспешно постављање корисничког GID-а
|
|
||||||
err_user_init = неуспешна иницијализација корисника
|
|
||||||
err_user_uid = неуспешно постављање UID-а корисника
|
|
||||||
err_xauth = команда xauth није успела
|
|
||||||
err_xcb_conn = xcb веза није успела
|
|
||||||
err_xsessions_dir = неуспешно проналажење фолдера сесија
|
|
||||||
err_xsessions_open = неуспешно отварање фолдера сесија
|
|
||||||
hibernate = хибернација
|
|
||||||
insert = уметни
|
|
||||||
login = корисник
|
|
||||||
logout = одјављен
|
|
||||||
no_x11_support = x11 подршка онемогућена током превођења
|
|
||||||
normal = нормално
|
|
||||||
numlock = numlock
|
|
||||||
other = остало
|
|
||||||
password = лозинка
|
|
||||||
restart = поново покрени
|
|
||||||
shell = shell
|
|
||||||
shutdown = угаси
|
|
||||||
sleep = успавај
|
|
||||||
toggle_password = прикажи/сакриј лозинку
|
|
||||||
wayland = wayland
|
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
|
||||||
|
|
@ -3,9 +3,9 @@ brightness_down = minska ljusstyrka
|
||||||
brightness_up = öka ljusstyrka
|
brightness_up = öka ljusstyrka
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = anpassad
|
custom = anpassad
|
||||||
custom_info_err_output_long = utdata för lång
|
|
||||||
custom_info_err_no_output = ingen utdata
|
|
||||||
custom_info_err_no_output_error = , möjligt fel
|
|
||||||
err_alloc = minnesallokering misslyckades
|
err_alloc = minnesallokering misslyckades
|
||||||
err_args = tolkning av kommandoargument misslyckades
|
err_args = tolkning av kommandoargument misslyckades
|
||||||
err_autologin_session = autologin-session hittades inte
|
err_autologin_session = autologin-session hittades inte
|
||||||
|
|
@ -26,7 +26,7 @@ err_inactivity = inaktivitetslägets kommando misslyckades
|
||||||
err_lock_state = hämtning av låsningsstatus misslyckades
|
err_lock_state = hämtning av låsningsstatus misslyckades
|
||||||
err_log = öppning av loggfil misslyckades
|
err_log = öppning av loggfil misslyckades
|
||||||
err_mlock = låsning av lösenordsminne misslyckades
|
err_mlock = låsning av lösenordsminne misslyckades
|
||||||
err_null = nullpekare
|
err_null = null pointer
|
||||||
err_numlock = inställning av numlock misslyckades
|
err_numlock = inställning av numlock misslyckades
|
||||||
err_pam = pam-transaktion misslyckades
|
err_pam = pam-transaktion misslyckades
|
||||||
err_pam_abort = pam-transaktion avbröts
|
err_pam_abort = pam-transaktion avbröts
|
||||||
|
|
@ -76,7 +76,7 @@ restart = starta om
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = stäng av
|
shutdown = stäng av
|
||||||
sleep = viloläge
|
sleep = viloläge
|
||||||
toggle_password = visa/dölj lösenord
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = x11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
authenticating = kimlik doğrulanıyor...
|
|
||||||
brightness_down = parlakligi azalt
|
brightness_down = parlakligi azalt
|
||||||
brightness_up = parlakligi arttir
|
brightness_up = parlakligi arttir
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = özel
|
|
||||||
custom_info_err_output_long = çıktı çok uzun
|
|
||||||
custom_info_err_no_output = çıktı yok
|
|
||||||
custom_info_err_no_output_error = , olası hata
|
|
||||||
err_alloc = basarisiz bellek ayirma
|
err_alloc = basarisiz bellek ayirma
|
||||||
err_args = komut satırı argümanları ayrıştırılamıyor
|
|
||||||
err_autologin_session = otomatik oturum açma oturumu bulunamadı
|
|
||||||
err_bounds = sinirlarin disinda dizin
|
err_bounds = sinirlarin disinda dizin
|
||||||
err_brightness_change = parlaklık değiştirilemedi
|
|
||||||
err_chdir = ev klasoru acilamadi
|
err_chdir = ev klasoru acilamadi
|
||||||
err_clock_too_long = saat dizesi çok uzun
|
|
||||||
err_config = yapılandırma dosyası ayrıştırılamıyor
|
|
||||||
err_crawl = oturum dizinleri taranamadı
|
|
||||||
err_dgn_oob = log mesaji
|
err_dgn_oob = log mesaji
|
||||||
err_domain = gecersiz etki alani
|
err_domain = gecersiz etki alani
|
||||||
err_empty_password = boş parola kullanılamaz
|
|
||||||
err_envlist = ortam değişkenleri listesi alınamadı
|
|
||||||
err_get_active_tty = aktif tty alınamadı
|
|
||||||
err_hibernate = hazırda bekletme komutu çalıştırılamadı
|
|
||||||
err_hostname = ana bilgisayar adi alinamadi
|
err_hostname = ana bilgisayar adi alinamadi
|
||||||
err_inactivity = hareketsizlik komutu çalıştırılamadı
|
|
||||||
err_lock_state = kilit durumu alınamadı
|
|
||||||
err_log = günlük dosyası açılamadı
|
|
||||||
err_mlock = parola bellegi kilitlenemedi
|
err_mlock = parola bellegi kilitlenemedi
|
||||||
err_null = bos isaretci hatasi
|
err_null = bos isaretci hatasi
|
||||||
err_numlock = numlock ayarlanamadı
|
|
||||||
err_pam = pam islemi basarisiz oldu
|
err_pam = pam islemi basarisiz oldu
|
||||||
err_pam_abort = pam islemi durduruldu
|
err_pam_abort = pam islemi durduruldu
|
||||||
err_pam_acct_expired = hesabin suresi dolmus
|
err_pam_acct_expired = hesabin suresi dolmus
|
||||||
|
|
@ -49,26 +49,26 @@ err_perm_dir = gecerli dizin degistirilemedi
|
||||||
err_perm_group = grup izinleri dusurulemedi
|
err_perm_group = grup izinleri dusurulemedi
|
||||||
err_perm_user = kullanici izinleri dusurulemedi
|
err_perm_user = kullanici izinleri dusurulemedi
|
||||||
err_pwnam = kullanici bilgileri alinamadi
|
err_pwnam = kullanici bilgileri alinamadi
|
||||||
err_sleep = uyku komutu çalıştırılamadı
|
|
||||||
err_start = başlatma komutu çalıştırılamadı
|
|
||||||
err_battery = pil durumu yüklenemedi
|
|
||||||
err_switch_tty = tty değiştirilemedi
|
|
||||||
err_tty_ctrl = tty kontrol aktarımı başarısız oldu
|
|
||||||
err_no_users = kullanıcı bulunamadı
|
|
||||||
err_uid_range = uid aralığı dinamik olarak alınamadı
|
|
||||||
err_user_gid = kullanici icin GID ayarlanamadi
|
err_user_gid = kullanici icin GID ayarlanamadi
|
||||||
err_user_init = kullanici oturumu baslatilamadi
|
err_user_init = kullanici oturumu baslatilamadi
|
||||||
err_user_uid = kullanici icin UID ayarlanamadi
|
err_user_uid = kullanici icin UID ayarlanamadi
|
||||||
err_xauth = xauth komutu başarısız oldu
|
|
||||||
err_xcb_conn = xcb bağlantısı başarısız oldu
|
|
||||||
err_xsessions_dir = oturumlar klasoru bulunamadi
|
err_xsessions_dir = oturumlar klasoru bulunamadi
|
||||||
err_xsessions_open = oturumlar klasoru acilamadi
|
err_xsessions_open = oturumlar klasoru acilamadi
|
||||||
hibernate = askiya al
|
hibernate = askiya al
|
||||||
insert = ekle
|
|
||||||
login = kullanici
|
login = kullanici
|
||||||
logout = oturumdan cikis yapildi
|
logout = oturumdan cikis yapildi
|
||||||
no_x11_support = x11 desteği derleme zamanında devre dışı bırakıldı
|
|
||||||
normal = normal
|
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = baska
|
other = baska
|
||||||
password = sifre
|
password = sifre
|
||||||
|
|
@ -76,7 +76,7 @@ restart = yeniden baslat
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = makineyi kapat
|
shutdown = makineyi kapat
|
||||||
sleep = uykuya al
|
sleep = uykuya al
|
||||||
toggle_password = parolayı göster/gizle
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
authenticating = автентифікація...
|
|
||||||
brightness_down = зменшити яскравість
|
|
||||||
brightness_up = збільшити яскравість
|
|
||||||
capslock = capslock
|
capslock = capslock
|
||||||
custom = власний
|
|
||||||
custom_info_err_output_long = вивід занадто довгий
|
|
||||||
custom_info_err_no_output = немає виводу
|
|
||||||
custom_info_err_no_output_error = , можлива помилка
|
|
||||||
err_alloc = невдале виділення пам'яті
|
err_alloc = невдале виділення пам'яті
|
||||||
err_args = не вдалося розібрати аргументи командного рядка
|
|
||||||
err_autologin_session = сеанс автоматичного входу не знайдено
|
|
||||||
err_bounds = поза межами індексу
|
err_bounds = поза межами індексу
|
||||||
err_brightness_change = не вдалося змінити яскравість
|
|
||||||
err_chdir = не вдалося відкрити домашній каталог
|
err_chdir = не вдалося відкрити домашній каталог
|
||||||
err_clock_too_long = рядок годинника занадто довгий
|
|
||||||
err_config = не вдалося розібрати файл конфігурації
|
|
||||||
err_crawl = не вдалося сканувати каталоги сесій
|
|
||||||
err_dgn_oob = повідомлення журналу (log)
|
err_dgn_oob = повідомлення журналу (log)
|
||||||
err_domain = недійсний домен
|
err_domain = недійсний домен
|
||||||
err_empty_password = порожній пароль не дозволено
|
|
||||||
err_envlist = не вдалося отримати список змінних середовища
|
|
||||||
err_get_active_tty = не вдалося отримати активний tty
|
|
||||||
err_hibernate = не вдалося виконати команду гібернації
|
|
||||||
err_hostname = не вдалося отримати ім'я хосту
|
err_hostname = не вдалося отримати ім'я хосту
|
||||||
err_inactivity = не вдалося виконати команду неактивності
|
|
||||||
err_lock_state = не вдалося отримати стан блокування
|
|
||||||
err_log = не вдалося відкрити файл журналу
|
|
||||||
err_mlock = збій блокування пам'яті
|
err_mlock = збій блокування пам'яті
|
||||||
err_null = нульовий вказівник
|
err_null = нульовий вказівник
|
||||||
err_numlock = не вдалося встановити numlock
|
|
||||||
err_pam = невдала pam транзакція
|
err_pam = невдала pam транзакція
|
||||||
err_pam_abort = pam транзакція перервана
|
err_pam_abort = pam транзакція перервана
|
||||||
err_pam_acct_expired = термін дії акаунту вичерпано
|
err_pam_acct_expired = термін дії акаунту вичерпано
|
||||||
|
|
@ -49,34 +49,34 @@ err_perm_dir = не вдалося змінити поточний катало
|
||||||
err_perm_group = не вдалося понизити права доступу групи
|
err_perm_group = не вдалося понизити права доступу групи
|
||||||
err_perm_user = не вдалося понизити права доступу користувача
|
err_perm_user = не вдалося понизити права доступу користувача
|
||||||
err_pwnam = не вдалося отримати дані користувача
|
err_pwnam = не вдалося отримати дані користувача
|
||||||
err_sleep = не вдалося виконати команду сну
|
|
||||||
err_start = не вдалося виконати команду запуску
|
|
||||||
err_battery = не вдалося завантажити стан акумулятора
|
|
||||||
err_switch_tty = не вдалося переключити tty
|
|
||||||
err_tty_ctrl = передача керування tty не вдалася
|
|
||||||
err_no_users = користувачів не знайдено
|
|
||||||
err_uid_range = не вдалося динамічно отримати діапазон uid
|
|
||||||
err_user_gid = не вдалося змінити GID користувача
|
err_user_gid = не вдалося змінити GID користувача
|
||||||
err_user_init = не вдалося ініціалізувати користувача
|
err_user_init = не вдалося ініціалізувати користувача
|
||||||
err_user_uid = не вдалося змінити UID користувача
|
err_user_uid = не вдалося змінити UID користувача
|
||||||
err_xauth = команда xauth не вдалася
|
|
||||||
err_xcb_conn = з'єднання xcb не вдалося
|
|
||||||
err_xsessions_dir = не вдалося знайти каталог сесій
|
err_xsessions_dir = не вдалося знайти каталог сесій
|
||||||
err_xsessions_open = не вдалося відкрити каталог сесій
|
err_xsessions_open = не вдалося відкрити каталог сесій
|
||||||
hibernate = гібернація
|
|
||||||
insert = вставити
|
|
||||||
login = логін
|
login = логін
|
||||||
logout = вийти
|
logout = вийти
|
||||||
no_x11_support = підтримку x11 вимкнено під час компіляції
|
|
||||||
normal = нормальний
|
|
||||||
numlock = numlock
|
numlock = numlock
|
||||||
other = інший
|
|
||||||
password = пароль
|
password = пароль
|
||||||
restart = перезавантажити
|
restart = перезавантажити
|
||||||
shell = оболонка
|
shell = оболонка
|
||||||
shutdown = вимкнути
|
shutdown = вимкнути
|
||||||
sleep = сплячий режим
|
|
||||||
toggle_password = показати/приховати пароль
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
authenticating = 正在认证...
|
|
||||||
brightness_down = 降低亮度
|
|
||||||
brightness_up = 提高亮度
|
|
||||||
capslock = 大写锁定
|
capslock = 大写锁定
|
||||||
custom = 自定义
|
|
||||||
custom_info_err_output_long = 输出过长
|
|
||||||
custom_info_err_no_output = 无输出
|
|
||||||
custom_info_err_no_output_error = ,可能有错误
|
|
||||||
err_alloc = 内存分配失败
|
err_alloc = 内存分配失败
|
||||||
err_args = 无法解析命令行参数
|
|
||||||
err_autologin_session = 未找到自动登录会话
|
|
||||||
err_bounds = 索引越界
|
err_bounds = 索引越界
|
||||||
err_brightness_change = 无法更改亮度
|
|
||||||
err_chdir = 无法打开home文件夹
|
err_chdir = 无法打开home文件夹
|
||||||
err_clock_too_long = 时钟字符串过长
|
|
||||||
err_config = 无法解析配置文件
|
|
||||||
err_crawl = 无法扫描会话目录
|
|
||||||
err_dgn_oob = 日志消息
|
err_dgn_oob = 日志消息
|
||||||
err_domain = 无效的域
|
err_domain = 无效的域
|
||||||
err_empty_password = 不允许空密码
|
|
||||||
err_envlist = 无法获取环境变量列表
|
|
||||||
err_get_active_tty = 无法获取当前活动的tty
|
|
||||||
err_hibernate = 无法执行休眠命令
|
|
||||||
err_hostname = 获取主机名失败
|
err_hostname = 获取主机名失败
|
||||||
err_inactivity = 无法执行非活动命令
|
|
||||||
err_lock_state = 无法获取锁定状态
|
|
||||||
err_log = 无法打开日志文件
|
|
||||||
err_mlock = 锁定密码存储器失败
|
err_mlock = 锁定密码存储器失败
|
||||||
err_null = 空指针
|
err_null = 空指针
|
||||||
err_numlock = 无法设置numlock
|
|
||||||
err_pam = PAM事件失败
|
err_pam = PAM事件失败
|
||||||
err_pam_abort = PAM事务已中止
|
err_pam_abort = PAM事务已中止
|
||||||
err_pam_acct_expired = 帐户已过期
|
err_pam_acct_expired = 帐户已过期
|
||||||
|
|
@ -49,34 +49,34 @@ err_perm_dir = 更改当前目录失败
|
||||||
err_perm_group = 组权限降级失败
|
err_perm_group = 组权限降级失败
|
||||||
err_perm_user = 用户权限降级失败
|
err_perm_user = 用户权限降级失败
|
||||||
err_pwnam = 获取用户信息失败
|
err_pwnam = 获取用户信息失败
|
||||||
err_sleep = 无法执行睡眠命令
|
|
||||||
err_start = 无法执行启动命令
|
|
||||||
err_battery = 无法加载电池状态
|
|
||||||
err_switch_tty = 无法切换tty
|
|
||||||
err_tty_ctrl = tty控制转移失败
|
|
||||||
err_no_users = 未找到用户
|
|
||||||
err_uid_range = 无法动态获取uid范围
|
|
||||||
err_user_gid = 设置用户GID失败
|
err_user_gid = 设置用户GID失败
|
||||||
err_user_init = 初始化用户失败
|
err_user_init = 初始化用户失败
|
||||||
err_user_uid = 设置用户UID失败
|
err_user_uid = 设置用户UID失败
|
||||||
err_xauth = xauth命令失败
|
|
||||||
err_xcb_conn = xcb连接失败
|
|
||||||
err_xsessions_dir = 找不到会话文件夹
|
err_xsessions_dir = 找不到会话文件夹
|
||||||
err_xsessions_open = 无法打开会话文件夹
|
err_xsessions_open = 无法打开会话文件夹
|
||||||
hibernate = 休眠
|
|
||||||
insert = 插入
|
|
||||||
login = 登录
|
login = 登录
|
||||||
logout = 注销
|
logout = 注销
|
||||||
no_x11_support = x11支持在编译时被禁用
|
|
||||||
normal = 正常
|
|
||||||
numlock = 数字锁定
|
numlock = 数字锁定
|
||||||
other = 其他
|
|
||||||
password = 密码
|
password = 密码
|
||||||
restart = 重启
|
|
||||||
shell = shell
|
shell = shell
|
||||||
shutdown = 关机
|
|
||||||
sleep = 睡眠
|
|
||||||
toggle_password = 显示/隐藏密码
|
|
||||||
wayland = wayland
|
wayland = wayland
|
||||||
x11 = x11
|
x11 = x11
|
||||||
xinitrc = xinitrc
|
xinitrc = xinitrc
|
||||||
|
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
authenticating = 正在驗證...
|
|
||||||
brightness_down = 降低亮度
|
|
||||||
brightness_up = 提高亮度
|
|
||||||
capslock = 大寫鎖定
|
|
||||||
custom = 自訂
|
|
||||||
custom_info_err_output_long = 輸出過長
|
|
||||||
custom_info_err_no_output = 無輸出
|
|
||||||
custom_info_err_no_output_error = ,可能有錯誤
|
|
||||||
err_alloc = 記憶體配置失敗
|
|
||||||
err_args = 無法解析命令列參數
|
|
||||||
err_autologin_session = 找不到自動登入工作階段
|
|
||||||
err_bounds = 索引超出範圍
|
|
||||||
err_brightness_change = 無法變更亮度
|
|
||||||
err_chdir = 無法開啟家目錄
|
|
||||||
err_clock_too_long = 時鐘字串過長
|
|
||||||
err_config = 無法解析設定檔
|
|
||||||
err_crawl = 無法掃描工作階段目錄
|
|
||||||
err_dgn_oob = 日誌訊息
|
|
||||||
err_domain = 無效的網域
|
|
||||||
err_empty_password = 不允許空密碼
|
|
||||||
err_envlist = 無法取得環境變數清單
|
|
||||||
err_get_active_tty = 無法取得目前使用中的 tty
|
|
||||||
err_hibernate = 無法執行休眠命令
|
|
||||||
err_hostname = 取得主機名稱失敗
|
|
||||||
err_inactivity = 無法執行閒置命令
|
|
||||||
err_lock_state = 無法取得鎖定狀態
|
|
||||||
err_log = 無法開啟日誌檔案
|
|
||||||
err_mlock = 鎖定密碼記憶體失敗
|
|
||||||
err_null = 空指標
|
|
||||||
err_numlock = 無法設定 numlock
|
|
||||||
err_pam = PAM 交易失敗
|
|
||||||
err_pam_abort = PAM 交易已中止
|
|
||||||
err_pam_acct_expired = 帳號已過期
|
|
||||||
err_pam_auth = 驗證錯誤
|
|
||||||
err_pam_authinfo_unavail = 取得使用者資訊失敗
|
|
||||||
err_pam_authok_reqd = 金鑰已過期
|
|
||||||
err_pam_buf = 記憶體緩衝區錯誤
|
|
||||||
err_pam_cred_err = 設定憑證失敗
|
|
||||||
err_pam_cred_expired = 憑證已過期
|
|
||||||
err_pam_cred_insufficient = 憑證不足
|
|
||||||
err_pam_cred_unavail = 無法取得憑證
|
|
||||||
err_pam_maxtries = 已達到最大嘗試次數限制
|
|
||||||
err_pam_perm_denied = 拒絕存取
|
|
||||||
err_pam_session = 工作階段錯誤
|
|
||||||
err_pam_sys = 系統錯誤
|
|
||||||
err_pam_user_unknown = 未知的使用者
|
|
||||||
err_path = 無法設定路徑
|
|
||||||
err_perm_dir = 變更目前目錄失敗
|
|
||||||
err_perm_group = 群組權限降級失敗
|
|
||||||
err_perm_user = 使用者權限降級失敗
|
|
||||||
err_pwnam = 取得使用者資訊失敗
|
|
||||||
err_sleep = 無法執行睡眠命令
|
|
||||||
err_start = 無法執行啟動命令
|
|
||||||
err_battery = 無法載入電池狀態
|
|
||||||
err_switch_tty = 無法切換 tty
|
|
||||||
err_tty_ctrl = tty 控制權移轉失敗
|
|
||||||
err_no_users = 找不到使用者
|
|
||||||
err_uid_range = 無法動態取得 uid 範圍
|
|
||||||
err_user_gid = 設定使用者 GID 失敗
|
|
||||||
err_user_init = 初始化使用者失敗
|
|
||||||
err_user_uid = 設定使用者 UID 失敗
|
|
||||||
err_xauth = xauth 命令失敗
|
|
||||||
err_xcb_conn = xcb 連線失敗
|
|
||||||
err_xsessions_dir = 找不到工作階段資料夾
|
|
||||||
err_xsessions_open = 無法開啟工作階段資料夾
|
|
||||||
hibernate = 休眠
|
|
||||||
insert = 插入
|
|
||||||
login = 登入
|
|
||||||
logout = 登出
|
|
||||||
no_x11_support = x11 支援已在編譯時停用
|
|
||||||
normal = 正常
|
|
||||||
numlock = 數字鎖定
|
|
||||||
other = 其他
|
|
||||||
password = 密碼
|
|
||||||
restart = 重新啟動
|
|
||||||
shell = shell
|
|
||||||
shutdown = 關機
|
|
||||||
sleep = 睡眠
|
|
||||||
toggle_password = 顯示/隱藏密碼
|
|
||||||
wayland = wayland
|
|
||||||
x11 = x11
|
|
||||||
xinitrc = xinitrc
|
|
||||||
|
|
@ -1,28 +1,17 @@
|
||||||
# Default kmsconvt@.service
|
|
||||||
# Modified for Ly by AnErrupTion <anerruption@disroot.org>
|
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=TUI display manager on %I using KMSCON
|
Description=TUI display manager using KMSCON
|
||||||
After=systemd-user-sessions.service plymouth-quit-wait.service rc-local.service kmsconvt@%i.service
|
After=systemd-user-sessions.service plymouth-quit-wait.service
|
||||||
Conflicts=getty@%i.service kmsconvt@%i.service ly@%i.service
|
After=kmsconvt@%i.service
|
||||||
OnFailure=ly@%i.service
|
Conflicts=kmsconvt@%i.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=$PREFIX_DIRECTORY/bin/kmscon --term=linux --font-engine unifont --vt=%I --login -- $PREFIX_DIRECTORY/bin/$EXECUTABLE_NAME --use-kmscon-vt
|
ExecStart=$PREFIX_DIRECTORY/bin/kmscon --font-engine unifont --vt=%I --seats=seat0 --login -- $PREFIX_DIRECTORY/bin/$EXECUTABLE_NAME --use-kmscon-vt
|
||||||
Type=idle
|
|
||||||
Restart=always
|
|
||||||
RestartSec=0
|
|
||||||
UtmpIdentifier=%I
|
|
||||||
StandardInput=tty
|
StandardInput=tty
|
||||||
StandardOutput=tty
|
UtmpIdentifier=%I
|
||||||
TTYPath=/dev/%I
|
TTYPath=/dev/%I
|
||||||
TTYReset=yes
|
TTYReset=yes
|
||||||
TTYVHangup=yes
|
TTYVHangup=yes
|
||||||
TTYVTDisallocate=yes
|
TTYVTDisallocate=yes
|
||||||
IgnoreSIGPIPE=no
|
|
||||||
SendSIGHUP=yes
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
Alias=autovt@.service
|
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
DefaultInstance=tty2
|
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,16 @@
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
#
|
|
||||||
# This file is part of systemd.
|
|
||||||
#
|
|
||||||
# systemd is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU Lesser General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2.1 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# Modified for Ly by AnErrupTion <anerruption@disroot.org>
|
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=TUI display manager on %I
|
Description=TUI display manager
|
||||||
After=systemd-user-sessions.service plymouth-quit-wait.service getty@%i.service
|
After=systemd-user-sessions.service plymouth-quit-wait.service
|
||||||
Conflicts=getty@%i.service kmsconvt@%i.service ly-kmsconvt@%i.service
|
After=getty@%i.service
|
||||||
|
Conflicts=getty@%i.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=$PREFIX_DIRECTORY/bin/agetty -nl $PREFIX_DIRECTORY/bin/$EXECUTABLE_NAME %I ${TERM}
|
|
||||||
Type=idle
|
Type=idle
|
||||||
Restart=always
|
ExecStart=$PREFIX_DIRECTORY/bin/$EXECUTABLE_NAME
|
||||||
RestartSec=0
|
|
||||||
UtmpIdentifier=%I
|
|
||||||
StandardInput=tty
|
StandardInput=tty
|
||||||
StandardOutput=tty
|
|
||||||
TTYPath=/dev/%I
|
TTYPath=/dev/%I
|
||||||
TTYReset=yes
|
TTYReset=yes
|
||||||
TTYVHangup=yes
|
TTYVHangup=yes
|
||||||
TTYVTDisallocate=yes
|
|
||||||
IgnoreSIGPIPE=no
|
|
||||||
SendSIGHUP=yes
|
|
||||||
|
|
||||||
ImportCredential=tty.virtual.%I.agetty.*:agetty.
|
|
||||||
ImportCredential=tty.virtual.%I.login.*:login.
|
|
||||||
ImportCredential=agetty.*
|
|
||||||
ImportCredential=login.*
|
|
||||||
ImportCredential=shell.*
|
|
||||||
|
|
||||||
# Unset locale for the console getty since the console has problems
|
|
||||||
# displaying some internationalized messages.
|
|
||||||
UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
Alias=autovt@.service
|
|
||||||
|
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
DefaultInstance=tty2
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
# OpenPAM (used in FreeBSD) doesn't support prepending "-" for ignoring missing
|
# OpenPAM (used in FreeBSD) doesn't support prepending "-" for ignoring missing
|
||||||
# modules.
|
# modules.
|
||||||
auth required pam_permit.so
|
auth required pam_permit.so
|
||||||
|
auth include login
|
||||||
account include login
|
account include login
|
||||||
password include login
|
password include login
|
||||||
session include login
|
session include login
|
||||||
|
|
|
||||||
|
|
@ -71,14 +71,14 @@ fn draw(self: *Cascade) void {
|
||||||
|
|
||||||
if ((self.buffer.random.int(u16) % 10) > 7) continue;
|
if ((self.buffer.random.int(u16) % 10) > 7) continue;
|
||||||
|
|
||||||
cell.?.put(x, y) catch {};
|
cell.?.put(x, y);
|
||||||
|
|
||||||
var space = Cell.init(
|
var space = Cell.init(
|
||||||
' ',
|
' ',
|
||||||
cell_under.?.fg,
|
cell_under.?.fg,
|
||||||
cell_under.?.bg,
|
cell_under.?.bg,
|
||||||
);
|
);
|
||||||
space.put(x, y - 1) catch {};
|
space.put(x, y - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -87,6 +87,6 @@ fn draw(self: *Cascade) void {
|
||||||
self.current_auth_fails.* = 0;
|
self.current_auth_fails.* = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TerminalBuffer.presentBuffer() catch {};
|
TerminalBuffer.presentBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ fn draw(self: *ColorMix) void {
|
||||||
}
|
}
|
||||||
|
|
||||||
const cell = self.palette[@as(usize, @trunc(math.floor(length(uv) * 5.0))) % palette_len];
|
const cell = self.palette[@as(usize, @trunc(math.floor(length(uv) * 5.0))) % palette_len];
|
||||||
cell.put(x, y) catch {};
|
cell.put(x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,13 +129,13 @@ fn draw(self: *Doom) void {
|
||||||
// Send known fire levels to terminal buffer
|
// Send known fire levels to terminal buffer
|
||||||
const from_cell = self.fire[level_buf_from];
|
const from_cell = self.fire[level_buf_from];
|
||||||
const to_cell = self.fire[level_buf_to];
|
const to_cell = self.fire[level_buf_to];
|
||||||
from_cell.put(x, y) catch {};
|
from_cell.put(x, y);
|
||||||
to_cell.put(to_x, to_y) catch {};
|
to_cell.put(to_x, to_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw bottom line (fire source)
|
// Draw bottom line (fire source)
|
||||||
const src_cell = self.fire[STEPS];
|
const src_cell = self.fire[STEPS];
|
||||||
src_cell.put(x, self.terminal_buffer.height - 1) catch {};
|
src_cell.put(x, self.terminal_buffer.height - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,25 @@ const LogFile = ly_core.LogFile;
|
||||||
const enums = @import("../enums.zig");
|
const enums = @import("../enums.zig");
|
||||||
const DurOffsetAlignment = enums.DurOffsetAlignment;
|
const DurOffsetAlignment = enums.DurOffsetAlignment;
|
||||||
|
|
||||||
|
fn read_decompress_file(allocator: Allocator, io: std.Io, file_path: []const u8) ![]u8 {
|
||||||
|
const file_buffer = std.Io.Dir.cwd().openFile(io, file_path, .{}) catch {
|
||||||
|
return error.FileNotFound;
|
||||||
|
};
|
||||||
|
defer file_buffer.close(io);
|
||||||
|
|
||||||
|
var file_reader_buffer: [4096]u8 = undefined;
|
||||||
|
var decompress_buffer: [flate.max_window_len]u8 = undefined;
|
||||||
|
|
||||||
|
var file_reader = file_buffer.reader(io, &file_reader_buffer);
|
||||||
|
var decompress: flate.Decompress = .init(&file_reader.interface, .gzip, &decompress_buffer);
|
||||||
|
|
||||||
|
const file_decompressed = decompress.reader.allocRemaining(allocator, .unlimited) catch {
|
||||||
|
return error.NotValidFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
return file_decompressed;
|
||||||
|
}
|
||||||
|
|
||||||
const Frame = struct {
|
const Frame = struct {
|
||||||
frameNumber: i32,
|
frameNumber: i32,
|
||||||
delay: f32,
|
delay: f32,
|
||||||
|
|
@ -43,7 +62,7 @@ const Frame = struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://github.com/cmang/durdraw/blob/0.29.0/durformat.md
|
// https://github.com/cmang/durdraw/blob/0.29.0/durformat.md
|
||||||
const DurFormatRaw = struct {
|
const DurFormat = struct {
|
||||||
allocator: Allocator,
|
allocator: Allocator,
|
||||||
formatVersion: ?i64 = null,
|
formatVersion: ?i64 = null,
|
||||||
colorFormat: ?[]const u8 = null,
|
colorFormat: ?[]const u8 = null,
|
||||||
|
|
@ -53,48 +72,38 @@ const DurFormatRaw = struct {
|
||||||
lines: ?i64 = null,
|
lines: ?i64 = null,
|
||||||
frames: std.ArrayList(Frame) = undefined,
|
frames: std.ArrayList(Frame) = undefined,
|
||||||
|
|
||||||
// Validate data and return a valid DurFormat
|
pub fn valid(self: *DurFormat) bool {
|
||||||
// Consumes `self`, making it unusable after
|
if (self.formatVersion != null and
|
||||||
pub fn validate(self: *DurFormatRaw) !DurFormat {
|
self.colorFormat != null and
|
||||||
// v8 may have breaking changes like changing the colormap xy direction
|
self.encoding != null and
|
||||||
// (https://github.com/cmang/durdraw/issues/24)
|
self.framerate != null and
|
||||||
const format_version = self.formatVersion orelse return error.MissingFieldVersion;
|
self.columns != null and
|
||||||
if (format_version != 7) return error.UnsupportedVersion;
|
self.lines != null and
|
||||||
|
self.frames.items.len >= 1)
|
||||||
|
{
|
||||||
|
// v8 may have breaking changes like changing the colormap xy direction
|
||||||
|
// (https://github.com/cmang/durdraw/issues/24)
|
||||||
|
if (self.formatVersion.? != 7) return false;
|
||||||
|
|
||||||
const color_format_str = self.colorFormat orelse return error.MissingFieldColorFormat;
|
// Code currently only supports 16 and 256 color format only
|
||||||
// Code currently only supports 16 and 256 color format only
|
if (!(eql(u8, "16", self.colorFormat.?) or eql(u8, "256", self.colorFormat.?)))
|
||||||
const color_format: DurColorFormat =
|
return false;
|
||||||
if (eql(u8, color_format_str, "16")) .@"16" else if (eql(u8, color_format_str, "256")) .@"256" else return error.UnsupportedColorFormat;
|
|
||||||
|
|
||||||
const encoding_str = self.encoding orelse return error.MissingFieldEncoding;
|
// Code currently supports only utf-8 encoding
|
||||||
// Code currently supports only utf-8 encoding
|
if (!eql(u8, self.encoding.?, "utf-8")) return false;
|
||||||
const encoding: DurEncoding = if (eql(u8, encoding_str, "utf-8")) .utf_8 else return error.UnsupportedEncoding;
|
|
||||||
|
|
||||||
if (self.framerate == null) return error.MissingFieldFramerate;
|
// Sanity check on file
|
||||||
if (self.framerate.? <= 0) return error.InvalidFramerate;
|
if (self.columns.? <= 0) return false;
|
||||||
const framerate: f64 = self.framerate.?;
|
if (self.lines.? <= 0) return false;
|
||||||
|
if (self.framerate.? < 0) return false;
|
||||||
|
|
||||||
// Sanity check on file
|
return true;
|
||||||
if (self.columns == null or self.lines == null) return error.MissingDimensions;
|
}
|
||||||
const columns = std.math.cast(u32, self.columns.?) orelse return error.InvalidColumnCount;
|
|
||||||
const lines = std.math.cast(u32, self.lines.?) orelse return error.InvalidLineCount;
|
|
||||||
|
|
||||||
if (self.frames.items.len == 0) return error.NoFrames;
|
return false;
|
||||||
const frames = self.frames;
|
|
||||||
|
|
||||||
return .{
|
|
||||||
.allocator = self.allocator,
|
|
||||||
.formatVersion = format_version,
|
|
||||||
.colorFormat = color_format,
|
|
||||||
.encoding = encoding,
|
|
||||||
.framerate = framerate,
|
|
||||||
.columns = columns,
|
|
||||||
.lines = lines,
|
|
||||||
.frames = frames,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parseFromJson(self: *DurFormatRaw, allocator: Allocator, dur_json_root: Json.Value) !void {
|
fn parse_dur_from_json(self: *DurFormat, allocator: Allocator, dur_json_root: Json.Value) !void {
|
||||||
var dur_movie = if (dur_json_root.object.get("DurMovie")) |dm| dm.object else return error.NotValidFile;
|
var dur_movie = if (dur_json_root.object.get("DurMovie")) |dm| dm.object else return error.NotValidFile;
|
||||||
|
|
||||||
// Depending on the version, a dur file can have different json object names (ie: columns vs sizeX)
|
// Depending on the version, a dur file can have different json object names (ie: columns vs sizeX)
|
||||||
|
|
@ -141,53 +150,28 @@ const DurFormatRaw = struct {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createFromFile(self: *DurFormatRaw, allocator: Allocator, io: std.Io, file_path: []const u8) !void {
|
pub fn create_from_file(self: *DurFormat, allocator: Allocator, io: std.Io, file_path: []const u8) !void {
|
||||||
const file = try std.Io.Dir.cwd().openFile(io, file_path, .{});
|
const file_decompressed = try read_decompress_file(allocator, io, file_path);
|
||||||
defer file.close(io);
|
defer allocator.free(file_decompressed);
|
||||||
|
|
||||||
var reader_buffer: [4096]u8 = undefined;
|
const parsed = try Json.parseFromSlice(Json.Value, allocator, file_decompressed, .{});
|
||||||
var decompress_buffer: [flate.max_window_len]u8 = undefined;
|
defer parsed.deinit();
|
||||||
|
|
||||||
var file_reader = file.reader(io, &reader_buffer);
|
try parse_dur_from_json(self, allocator, parsed.value);
|
||||||
var decompress: flate.Decompress = .init(&file_reader.interface, .gzip, &decompress_buffer);
|
|
||||||
|
|
||||||
var json_reader = Json.Reader.init(allocator, &decompress.reader);
|
if (!self.valid()) {
|
||||||
defer json_reader.deinit();
|
return error.NotValidFile;
|
||||||
|
}
|
||||||
const json = try Json.parseFromTokenSource(Json.Value, allocator, &json_reader, .{});
|
|
||||||
defer json.deinit();
|
|
||||||
|
|
||||||
try parseFromJson(self, allocator, json.value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init(allocator: Allocator) DurFormatRaw {
|
pub fn init(allocator: Allocator) DurFormat {
|
||||||
return .{ .allocator = allocator };
|
return .{ .allocator = allocator };
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn deinit(self: *DurFormatRaw) void {
|
pub fn deinit(self: *DurFormat) void {
|
||||||
if (self.colorFormat) |str| self.allocator.free(str);
|
if (self.colorFormat) |str| self.allocator.free(str);
|
||||||
if (self.encoding) |str| self.allocator.free(str);
|
if (self.encoding) |str| self.allocator.free(str);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const DurColorFormat = enum {
|
|
||||||
@"16",
|
|
||||||
@"256",
|
|
||||||
};
|
|
||||||
|
|
||||||
const DurEncoding = enum { utf_8 };
|
|
||||||
|
|
||||||
const DurFormat = struct {
|
|
||||||
allocator: Allocator,
|
|
||||||
formatVersion: i64,
|
|
||||||
colorFormat: DurColorFormat,
|
|
||||||
encoding: DurEncoding,
|
|
||||||
framerate: f64,
|
|
||||||
columns: u32,
|
|
||||||
lines: u32,
|
|
||||||
frames: std.ArrayList(Frame),
|
|
||||||
|
|
||||||
pub fn deinit(self: *DurFormat) void {
|
|
||||||
for (self.frames.items) |frame| {
|
for (self.frames.items) |frame| {
|
||||||
frame.deinit(self.allocator);
|
frame.deinit(self.allocator);
|
||||||
}
|
}
|
||||||
|
|
@ -256,7 +240,7 @@ const durcolor_table_to_color16 = [17]u32{
|
||||||
15, // 16 bright white
|
15, // 16 bright white
|
||||||
};
|
};
|
||||||
|
|
||||||
fn sixCubeToChannel(sixcube: u32) u32 {
|
fn sixcube_to_channel(sixcube: u32) u32 {
|
||||||
// Although the range top for the extended range is 0xFF, 6 is not divisible into 0xFF,
|
// Although the range top for the extended range is 0xFF, 6 is not divisible into 0xFF,
|
||||||
// so we use 0xF0 instead with a scaler
|
// so we use 0xF0 instead with a scaler
|
||||||
const equal_divisions = 0xF0 / 6;
|
const equal_divisions = 0xF0 / 6;
|
||||||
|
|
@ -267,7 +251,7 @@ fn sixCubeToChannel(sixcube: u32) u32 {
|
||||||
return if (sixcube > 0) (sixcube * equal_divisions) + scaler else 0;
|
return if (sixcube > 0) (sixcube * equal_divisions) + scaler else 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn convert256ToRgb(color_256: u32) u32 {
|
fn convert_256_to_rgb(color_256: u32) u32 {
|
||||||
var rgb_color: u32 = 0;
|
var rgb_color: u32 = 0;
|
||||||
|
|
||||||
// 0 - 15 is the standard color range, map to array table
|
// 0 - 15 is the standard color range, map to array table
|
||||||
|
|
@ -283,9 +267,9 @@ fn convert256ToRgb(color_256: u32) u32 {
|
||||||
// divide by 1 gets the height of the cube (divide 1 for clarity for what we are doing)
|
// divide by 1 gets the height of the cube (divide 1 for clarity for what we are doing)
|
||||||
// each channel can be 6 levels of brightness hence remander operation of 6
|
// each channel can be 6 levels of brightness hence remander operation of 6
|
||||||
// finally bitshift to correct rgb channel (16 for red, 8 for green, 0 for blue)
|
// finally bitshift to correct rgb channel (16 for red, 8 for green, 0 for blue)
|
||||||
rgb_color |= sixCubeToChannel(((color_256 - 16) / 36) % 6) << 16;
|
rgb_color |= sixcube_to_channel(((color_256 - 16) / 36) % 6) << 16;
|
||||||
rgb_color |= sixCubeToChannel(((color_256 - 16) / 6) % 6) << 8;
|
rgb_color |= sixcube_to_channel(((color_256 - 16) / 6) % 6) << 8;
|
||||||
rgb_color |= sixCubeToChannel(((color_256 - 16) / 1) % 6);
|
rgb_color |= sixcube_to_channel(((color_256 - 16) / 1) % 6);
|
||||||
}
|
}
|
||||||
// 232 - 255 is the grayscale range
|
// 232 - 255 is the grayscale range
|
||||||
else {
|
else {
|
||||||
|
|
@ -343,12 +327,12 @@ fn center(v: i64) i64 {
|
||||||
return @intCast(@divTrunc(v, 2) + @mod(v, 2));
|
return @intCast(@divTrunc(v, 2) + @mod(v, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn calculateStartPos(terminal_buffer: *TerminalBuffer, dur_movie: *DurFormat, offset_alignment: DurOffsetAlignment, offset: IVec2) IVec2 {
|
fn calc_start_position(terminal_buffer: *TerminalBuffer, dur_movie: *DurFormat, offset_alignment: DurOffsetAlignment, offset: IVec2) IVec2 {
|
||||||
const buf_width: i64 = @intCast(terminal_buffer.width);
|
const buf_width: i64 = @intCast(terminal_buffer.width);
|
||||||
const buf_height: i64 = @intCast(terminal_buffer.height);
|
const buf_height: i64 = @intCast(terminal_buffer.height);
|
||||||
|
|
||||||
const movie_width: i64 = @intCast(dur_movie.columns);
|
const movie_width: i64 = @intCast(dur_movie.columns.?);
|
||||||
const movie_height: i64 = @intCast(dur_movie.lines);
|
const movie_height: i64 = @intCast(dur_movie.lines.?);
|
||||||
|
|
||||||
const start_pos: IVec2 = switch (offset_alignment) {
|
const start_pos: IVec2 = switch (offset_alignment) {
|
||||||
DurOffsetAlignment.center => .{ center(buf_width) - center(movie_width), center(buf_height) - center(movie_height) },
|
DurOffsetAlignment.center => .{ center(buf_width) - center(movie_width), center(buf_height) - center(movie_height) },
|
||||||
|
|
@ -379,10 +363,9 @@ pub fn init(
|
||||||
timeout_sec: u12,
|
timeout_sec: u12,
|
||||||
frame_delay: u16,
|
frame_delay: u16,
|
||||||
) !DurFile {
|
) !DurFile {
|
||||||
var dur_movie_raw: DurFormatRaw = .init(allocator);
|
var dur_movie: DurFormat = .init(allocator);
|
||||||
defer dur_movie_raw.deinit();
|
|
||||||
|
|
||||||
dur_movie_raw.createFromFile(allocator, io, file_path) catch |err| switch (err) {
|
dur_movie.create_from_file(allocator, io, file_path) catch |err| switch (err) {
|
||||||
error.FileNotFound => {
|
error.FileNotFound => {
|
||||||
try log_file.err(io, "tui", "dur_file was not found at: {s}", .{file_path});
|
try log_file.err(io, "tui", "dur_file was not found at: {s}", .{file_path});
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -394,70 +377,19 @@ pub fn init(
|
||||||
else => return err,
|
else => return err,
|
||||||
};
|
};
|
||||||
|
|
||||||
var dur_movie = dur_movie_raw.validate() catch |err| switch (err) {
|
|
||||||
error.MissingFieldVersion => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: missing field formatVersion!", .{});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.UnsupportedVersion => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: unsupported version ({d})!", .{dur_movie_raw.formatVersion.?});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.MissingFieldColorFormat => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: missing field colorFormat!", .{});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.UnsupportedColorFormat => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: unsupported colorFormat ({s})!", .{dur_movie_raw.colorFormat.?});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.MissingFieldEncoding => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: missing field encoding!", .{});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.UnsupportedEncoding => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: unsupported encoding ({s})!", .{dur_movie_raw.encoding.?});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.MissingFieldFramerate => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: missing field framerate!", .{});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.InvalidFramerate => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: negative framerate value found!", .{});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.MissingDimensions => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: missing field(s) lines and/or columns!", .{});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.InvalidColumnCount => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: columns value falls outside of supported range ({d})!", .{dur_movie_raw.columns.?});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.InvalidLineCount => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: lines value falls outside of supported range ({d})!", .{dur_movie_raw.lines.?});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
error.NoFrames => {
|
|
||||||
try log_file.err(io, "tui", "dur_file loaded was invalid: animation has no frames!", .{});
|
|
||||||
return err;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// 4 bit mode with 256 color is unsupported
|
// 4 bit mode with 256 color is unsupported
|
||||||
if (!full_color and dur_movie.colorFormat == .@"256") {
|
if (!full_color and eql(u8, dur_movie.colorFormat.?, "256")) {
|
||||||
try log_file.err(io, "tui", "dur_file can not be 256 color encoded when not using full_color option!", .{});
|
try log_file.err(io, "tui", "dur_file can not be 256 color encoded when not using full_color option!", .{});
|
||||||
dur_movie.deinit();
|
dur_movie.deinit();
|
||||||
return error.NotFullColor;
|
return error.InvalidColorFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
const offset: IVec2 = .{ x_offset, y_offset };
|
const offset: IVec2 = .{ x_offset, y_offset };
|
||||||
|
|
||||||
const start_pos = calculateStartPos(terminal_buffer, &dur_movie, offset_alignment, offset);
|
const start_pos = calc_start_position(terminal_buffer, &dur_movie, offset_alignment, offset);
|
||||||
|
|
||||||
// Convert dur fps to frames per ms
|
// Convert dur fps to frames per ms
|
||||||
const frame_time: u32 = @trunc(1000 / dur_movie.framerate);
|
const frame_time: u32 = @trunc(1000 / dur_movie.framerate.?);
|
||||||
|
|
||||||
return .{
|
return .{
|
||||||
.instance = null,
|
.instance = null,
|
||||||
|
|
@ -474,7 +406,7 @@ pub fn init(
|
||||||
.frame_delay = frame_delay,
|
.frame_delay = frame_delay,
|
||||||
.dur_movie = dur_movie,
|
.dur_movie = dur_movie,
|
||||||
.frame_time = frame_time,
|
.frame_time = frame_time,
|
||||||
.is_color_format_16 = dur_movie.colorFormat == .@"16",
|
.is_color_format_16 = eql(u8, dur_movie.colorFormat.?, "16"),
|
||||||
.offset_alignment = offset_alignment,
|
.offset_alignment = offset_alignment,
|
||||||
.offset = offset,
|
.offset = offset,
|
||||||
};
|
};
|
||||||
|
|
@ -502,7 +434,7 @@ fn deinit(self: *DurFile) void {
|
||||||
|
|
||||||
fn realloc(self: *DurFile) !void {
|
fn realloc(self: *DurFile) !void {
|
||||||
// when terminal size changes, we need to recalculate the start_pos based on the new size
|
// when terminal size changes, we need to recalculate the start_pos based on the new size
|
||||||
self.start_pos = calculateStartPos(self.terminal_buffer, &self.dur_movie, self.offset_alignment, self.offset);
|
self.start_pos = calc_start_position(self.terminal_buffer, &self.dur_movie, self.offset_alignment, self.offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw(self: *DurFile) void {
|
fn draw(self: *DurFile) void {
|
||||||
|
|
@ -511,12 +443,12 @@ fn draw(self: *DurFile) void {
|
||||||
const current_frame = self.dur_movie.frames.items[self.frames];
|
const current_frame = self.dur_movie.frames.items[self.frames];
|
||||||
|
|
||||||
// y is used as an iterator in the durformat, while cell_y gives us the correct placement for the cell (same for x)
|
// y is used as an iterator in the durformat, while cell_y gives us the correct placement for the cell (same for x)
|
||||||
for (0..@intCast(self.dur_movie.lines)) |y| {
|
for (0..@intCast(self.dur_movie.lines.?)) |y| {
|
||||||
const cell_y = @as(i32, @intCast(y)) + self.start_pos[VEC_Y];
|
const cell_y = @as(i32, @intCast(y)) + self.start_pos[VEC_Y];
|
||||||
|
|
||||||
var iter = std.unicode.Utf8View.initUnchecked(current_frame.contents[y]).iterator();
|
var iter = std.unicode.Utf8View.initUnchecked(current_frame.contents[y]).iterator();
|
||||||
|
|
||||||
for (0..@intCast(self.dur_movie.columns)) |x| {
|
for (0..@intCast(self.dur_movie.columns.?)) |x| {
|
||||||
const cell_x = @as(i32, @intCast(x)) + self.start_pos[VEC_X];
|
const cell_x = @as(i32, @intCast(x)) + self.start_pos[VEC_X];
|
||||||
|
|
||||||
const codepoint: u21 = iter.nextCodepoint().?;
|
const codepoint: u21 = iter.nextCodepoint().?;
|
||||||
|
|
@ -530,12 +462,12 @@ fn draw(self: *DurFile) void {
|
||||||
color_map_1 = durcolor_table_to_color16[color_map_1 + 1]; // Add 1, dur source stores it like this for some reason
|
color_map_1 = durcolor_table_to_color16[color_map_1 + 1]; // Add 1, dur source stores it like this for some reason
|
||||||
}
|
}
|
||||||
|
|
||||||
const fg_color = if (self.full_color) convert256ToRgb(color_map_0) else tb_color_16[color_map_0];
|
const fg_color = if (self.full_color) convert_256_to_rgb(color_map_0) else tb_color_16[color_map_0];
|
||||||
const bg_color = if (self.full_color) convert256ToRgb(color_map_1) else tb_color_16[color_map_1];
|
const bg_color = if (self.full_color) convert_256_to_rgb(color_map_1) else tb_color_16[color_map_1];
|
||||||
|
|
||||||
const cell = Cell{ .ch = @intCast(codepoint), .fg = fg_color, .bg = bg_color };
|
const cell = Cell{ .ch = @intCast(codepoint), .fg = fg_color, .bg = bg_color };
|
||||||
|
|
||||||
self.terminal_buffer.setCellBoundsChecked(cell_x, cell_y, cell) catch {};
|
self.terminal_buffer.setCellBoundsChecked(cell_x, cell_y, cell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ fn draw(self: *GameOfLife) void {
|
||||||
const row_offset = y * self.width;
|
const row_offset = y * self.width;
|
||||||
for (0..self.width) |x| {
|
for (0..self.width) |x| {
|
||||||
const cell = if (self.current_grid[row_offset + x]) alive_cell else self.dead_cell;
|
const cell = if (self.current_grid[row_offset + x]) alive_cell else self.dead_cell;
|
||||||
cell.put(x, y) catch {};
|
cell.put(x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,304 +0,0 @@
|
||||||
const std = @import("std");
|
|
||||||
const ly_ui = @import("ly-ui");
|
|
||||||
const LogFile = ly_ui.ly_core.LogFile;
|
|
||||||
const Widget = ly_ui.Widget;
|
|
||||||
const TerminalBuffer = ly_ui.TerminalBuffer;
|
|
||||||
const Cell = ly_ui.Cell;
|
|
||||||
const Allocator = std.mem.Allocator;
|
|
||||||
const InfoLine = @import("../components/InfoLine.zig");
|
|
||||||
const Lang = @import("../config/Lang.zig");
|
|
||||||
|
|
||||||
const zlua = @import("zlua");
|
|
||||||
|
|
||||||
const ly_lua = @embedFile("ly.lua");
|
|
||||||
|
|
||||||
const Lua = @This();
|
|
||||||
|
|
||||||
allocator: Allocator,
|
|
||||||
instance: ?Widget = null,
|
|
||||||
lua: *zlua.Lua,
|
|
||||||
log: *LogFile,
|
|
||||||
terminal_buffer: *TerminalBuffer,
|
|
||||||
width: usize,
|
|
||||||
height: usize,
|
|
||||||
margin: usize,
|
|
||||||
io: std.Io,
|
|
||||||
animation_delay: u16,
|
|
||||||
|
|
||||||
info_line: *InfoLine,
|
|
||||||
fg: u32,
|
|
||||||
bg: u32,
|
|
||||||
|
|
||||||
lang: Lang,
|
|
||||||
full_color: bool,
|
|
||||||
|
|
||||||
lua_error: bool = false,
|
|
||||||
lua_error_logged: bool = false,
|
|
||||||
lua_str: ?[:0]const u8 = null,
|
|
||||||
|
|
||||||
pub fn init(
|
|
||||||
io: std.Io,
|
|
||||||
alloc: Allocator,
|
|
||||||
log: *LogFile,
|
|
||||||
buf: *TerminalBuffer,
|
|
||||||
file: []const u8,
|
|
||||||
margin: u8,
|
|
||||||
animation_delay: u16,
|
|
||||||
info_line: *InfoLine,
|
|
||||||
fg: u32,
|
|
||||||
bg: u32,
|
|
||||||
lang: Lang,
|
|
||||||
full_color: bool,
|
|
||||||
) !Lua {
|
|
||||||
var self: Lua = .{
|
|
||||||
.lua = try zlua.Lua.init(alloc),
|
|
||||||
.allocator = alloc,
|
|
||||||
.terminal_buffer = buf,
|
|
||||||
.instance = null,
|
|
||||||
.log = log,
|
|
||||||
.width = 0,
|
|
||||||
.height = 0,
|
|
||||||
.margin = margin,
|
|
||||||
.io = io,
|
|
||||||
.animation_delay = animation_delay,
|
|
||||||
.info_line = info_line,
|
|
||||||
.fg = fg,
|
|
||||||
.bg = bg,
|
|
||||||
.lang = lang,
|
|
||||||
.full_color = full_color,
|
|
||||||
};
|
|
||||||
|
|
||||||
// exclude IO and debug libraries
|
|
||||||
self.lua.openBase();
|
|
||||||
self.lua.openBit();
|
|
||||||
self.lua.openMath();
|
|
||||||
self.lua.openString();
|
|
||||||
self.lua.openTable();
|
|
||||||
|
|
||||||
file_loading: {
|
|
||||||
const zf = std.mem.concatWithSentinel(alloc, u8, &[1][]const u8{file}, 0) catch |e| {
|
|
||||||
try self.log.err(self.io, "lua", "failed to allocate file path: {}", .{e});
|
|
||||||
self.lua_str = "failed to allocate file path!";
|
|
||||||
self.info_line.addMessage(lang.err_alloc, self.bg, self.fg) catch {};
|
|
||||||
return e;
|
|
||||||
};
|
|
||||||
defer alloc.free(zf);
|
|
||||||
|
|
||||||
// create the ly table
|
|
||||||
self.lua.newTable();
|
|
||||||
self.lua.setGlobal("ly");
|
|
||||||
|
|
||||||
// create ly.width and ly.height from TerminalBuffer width/height
|
|
||||||
self.propagateTerminalBounds();
|
|
||||||
|
|
||||||
_ = self.lua.getGlobal("ly");
|
|
||||||
_ = self.lua.pushString("clock");
|
|
||||||
self.lua.pushFunction(luaLyClock);
|
|
||||||
self.lua.setTable(-3);
|
|
||||||
_ = self.lua.pushString("putCell");
|
|
||||||
self.lua.pushFunction(luaPutCell);
|
|
||||||
self.lua.setTable(-3);
|
|
||||||
_ = self.lua.pushString("putLabel");
|
|
||||||
self.lua.pushFunction(luaPutLabel);
|
|
||||||
self.lua.setTable(-3);
|
|
||||||
_ = self.lua.pushString("putRect");
|
|
||||||
self.lua.pushFunction(luaPutRect);
|
|
||||||
self.lua.setTable(-3);
|
|
||||||
self.lua.setGlobal("ly");
|
|
||||||
|
|
||||||
self.lua.doFile(zf) catch {
|
|
||||||
const errorStr = self.lua.toString(-1) catch unreachable;
|
|
||||||
self.lua_str = try self.allocator.dupeSentinel(u8, errorStr, 0);
|
|
||||||
try self.log.err(self.io, "lua", "lua error: {s}", .{errorStr});
|
|
||||||
self.lua_error = true;
|
|
||||||
break :file_loading;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn draw(self: *Lua) void {
|
|
||||||
self.propagateTerminalBounds();
|
|
||||||
if (self.lua_error) {
|
|
||||||
// Ly's Red Screen of Omega-Death:tm:
|
|
||||||
const RED: u32 = if (self.full_color) TerminalBuffer.Color.TRUE_RED else TerminalBuffer.Color.ECOL_RED;
|
|
||||||
const cell = Cell.init(0x2588, RED, RED);
|
|
||||||
for (0..self.terminal_buffer.height) |y|
|
|
||||||
for (0..self.terminal_buffer.width) |x|
|
|
||||||
cell.put(x, y) catch {};
|
|
||||||
if (self.lua_str) |str|
|
|
||||||
for (str, 0..) |c, i| {
|
|
||||||
const dwidth = @divFloor(self.width, 2);
|
|
||||||
const dlen = @divFloor(str.len, 2);
|
|
||||||
Cell.init(c, 0x00FFFFFF, 0).put(
|
|
||||||
(if (dlen > dwidth) 0 else dwidth - dlen) + i,
|
|
||||||
self.margin + 5,
|
|
||||||
) catch {};
|
|
||||||
};
|
|
||||||
if (!self.lua_error_logged) {
|
|
||||||
self.info_line.addMessage("lua animation failed", self.bg, self.fg) catch {};
|
|
||||||
self.lua_error_logged = true;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_ = self.lua.getGlobal("draw");
|
|
||||||
self.lua.protectedCall(.{}) catch {
|
|
||||||
const errorStr = self.lua.toString(-1) catch unreachable;
|
|
||||||
self.lua_str = std.mem.concatWithSentinel(
|
|
||||||
self.allocator,
|
|
||||||
u8,
|
|
||||||
&.{ "cannot call draw(): ", errorStr },
|
|
||||||
0,
|
|
||||||
) catch unreachable;
|
|
||||||
self.log.err(self.io, "lua", "error (cannot call draw()): {s}", .{errorStr}) catch unreachable;
|
|
||||||
self.lua_error = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
fn calculateTimeout(self: *Lua, _: *anyopaque) !?usize {
|
|
||||||
return self.animation_delay;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn deinit(self: *Lua) void {
|
|
||||||
if (self.lua_str) |str| self.allocator.free(str);
|
|
||||||
self.lua.deinit();
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn widget(self: *Lua) *Widget {
|
|
||||||
if (self.instance) |*inst| return inst;
|
|
||||||
self.instance = Widget.init(
|
|
||||||
"Lua",
|
|
||||||
null,
|
|
||||||
self,
|
|
||||||
deinit,
|
|
||||||
null,
|
|
||||||
draw,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
calculateTimeout,
|
|
||||||
);
|
|
||||||
return &self.instance.?;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn propagateTerminalBounds(self: *Lua) void {
|
|
||||||
if (self.terminal_buffer.height == self.height and
|
|
||||||
self.terminal_buffer.width == self.width)
|
|
||||||
return;
|
|
||||||
self.width = self.terminal_buffer.width;
|
|
||||||
self.height = self.terminal_buffer.height;
|
|
||||||
_ = self.lua.getGlobal("ly");
|
|
||||||
_ = self.lua.pushString("width");
|
|
||||||
self.lua.pushInteger(@intCast(self.terminal_buffer.width));
|
|
||||||
self.lua.setTable(-3);
|
|
||||||
_ = self.lua.pushString("height");
|
|
||||||
self.lua.pushInteger(@intCast(self.terminal_buffer.height));
|
|
||||||
self.lua.setTable(-3);
|
|
||||||
self.lua.setGlobal("ly");
|
|
||||||
}
|
|
||||||
|
|
||||||
fn luaLyClock(state: ?*zlua.LuaState) callconv(.c) c_int {
|
|
||||||
var threaded = std.Io.Threaded.init_single_threaded;
|
|
||||||
const lua: *zlua.Lua = @ptrCast(@alignCast(state orelse unreachable));
|
|
||||||
lua.pushInteger(std.Io.Timestamp.now(threaded.io(), .real).toMicroseconds());
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn luaPutCell(state: ?*zlua.LuaState) callconv(.c) c_int {
|
|
||||||
const lua: *zlua.Lua = @ptrCast(@alignCast(state orelse unreachable));
|
|
||||||
const MSG = "ly.putCell: cannot convert %s-typed ";
|
|
||||||
const byte = lua.toNumeric(u32, 1) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(1));
|
|
||||||
lua.raiseErrorStr(MSG ++ "byte to u32", .{t.ptr});
|
|
||||||
};
|
|
||||||
const fg = lua.toNumeric(u32, 2) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(2));
|
|
||||||
lua.raiseErrorStr(MSG ++ "fg to u32", .{t.ptr});
|
|
||||||
};
|
|
||||||
const bg = lua.toNumeric(u32, 3) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(3));
|
|
||||||
lua.raiseErrorStr(MSG ++ "bg to u32", .{t.ptr});
|
|
||||||
};
|
|
||||||
const x = lua.toNumeric(usize, 4) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(4));
|
|
||||||
lua.raiseErrorStr(MSG ++ "x to usize", .{t.ptr});
|
|
||||||
};
|
|
||||||
const y = lua.toNumeric(usize, 5) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(5));
|
|
||||||
lua.raiseErrorStr(MSG ++ "y to usize", .{t.ptr});
|
|
||||||
};
|
|
||||||
TerminalBuffer.setCell(x, y, .{
|
|
||||||
.fg = fg,
|
|
||||||
.bg = bg,
|
|
||||||
.ch = byte,
|
|
||||||
}) catch {};
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn luaPutRect(state: ?*zlua.LuaState) callconv(.c) c_int {
|
|
||||||
const lua: *zlua.Lua = @ptrCast(@alignCast(state orelse unreachable));
|
|
||||||
const MSG = "ly.putRect: cannot convert %s-typed ";
|
|
||||||
const byte = lua.toNumeric(u32, 1) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(1));
|
|
||||||
lua.raiseErrorStr(MSG ++ "byte to u32", .{t.ptr});
|
|
||||||
};
|
|
||||||
const fg = lua.toNumeric(u32, 2) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(2));
|
|
||||||
lua.raiseErrorStr(MSG ++ "fg to u32", .{t.ptr});
|
|
||||||
};
|
|
||||||
const bg = lua.toNumeric(u32, 3) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(3));
|
|
||||||
lua.raiseErrorStr(MSG ++ "bg to u32", .{t.ptr});
|
|
||||||
};
|
|
||||||
const x = lua.toNumeric(usize, 4) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(4));
|
|
||||||
lua.raiseErrorStr(MSG ++ "x to usize", .{t.ptr});
|
|
||||||
};
|
|
||||||
const y = lua.toNumeric(usize, 5) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(5));
|
|
||||||
lua.raiseErrorStr(MSG ++ "y to usize", .{t.ptr});
|
|
||||||
};
|
|
||||||
const w = lua.toNumeric(usize, 6) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(5));
|
|
||||||
lua.raiseErrorStr(MSG ++ "w to usize", .{t.ptr});
|
|
||||||
};
|
|
||||||
const h = lua.toNumeric(usize, 7) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(5));
|
|
||||||
lua.raiseErrorStr(MSG ++ "h to usize", .{t.ptr});
|
|
||||||
};
|
|
||||||
for (0..w) |wx| for (0..h) |hy|
|
|
||||||
TerminalBuffer.setCell(x + wx, y + hy, .{
|
|
||||||
.fg = fg,
|
|
||||||
.bg = bg,
|
|
||||||
.ch = byte,
|
|
||||||
}) catch {};
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn luaPutLabel(state: ?*zlua.LuaState) callconv(.c) c_int {
|
|
||||||
const lua: *zlua.Lua = @ptrCast(@alignCast(state orelse unreachable));
|
|
||||||
const MSG = "ly.putLabel: cannot convert %s-typed ";
|
|
||||||
const str = lua.toString(1) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(2));
|
|
||||||
lua.raiseErrorStr(MSG ++ "str to string", .{t.ptr});
|
|
||||||
};
|
|
||||||
const fg = lua.toNumeric(u32, 2) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(2));
|
|
||||||
lua.raiseErrorStr(MSG ++ "fg to u32", .{t.ptr});
|
|
||||||
};
|
|
||||||
const bg = lua.toNumeric(u32, 3) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(3));
|
|
||||||
lua.raiseErrorStr(MSG ++ "bg to u32", .{t.ptr});
|
|
||||||
};
|
|
||||||
const x = lua.toNumeric(usize, 4) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(4));
|
|
||||||
lua.raiseErrorStr(MSG ++ "x to usize", .{t.ptr});
|
|
||||||
};
|
|
||||||
const y = lua.toNumeric(usize, 5) catch {
|
|
||||||
const t = lua.typeName(lua.typeOf(5));
|
|
||||||
lua.raiseErrorStr(MSG ++ "y to usize", .{t.ptr});
|
|
||||||
};
|
|
||||||
TerminalBuffer.drawText(str, x, y, fg, bg) catch {};
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -200,9 +200,9 @@ fn draw(self: *Matrix) void {
|
||||||
.bg = self.terminal_buffer.bg,
|
.bg = self.terminal_buffer.bg,
|
||||||
};
|
};
|
||||||
|
|
||||||
cell.put(x, y - 1) catch {};
|
cell.put(x, y - 1);
|
||||||
// Fill background in between columns
|
// Fill background in between columns
|
||||||
self.default_cell.put(x + 1, y - 1) catch {};
|
self.default_cell.put(x + 1, y - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
53
src/auth.zig
53
src/auth.zig
|
|
@ -105,11 +105,6 @@ pub fn authenticate(allocator: std.mem.Allocator, io: std.Io, log_file: *LogFile
|
||||||
try log_file.info(io, "auth/passwd", "setting user shell", .{});
|
try log_file.info(io, "auth/passwd", "setting user shell", .{});
|
||||||
if (user_entry.shell == null) interop.setUserShell(&user_entry);
|
if (user_entry.shell == null) interop.setUserShell(&user_entry);
|
||||||
|
|
||||||
// chown & chmod stdin (which is the TTY)
|
|
||||||
// https://github.com/mirror/busybox/blob/371fe9f71d445d18be28c82a2a6d82115c8af19d/loginutils/login.c#L558
|
|
||||||
if (interop.isError(std.posix.system.fchown(std.posix.STDIN_FILENO, user_entry.uid, user_entry.gid))) return error.TtyChownFailed;
|
|
||||||
if (interop.isError(std.posix.system.fchmod(std.posix.STDIN_FILENO, 0o600))) return error.TtyChmodFailed;
|
|
||||||
|
|
||||||
var shared_err = try SharedError.init(null, null);
|
var shared_err = try SharedError.init(null, null);
|
||||||
defer shared_err.deinit();
|
defer shared_err.deinit();
|
||||||
|
|
||||||
|
|
@ -184,19 +179,17 @@ fn startSession(
|
||||||
// Reset the XDG environment variables
|
// Reset the XDG environment variables
|
||||||
try log_file.info(io, "auth/env", "resetting xdg environment variables", .{});
|
try log_file.info(io, "auth/env", "resetting xdg environment variables", .{});
|
||||||
try setXdgEnv(allocator, tty_str, current_environment);
|
try setXdgEnv(allocator, tty_str, current_environment);
|
||||||
try setXdgRuntimeDir(allocator, io);
|
try setXdgRuntimeDir(allocator);
|
||||||
|
|
||||||
// Set the PAM variables
|
// Set the PAM variables
|
||||||
const pam_env_vars: ?[*:null]?[*:0]u8 = interop.pam.pam_getenvlist(handle);
|
const pam_env_vars: ?[*:null]?[*:0]u8 = interop.pam.pam_getenvlist(handle);
|
||||||
if (pam_env_vars == null) return error.GetEnvListFailed;
|
if (pam_env_vars == null) return error.GetEnvListFailed;
|
||||||
|
|
||||||
const env_list = std.mem.span(pam_env_vars.?);
|
const env_list = std.mem.span(pam_env_vars.?);
|
||||||
for (env_list) |maybe_env_var| {
|
for (env_list) |env_var| {
|
||||||
if (maybe_env_var) |env_var| {
|
if (env_var == null) continue;
|
||||||
const env_var_slice = std.mem.span(env_var);
|
try log_file.info(io, "auth/env", "setting pam environment variable: {s}", .{std.mem.span(env_var.?)});
|
||||||
try log_file.info(io, "auth/env", "setting pam environment variable: {s}", .{env_var_slice});
|
try interop.putEnvironmentVariable(env_var);
|
||||||
try interop.putEnvironmentVariable(env_var_slice);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const home_z = try allocator.dupeZ(u8, user_entry.home.?);
|
const home_z = try allocator.dupeZ(u8, user_entry.home.?);
|
||||||
|
|
@ -254,20 +247,18 @@ fn setXdgEnv(allocator: std.mem.Allocator, tty_str: []u8, environment: Environme
|
||||||
try interop.setEnvironmentVariable(allocator, "XDG_VTNR", tty_str, false);
|
try interop.setEnvironmentVariable(allocator, "XDG_VTNR", tty_str, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setXdgRuntimeDir(allocator: std.mem.Allocator, io: std.Io) !void {
|
fn setXdgRuntimeDir(allocator: std.mem.Allocator) !void {
|
||||||
// The "/run/user/%d" directory is not available on some operating systems,
|
// The "/run/user/%d" directory is not available on FreeBSD. It is much
|
||||||
// like FreeBSD and Alpine
|
// better to stick to the defaults and let applications using
|
||||||
const uid = std.posix.system.getuid();
|
// XDG_RUNTIME_DIR to fall back to directories inside user's home
|
||||||
var uid_buffer: [32]u8 = undefined; // No UID can be larger than this
|
// directory.
|
||||||
const uid_str = try std.fmt.bufPrint(&uid_buffer, "/run/user/{d}", .{uid});
|
if (builtin.os.tag != .freebsd) {
|
||||||
|
const uid = std.posix.system.getuid();
|
||||||
|
var uid_buffer: [32]u8 = undefined; // No UID can be larger than this
|
||||||
|
const uid_str = try std.fmt.bufPrint(&uid_buffer, "/run/user/{d}", .{uid});
|
||||||
|
|
||||||
var xdg_dir = std.Io.Dir.openDirAbsolute(io, uid_str, .{}) catch |err| {
|
try interop.setEnvironmentVariable(allocator, "XDG_RUNTIME_DIR", uid_str, false);
|
||||||
if (err == error.FileNotFound) return;
|
}
|
||||||
return err;
|
|
||||||
};
|
|
||||||
xdg_dir.close(io);
|
|
||||||
|
|
||||||
try interop.setEnvironmentVariable(allocator, "XDG_RUNTIME_DIR", uid_str, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn loginConv(
|
fn loginConv(
|
||||||
|
|
@ -399,7 +390,7 @@ fn createXauthFile(log_file: *LogFile, io: std.Io, pwd: []const u8, buffer: []u8
|
||||||
|
|
||||||
const xauthority: []u8 = try std.fmt.bufPrint(buffer, "{s}/{s}", .{ trimmed_xauth_dir, xauth_file });
|
const xauthority: []u8 = try std.fmt.bufPrint(buffer, "{s}/{s}", .{ trimmed_xauth_dir, xauth_file });
|
||||||
|
|
||||||
try std.Io.Dir.cwd().createDirPath(io, trimmed_xauth_dir);
|
std.Io.Dir.cwd().createDirPath(io, trimmed_xauth_dir) catch {};
|
||||||
|
|
||||||
try log_file.info(io, "auth/x11", "creating xauth file: {s}", .{xauthority});
|
try log_file.info(io, "auth/x11", "creating xauth file: {s}", .{xauthority});
|
||||||
|
|
||||||
|
|
@ -574,15 +565,7 @@ fn executeCmd(global_log_file: *LogFile, allocator: std.mem.Allocator, io: std.I
|
||||||
fn redirectStandardStreams(global_log_file: *LogFile, io: std.Io, session_log: []const u8, create: bool) !std.Io.File {
|
fn redirectStandardStreams(global_log_file: *LogFile, io: std.Io, session_log: []const u8, create: bool) !std.Io.File {
|
||||||
create_session_log_dir: {
|
create_session_log_dir: {
|
||||||
const session_log_dir = std.Io.Dir.path.dirname(session_log) orelse break :create_session_log_dir;
|
const session_log_dir = std.Io.Dir.path.dirname(session_log) orelse break :create_session_log_dir;
|
||||||
|
std.Io.Dir.cwd().createDirPath(io, session_log_dir) catch |err| {
|
||||||
var buffer = std.mem.zeroes([std.Io.Dir.max_path_bytes]u8);
|
|
||||||
const len = std.Io.Dir.cwd().realPathFile(io, session_log_dir, &buffer) catch |err| {
|
|
||||||
try global_log_file.err(io, "auth/sys", "failed to resolve path for session log file directory: {s}", .{@errorName(err)});
|
|
||||||
return err;
|
|
||||||
};
|
|
||||||
const resolved_path = buffer[0..len];
|
|
||||||
|
|
||||||
std.Io.Dir.cwd().createDirPath(io, resolved_path) catch |err| {
|
|
||||||
try global_log_file.err(io, "auth/sys", "failed to create session log file directory: {s}", .{@errorName(err)});
|
try global_log_file.err(io, "auth/sys", "failed to create session log file directory: {s}", .{@errorName(err)});
|
||||||
return err;
|
return err;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ pub fn clearRendered(self: InfoLine, allocator: Allocator) !void {
|
||||||
|
|
||||||
@memset(spaces, ' ');
|
@memset(spaces, ' ');
|
||||||
|
|
||||||
try TerminalBuffer.drawText(
|
TerminalBuffer.drawText(
|
||||||
spaces,
|
spaces,
|
||||||
self.label.component_pos.x + 2,
|
self.label.component_pos.x + 2,
|
||||||
self.label.component_pos.y,
|
self.label.component_pos.y,
|
||||||
|
|
@ -98,7 +98,7 @@ fn draw(self: *InfoLine) void {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle(self: *InfoLine, maybe_key: ?keyboard.Key) !void {
|
fn handle(self: *InfoLine, maybe_key: ?keyboard.Key) !void {
|
||||||
try self.label.handle(maybe_key);
|
self.label.handle(maybe_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn drawItem(label: *MessageLabel, message: Message, x: usize, y: usize, width: usize) void {
|
fn drawItem(label: *MessageLabel, message: Message, x: usize, y: usize, width: usize) void {
|
||||||
|
|
@ -114,5 +114,5 @@ fn drawItem(label: *MessageLabel, message: Message, x: usize, y: usize, width: u
|
||||||
width,
|
width,
|
||||||
message.fg,
|
message.fg,
|
||||||
message.bg,
|
message.bg,
|
||||||
) catch {};
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,19 +14,19 @@ const Env = struct {
|
||||||
environment: Environment,
|
environment: Environment,
|
||||||
index: usize,
|
index: usize,
|
||||||
};
|
};
|
||||||
const EnvironmentLabel = CyclableLabel(Env, *?UserList);
|
const EnvironmentLabel = CyclableLabel(Env, *UserList);
|
||||||
|
|
||||||
const Session = @This();
|
const Session = @This();
|
||||||
|
|
||||||
instance: ?Widget = null,
|
instance: ?Widget = null,
|
||||||
label: *EnvironmentLabel,
|
label: *EnvironmentLabel,
|
||||||
user_list: *?UserList,
|
user_list: *UserList,
|
||||||
|
|
||||||
pub fn init(
|
pub fn init(
|
||||||
allocator: Allocator,
|
allocator: Allocator,
|
||||||
io: std.Io,
|
io: std.Io,
|
||||||
buffer: *TerminalBuffer,
|
buffer: *TerminalBuffer,
|
||||||
user_list: *?UserList,
|
user_list: *UserList,
|
||||||
width: usize,
|
width: usize,
|
||||||
text_in_center: bool,
|
text_in_center: bool,
|
||||||
fg: u32,
|
fg: u32,
|
||||||
|
|
@ -79,7 +79,7 @@ pub fn addEnvironment(self: *Session, environment: Environment) !void {
|
||||||
const env = Env{ .environment = environment, .index = self.label.list.items.len };
|
const env = Env{ .environment = environment, .index = self.label.list.items.len };
|
||||||
|
|
||||||
try self.label.addItem(env);
|
try self.label.addItem(env);
|
||||||
if (self.user_list.*) |w| addedSession(env, w);
|
addedSession(env, self.user_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw(self: *Session) void {
|
fn draw(self: *Session) void {
|
||||||
|
|
@ -87,19 +87,19 @@ fn draw(self: *Session) void {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle(self: *Session, maybe_key: ?keyboard.Key) !void {
|
fn handle(self: *Session, maybe_key: ?keyboard.Key) !void {
|
||||||
try self.label.handle(maybe_key);
|
self.label.handle(maybe_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn addedSession(env: Env, user_list: UserList) void {
|
fn addedSession(env: Env, user_list: *UserList) void {
|
||||||
const user = user_list.label.list.items[user_list.label.current];
|
const user = user_list.label.list.items[user_list.label.current];
|
||||||
if (!user.first_run) return;
|
if (!user.first_run) return;
|
||||||
|
|
||||||
user.session_index.* = env.index;
|
user.session_index.* = env.index;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sessionChanged(env: Env, maybe_user_list: ?*?UserList) void {
|
fn sessionChanged(env: Env, maybe_user_list: ?*UserList) void {
|
||||||
if (maybe_user_list) |user_list| {
|
if (maybe_user_list) |user_list| {
|
||||||
if (user_list.*) |w| w.label.list.items[w.label.current].session_index.* = env.index;
|
user_list.label.list.items[user_list.label.current].session_index.* = env.index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -119,5 +119,5 @@ fn drawItem(label: *EnvironmentLabel, env: Env, x: usize, y: usize, width: usize
|
||||||
width,
|
width,
|
||||||
label.fg,
|
label.fg,
|
||||||
label.bg,
|
label.bg,
|
||||||
) catch {};
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const CyclableLabel = ly_ui.CyclableLabel;
|
||||||
const Session = @import("Session.zig");
|
const Session = @import("Session.zig");
|
||||||
const SavedUsers = @import("../config/SavedUsers.zig");
|
const SavedUsers = @import("../config/SavedUsers.zig");
|
||||||
|
|
||||||
const StringList = std.ArrayList([]const u8);
|
const StringList = std.ArrayListUnmanaged([]const u8);
|
||||||
pub const User = struct {
|
pub const User = struct {
|
||||||
name: []const u8,
|
name: []const u8,
|
||||||
session_index: *usize,
|
session_index: *usize,
|
||||||
|
|
@ -118,7 +118,7 @@ fn draw(self: *UserList) void {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle(self: *UserList, maybe_key: ?keyboard.Key) !void {
|
fn handle(self: *UserList, maybe_key: ?keyboard.Key) !void {
|
||||||
try self.label.handle(maybe_key);
|
self.label.handle(maybe_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn usernameChanged(user: User, maybe_session: ?*Session) void {
|
fn usernameChanged(user: User, maybe_session: ?*Session) void {
|
||||||
|
|
@ -143,5 +143,5 @@ fn drawItem(label: *UserLabel, user: User, x: usize, y: usize, width: usize) voi
|
||||||
width,
|
width,
|
||||||
label.fg,
|
label.fg,
|
||||||
label.bg,
|
label.bg,
|
||||||
) catch {};
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,18 +13,16 @@ animation_frame_delay: u16 = 5,
|
||||||
animation_timeout_sec: u12 = 0,
|
animation_timeout_sec: u12 = 0,
|
||||||
asterisk: ?u32 = '*',
|
asterisk: ?u32 = '*',
|
||||||
auth_fails: u64 = 10,
|
auth_fails: u64 = 10,
|
||||||
|
battery_id: ?[]const u8 = null,
|
||||||
auto_login_service: [:0]const u8 = "ly-autologin",
|
auto_login_service: [:0]const u8 = "ly-autologin",
|
||||||
auto_login_session: ?[]const u8 = null,
|
auto_login_session: ?[]const u8 = null,
|
||||||
auto_login_user: ?[]const u8 = null,
|
auto_login_user: ?[]const u8 = null,
|
||||||
battery_id: ?[]const u8 = null,
|
|
||||||
bg: u32 = 0x00000000,
|
bg: u32 = 0x00000000,
|
||||||
bigclock: Bigclock = .none,
|
bigclock: Bigclock = .none,
|
||||||
bigclock_12hr: bool = false,
|
bigclock_12hr: bool = false,
|
||||||
bigclock_seconds: bool = false,
|
bigclock_seconds: bool = false,
|
||||||
blank_box: bool = true,
|
blank_box: bool = true,
|
||||||
border_fg: u32 = 0x00FFFFFF,
|
border_fg: u32 = 0x00FFFFFF,
|
||||||
box_position_h: f32 = 0.5,
|
|
||||||
box_position_v: f32 = 0.5,
|
|
||||||
box_title: ?[]const u8 = null,
|
box_title: ?[]const u8 = null,
|
||||||
brightness_down_cmd: [:0]const u8 = build_options.prefix_directory ++ "/bin/brightnessctl -q -n s 10%-",
|
brightness_down_cmd: [:0]const u8 = build_options.prefix_directory ++ "/bin/brightnessctl -q -n s 10%-",
|
||||||
brightness_down_key: ?[]const u8 = "F5",
|
brightness_down_key: ?[]const u8 = "F5",
|
||||||
|
|
@ -39,10 +37,6 @@ cmatrix_max_codepoint: u16 = 0x7B,
|
||||||
colormix_col1: u32 = 0x00FF0000,
|
colormix_col1: u32 = 0x00FF0000,
|
||||||
colormix_col2: u32 = 0x000000FF,
|
colormix_col2: u32 = 0x000000FF,
|
||||||
colormix_col3: u32 = 0x20000000,
|
colormix_col3: u32 = 0x20000000,
|
||||||
corner_bottom_left: []const u8 = "version",
|
|
||||||
corner_bottom_right: []const u8 = "labels",
|
|
||||||
corner_top_left: []const u8 = "shutdown,restart,britup,britdown,password battery",
|
|
||||||
corner_top_right: []const u8 = "clock numlock,capslock",
|
|
||||||
custom_bind_width: ?u32 = null,
|
custom_bind_width: ?u32 = null,
|
||||||
custom_sessions: []const u8 = build_options.config_directory ++ "/ly/custom-sessions",
|
custom_sessions: []const u8 = build_options.config_directory ++ "/ly/custom-sessions",
|
||||||
default_input: Input = .login,
|
default_input: Input = .login,
|
||||||
|
|
@ -64,7 +58,12 @@ gameoflife_fg: u32 = 0x0000FF00,
|
||||||
gameoflife_entropy_interval: usize = 10,
|
gameoflife_entropy_interval: usize = 10,
|
||||||
gameoflife_frame_delay: usize = 6,
|
gameoflife_frame_delay: usize = 6,
|
||||||
gameoflife_initial_density: f32 = 0.4,
|
gameoflife_initial_density: f32 = 0.4,
|
||||||
|
hibernate_cmd: ?[]const u8 = null,
|
||||||
|
hibernate_key: []const u8 = "F4",
|
||||||
hide_borders: bool = false,
|
hide_borders: bool = false,
|
||||||
|
hide_key_hints: bool = false,
|
||||||
|
hide_keyboard_locks: bool = false,
|
||||||
|
hide_version_string: bool = false,
|
||||||
inactivity_cmd: ?[]const u8 = null,
|
inactivity_cmd: ?[]const u8 = null,
|
||||||
inactivity_delay: u16 = 0,
|
inactivity_delay: u16 = 0,
|
||||||
initial_info_text: ?[]const u8 = null,
|
initial_info_text: ?[]const u8 = null,
|
||||||
|
|
@ -73,23 +72,26 @@ lang: []const u8 = "en",
|
||||||
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,
|
||||||
lua_animation_file: []const u8 = build_options.config_directory ++ "/ly/example.lua",
|
ly_log: []const u8 = "/var/log/ly.log",
|
||||||
ly_log: ?[]const u8 = "/var/log/ly.log",
|
|
||||||
margin_box_h: u8 = 2,
|
margin_box_h: u8 = 2,
|
||||||
margin_box_v: u8 = 1,
|
margin_box_v: u8 = 1,
|
||||||
numlock: bool = false,
|
numlock: bool = false,
|
||||||
path: ?[]const u8 = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
path: ?[]const u8 = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||||
restart_key: ?[]const u8 = "F2",
|
restart_cmd: []const u8 = "/sbin/shutdown -r now",
|
||||||
save_file_dir: ?[]const u8 = build_options.config_directory ++ "/ly",
|
restart_key: []const u8 = "F2",
|
||||||
|
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,
|
shell: bool = true,
|
||||||
show_password_key: ?[]const u8 = "F7",
|
show_password_key: []const u8 = "F7",
|
||||||
shutdown_key: ?[]const u8 = "F1",
|
show_tty: bool = false,
|
||||||
|
shutdown_cmd: []const u8 = "/sbin/shutdown -a now",
|
||||||
|
shutdown_key: []const u8 = "F1",
|
||||||
|
sleep_cmd: ?[]const u8 = null,
|
||||||
|
sleep_key: []const u8 = "F3",
|
||||||
start_cmd: ?[]const u8 = null,
|
start_cmd: ?[]const u8 = null,
|
||||||
text_in_center: bool = false,
|
text_in_center: bool = false,
|
||||||
type_username: bool = false,
|
|
||||||
vi_default_mode: ViMode = .normal,
|
vi_default_mode: ViMode = .normal,
|
||||||
vi_mode: bool = false,
|
vi_mode: bool = false,
|
||||||
waylandsessions: ?[]const u8 = build_options.prefix_directory ++ "/share/wayland-sessions",
|
waylandsessions: ?[]const u8 = build_options.prefix_directory ++ "/share/wayland-sessions",
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
// Properties removed or changed since 0.6.0
|
// Properties removed or changed since 0.6.0
|
||||||
// Color codes interpreted differently since 1.1.0
|
// Color codes interpreted differently since 1.1.0
|
||||||
|
|
||||||
const build_options = @import("build_options");
|
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
var temporary_allocator = std.heap.page_allocator;
|
var temporary_allocator = std.heap.page_allocator;
|
||||||
|
|
||||||
|
|
@ -15,7 +14,6 @@ const IniParser = ly_core.IniParser;
|
||||||
const ini = ly_core.ini;
|
const ini = ly_core.ini;
|
||||||
|
|
||||||
const Config = @import("Config.zig");
|
const Config = @import("Config.zig");
|
||||||
const Lang = @import("Lang.zig");
|
|
||||||
const OldSave = @import("OldSave.zig");
|
const OldSave = @import("OldSave.zig");
|
||||||
const SavedUsers = @import("SavedUsers.zig");
|
const SavedUsers = @import("SavedUsers.zig");
|
||||||
const custom = @import("custom.zig");
|
const custom = @import("custom.zig");
|
||||||
|
|
@ -47,23 +45,12 @@ const removed_properties = [_][]const u8{
|
||||||
"wayland_cmd",
|
"wayland_cmd",
|
||||||
"console_dev",
|
"console_dev",
|
||||||
"load",
|
"load",
|
||||||
"shutdown_cmd",
|
|
||||||
"restart_cmd",
|
|
||||||
// Migrating these isn't worth the effort so just say we removed them
|
|
||||||
"hide_key_hints",
|
|
||||||
"hide_keyboard_locks",
|
|
||||||
"hide_version_string",
|
|
||||||
"show_tty",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub var auto_eight_colors: bool = true;
|
pub var auto_eight_colors: bool = true;
|
||||||
|
|
||||||
pub var maybe_animate: ?bool = null;
|
pub var maybe_animate: ?bool = null;
|
||||||
pub var maybe_save_file: ?[]const u8 = null;
|
pub var maybe_save_file: ?[]const u8 = null;
|
||||||
pub var maybe_sleep_key: ?[]const u8 = null;
|
|
||||||
pub var maybe_sleep_cmd: ?[]const u8 = null;
|
|
||||||
pub var maybe_hibernate_key: ?[]const u8 = null;
|
|
||||||
pub var maybe_hibernate_cmd: ?[]const u8 = null;
|
|
||||||
|
|
||||||
pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniField {
|
pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniField {
|
||||||
if (std.mem.eql(u8, field.key, "animate")) {
|
if (std.mem.eql(u8, field.key, "animate")) {
|
||||||
|
|
@ -137,6 +124,7 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie
|
||||||
if (std.mem.eql(u8, field.key, "save_file")) {
|
if (std.mem.eql(u8, field.key, "save_file")) {
|
||||||
// The option doesn't exist anymore, but we save its value for migration later on
|
// The option doesn't exist anymore, but we save its value for migration later on
|
||||||
maybe_save_file = temporary_allocator.dupe(u8, field.value) catch return null;
|
maybe_save_file = temporary_allocator.dupe(u8, field.value) catch return null;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -175,39 +163,6 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie
|
||||||
return mapped_field;
|
return mapped_field;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (std.mem.eql(u8, field.key, "sleep_key")) {
|
|
||||||
maybe_sleep_key = temporary_allocator.dupe(u8, field.value) catch return null;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (std.mem.eql(u8, field.key, "sleep_cmd")) {
|
|
||||||
maybe_sleep_cmd = temporary_allocator.dupe(u8, field.value) catch return null;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (std.mem.eql(u8, field.key, "hibernate_key")) {
|
|
||||||
maybe_hibernate_key = temporary_allocator.dupe(u8, field.value) catch return null;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (std.mem.eql(u8, field.key, "hibernate_cmd")) {
|
|
||||||
maybe_hibernate_cmd = temporary_allocator.dupe(u8, field.value) catch return null;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (std.mem.eql(u8, field.key, "save")) {
|
|
||||||
// The option now uses a string for the file's parent directory
|
|
||||||
var mapped_field = field;
|
|
||||||
|
|
||||||
if (std.mem.eql(u8, field.value, "true")) {
|
|
||||||
mapped_field.value = build_options.config_directory ++ "/ly";
|
|
||||||
} else if (std.mem.eql(u8, field.value, "false")) {
|
|
||||||
mapped_field.value = "null";
|
|
||||||
}
|
|
||||||
|
|
||||||
return mapped_field;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Dearest Melpert,
|
// TODO: Dearest Melpert,
|
||||||
// I pray this message finds you well, as daylight dwindles and the witching hour
|
// I pray this message finds you well, as daylight dwindles and the witching hour
|
||||||
// approaches, I find it more and more imperative as time continues that I place
|
// approaches, I find it more and more imperative as time continues that I place
|
||||||
|
|
@ -268,7 +223,7 @@ pub fn configFieldHandler(_: std.mem.Allocator, field: ini.IniField) ?ini.IniFie
|
||||||
|
|
||||||
// This is the stuff we only handle after reading the config.
|
// This is the stuff we only handle after reading the config.
|
||||||
// For example, the "animate" field could come after "animation"
|
// For example, the "animate" field could come after "animation"
|
||||||
pub fn lateConfigFieldHandler(config: *Config, lang: Lang) void {
|
pub fn lateConfigFieldHandler(config: *Config) void {
|
||||||
if (maybe_animate) |animate| {
|
if (maybe_animate) |animate| {
|
||||||
if (!animate) config.*.animation = .none;
|
if (!animate) config.*.animation = .none;
|
||||||
}
|
}
|
||||||
|
|
@ -297,24 +252,6 @@ pub fn lateConfigFieldHandler(config: *Config, lang: Lang) void {
|
||||||
if (!set_color_properties[7]) config.error_fg = Styling.BOLD | Color.ECOL_RED;
|
if (!set_color_properties[7]) config.error_fg = Styling.BOLD | Color.ECOL_RED;
|
||||||
if (!set_color_properties[8]) config.fg = Color.ECOL_WHITE;
|
if (!set_color_properties[8]) config.fg = Color.ECOL_WHITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybe_sleep_key) |key| {
|
|
||||||
if (maybe_sleep_cmd) |cmd| {
|
|
||||||
custom.binds.put(temporary_allocator, key, .{
|
|
||||||
.name = temporary_allocator.dupe(u8, lang.sleep) catch "",
|
|
||||||
.cmd = cmd,
|
|
||||||
}) catch {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (maybe_hibernate_key) |key| {
|
|
||||||
if (maybe_hibernate_cmd) |cmd| {
|
|
||||||
custom.binds.put(temporary_allocator, key, .{
|
|
||||||
.name = temporary_allocator.dupe(u8, lang.hibernate) catch "",
|
|
||||||
.cmd = cmd,
|
|
||||||
}) catch {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn tryMigrateIniSaveFile(allocator: std.mem.Allocator, io: std.Io, path: []const u8, saved_users: *SavedUsers, usernames: [][]const u8) !?IniParser(OldSave) {
|
pub fn tryMigrateIniSaveFile(allocator: std.mem.Allocator, io: std.Io, path: []const u8, saved_users: *SavedUsers, usernames: [][]const u8) !?IniParser(OldSave) {
|
||||||
|
|
@ -347,6 +284,8 @@ pub fn tryMigrateIniSaveFile(allocator: std.mem.Allocator, io: std.Io, path: []c
|
||||||
|
|
||||||
fn tryMigrateFirstSaveFile(io: std.Io, user_buf: *[32]u8) ?OldSave {
|
fn tryMigrateFirstSaveFile(io: std.Io, user_buf: *[32]u8) ?OldSave {
|
||||||
if (maybe_save_file) |path| {
|
if (maybe_save_file) |path| {
|
||||||
|
defer temporary_allocator.free(path);
|
||||||
|
|
||||||
var save = OldSave{};
|
var save = OldSave{};
|
||||||
var file = std.Io.Dir.openFileAbsolute(io, path, .{}) catch return null;
|
var file = std.Io.Dir.openFileAbsolute(io, path, .{}) catch return null;
|
||||||
defer file.close(io);
|
defer file.close(io);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ pub const Animation = enum {
|
||||||
colormix,
|
colormix,
|
||||||
gameoflife,
|
gameoflife,
|
||||||
dur_file,
|
dur_file,
|
||||||
lua,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const DisplayServer = enum {
|
pub const DisplayServer = enum {
|
||||||
|
|
|
||||||
1042
src/main.zig
1042
src/main.zig
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue