mirror of
https://github.com/fairyglade/ly.git
synced 2026-03-21 22:43:38 +00:00
@@ -1,9 +1,9 @@
|
||||
const enums = @import("enums.zig");
|
||||
const ini = @import("zigini");
|
||||
|
||||
const DisplayServer = enums.DisplayServer;
|
||||
const Ini = ini.Ini;
|
||||
|
||||
const enums = @import("enums.zig");
|
||||
const DisplayServer = enums.DisplayServer;
|
||||
|
||||
pub const DesktopEntry = struct {
|
||||
Exec: []const u8 = "",
|
||||
Name: []const u8 = "",
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
const std = @import("std");
|
||||
const math = std.math;
|
||||
|
||||
const Animation = @import("../tui/Animation.zig");
|
||||
const Cell = @import("../tui/Cell.zig");
|
||||
const TerminalBuffer = @import("../tui/TerminalBuffer.zig");
|
||||
|
||||
const ColorMix = @This();
|
||||
|
||||
const math = std.math;
|
||||
const Vec2 = @Vector(2, f32);
|
||||
|
||||
const time_scale: f32 = 0.01;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
const Animation = @import("../tui/Animation.zig");
|
||||
const Cell = @import("../tui/Cell.zig");
|
||||
const TerminalBuffer = @import("../tui/TerminalBuffer.zig");
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
const std = @import("std");
|
||||
const ly_core = @import("ly-core");
|
||||
const Animation = @import("../tui/Animation.zig");
|
||||
const Cell = @import("../tui/Cell.zig");
|
||||
const TerminalBuffer = @import("../tui/TerminalBuffer.zig");
|
||||
const enums = @import("../enums.zig");
|
||||
|
||||
const DurOffsetAlignment = enums.DurOffsetAlignment;
|
||||
|
||||
const Color = TerminalBuffer.Color;
|
||||
const Styling = TerminalBuffer.Styling;
|
||||
|
||||
const Allocator = std.mem.Allocator;
|
||||
const Json = std.json;
|
||||
const eql = std.mem.eql;
|
||||
const flate = std.compress.flate;
|
||||
|
||||
const ly_core = @import("ly-core");
|
||||
const LogFile = ly_core.LogFile;
|
||||
|
||||
const enums = @import("../enums.zig");
|
||||
const DurOffsetAlignment = enums.DurOffsetAlignment;
|
||||
const Animation = @import("../tui/Animation.zig");
|
||||
const Cell = @import("../tui/Cell.zig");
|
||||
const TerminalBuffer = @import("../tui/TerminalBuffer.zig");
|
||||
const Color = TerminalBuffer.Color;
|
||||
const Styling = TerminalBuffer.Styling;
|
||||
|
||||
fn read_decompress_file(allocator: Allocator, file_path: []const u8) ![]u8 {
|
||||
const file_buffer = std.fs.cwd().openFile(file_path, .{}) catch {
|
||||
return error.FileNotFound;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
const Animation = @import("../tui/Animation.zig");
|
||||
const Cell = @import("../tui/Cell.zig");
|
||||
const TerminalBuffer = @import("../tui/TerminalBuffer.zig");
|
||||
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
const GameOfLife = @This();
|
||||
|
||||
// Visual styles - using block characters like other animations
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
const Random = std.Random;
|
||||
|
||||
const Animation = @import("../tui/Animation.zig");
|
||||
const Cell = @import("../tui/Cell.zig");
|
||||
const TerminalBuffer = @import("../tui/TerminalBuffer.zig");
|
||||
|
||||
const Allocator = std.mem.Allocator;
|
||||
const Random = std.Random;
|
||||
|
||||
pub const FRAME_DELAY: usize = 8;
|
||||
|
||||
// Characters change mid-scroll
|
||||
|
||||
11
src/auth.zig
11
src/auth.zig
@@ -1,16 +1,17 @@
|
||||
const std = @import("std");
|
||||
const build_options = @import("build_options");
|
||||
const builtin = @import("builtin");
|
||||
const ly_core = @import("ly-core");
|
||||
const Environment = @import("Environment.zig");
|
||||
|
||||
const Md5 = std.crypto.hash.Md5;
|
||||
const builtin = @import("builtin");
|
||||
const build_options = @import("build_options");
|
||||
|
||||
const ly_core = @import("ly-core");
|
||||
const interop = ly_core.interop;
|
||||
const SharedError = ly_core.SharedError;
|
||||
const LogFile = ly_core.LogFile;
|
||||
const utmp = interop.utmp;
|
||||
const Utmp = utmp.utmpx;
|
||||
|
||||
const Environment = @import("Environment.zig");
|
||||
|
||||
pub const AuthOptions = struct {
|
||||
tty: u8,
|
||||
service_name: [:0]const u8,
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
const std = @import("std");
|
||||
|
||||
const ly_core = @import("ly-core");
|
||||
const enums = @import("enums.zig");
|
||||
const Lang = @import("bigclock/Lang.zig");
|
||||
const interop = ly_core.interop;
|
||||
|
||||
const en = @import("bigclock/en.zig");
|
||||
const fa = @import("bigclock/fa.zig");
|
||||
const Cell = @import("tui/Cell.zig");
|
||||
|
||||
const interop = ly_core.interop;
|
||||
const Bigclock = enums.Bigclock;
|
||||
const Lang = @import("bigclock/Lang.zig");
|
||||
pub const WIDTH = Lang.WIDTH;
|
||||
pub const HEIGHT = Lang.HEIGHT;
|
||||
pub const SIZE = Lang.SIZE;
|
||||
const enums = @import("enums.zig");
|
||||
const Bigclock = enums.Bigclock;
|
||||
const Cell = @import("tui/Cell.zig");
|
||||
|
||||
pub fn clockCell(animate: bool, char: u8, fg: u32, bg: u32, bigclock: Bigclock) ![SIZE]Cell {
|
||||
var cells: [SIZE]Cell = undefined;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const Lang = @import("Lang.zig");
|
||||
|
||||
const LocaleChars = Lang.LocaleChars;
|
||||
const X = Lang.X;
|
||||
const O = Lang.O;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const Lang = @import("Lang.zig");
|
||||
|
||||
const LocaleChars = Lang.LocaleChars;
|
||||
const X = Lang.X;
|
||||
const O = Lang.O;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const build_options = @import("build_options");
|
||||
const enums = @import("../enums.zig");
|
||||
|
||||
const enums = @import("../enums.zig");
|
||||
const Animation = enums.Animation;
|
||||
const Input = enums.Input;
|
||||
const ViMode = enums.ViMode;
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
// Color codes interpreted differently since 1.1.0
|
||||
|
||||
const std = @import("std");
|
||||
var temporary_allocator = std.heap.page_allocator;
|
||||
|
||||
const ini = @import("zigini");
|
||||
const ly_core = @import("ly-core");
|
||||
const IniParser = ly_core.IniParser;
|
||||
|
||||
const TerminalBuffer = @import("../tui/TerminalBuffer.zig");
|
||||
const Color = TerminalBuffer.Color;
|
||||
const Styling = TerminalBuffer.Styling;
|
||||
const Config = @import("Config.zig");
|
||||
const OldSave = @import("OldSave.zig");
|
||||
const SavedUsers = @import("SavedUsers.zig");
|
||||
const TerminalBuffer = @import("../tui/TerminalBuffer.zig");
|
||||
|
||||
const IniParser = ly_core.IniParser;
|
||||
|
||||
const Color = TerminalBuffer.Color;
|
||||
const Styling = TerminalBuffer.Styling;
|
||||
|
||||
const color_properties = [_][]const u8{
|
||||
"bg",
|
||||
@@ -44,8 +45,6 @@ const removed_properties = [_][]const u8{
|
||||
"load",
|
||||
};
|
||||
|
||||
var temporary_allocator = std.heap.page_allocator;
|
||||
|
||||
pub var auto_eight_colors: bool = true;
|
||||
|
||||
pub var maybe_animate: ?bool = null;
|
||||
|
||||
58
src/main.zig
58
src/main.zig
@@ -1,41 +1,43 @@
|
||||
const std = @import("std");
|
||||
const build_options = @import("build_options");
|
||||
const temporary_allocator = std.heap.page_allocator;
|
||||
const builtin = @import("builtin");
|
||||
const ly_core = @import("ly-core");
|
||||
const build_options = @import("build_options");
|
||||
|
||||
const clap = @import("clap");
|
||||
const ini = @import("zigini");
|
||||
const auth = @import("auth.zig");
|
||||
const bigclock = @import("bigclock.zig");
|
||||
const enums = @import("enums.zig");
|
||||
const Environment = @import("Environment.zig");
|
||||
const ColorMix = @import("animations/ColorMix.zig");
|
||||
const Doom = @import("animations/Doom.zig");
|
||||
const Matrix = @import("animations/Matrix.zig");
|
||||
const GameOfLife = @import("animations/GameOfLife.zig");
|
||||
const DurFile = @import("animations/DurFile.zig");
|
||||
const Animation = @import("tui/Animation.zig");
|
||||
const TerminalBuffer = @import("tui/TerminalBuffer.zig");
|
||||
const Session = @import("tui/components/Session.zig");
|
||||
const Text = @import("tui/components/Text.zig");
|
||||
const InfoLine = @import("tui/components/InfoLine.zig");
|
||||
const UserList = @import("tui/components/UserList.zig");
|
||||
const Config = @import("config/Config.zig");
|
||||
const Lang = @import("config/Lang.zig");
|
||||
const OldSave = @import("config/OldSave.zig");
|
||||
const SavedUsers = @import("config/SavedUsers.zig");
|
||||
const migrator = @import("config/migrator.zig");
|
||||
|
||||
const StringList = std.ArrayListUnmanaged([]const u8);
|
||||
const Ini = ini.Ini;
|
||||
const DisplayServer = enums.DisplayServer;
|
||||
const Entry = Environment.Entry;
|
||||
const ly_core = @import("ly-core");
|
||||
const interop = ly_core.interop;
|
||||
const UidRange = ly_core.UidRange;
|
||||
const LogFile = ly_core.LogFile;
|
||||
const SharedError = ly_core.SharedError;
|
||||
const IniParser = ly_core.IniParser;
|
||||
|
||||
const ColorMix = @import("animations/ColorMix.zig");
|
||||
const Doom = @import("animations/Doom.zig");
|
||||
const DurFile = @import("animations/DurFile.zig");
|
||||
const GameOfLife = @import("animations/GameOfLife.zig");
|
||||
const Matrix = @import("animations/Matrix.zig");
|
||||
const auth = @import("auth.zig");
|
||||
const bigclock = @import("bigclock.zig");
|
||||
const Config = @import("config/Config.zig");
|
||||
const Lang = @import("config/Lang.zig");
|
||||
const migrator = @import("config/migrator.zig");
|
||||
const OldSave = @import("config/OldSave.zig");
|
||||
const SavedUsers = @import("config/SavedUsers.zig");
|
||||
const enums = @import("enums.zig");
|
||||
const DisplayServer = enums.DisplayServer;
|
||||
const Environment = @import("Environment.zig");
|
||||
const Entry = Environment.Entry;
|
||||
const Animation = @import("tui/Animation.zig");
|
||||
const InfoLine = @import("tui/components/InfoLine.zig");
|
||||
const Session = @import("tui/components/Session.zig");
|
||||
const Text = @import("tui/components/Text.zig");
|
||||
const UserList = @import("tui/components/UserList.zig");
|
||||
const TerminalBuffer = @import("tui/TerminalBuffer.zig");
|
||||
const termbox = TerminalBuffer.termbox;
|
||||
const temporary_allocator = std.heap.page_allocator;
|
||||
|
||||
const StringList = std.ArrayListUnmanaged([]const u8);
|
||||
const ly_version_str = "Ly version " ++ build_options.version;
|
||||
|
||||
var session_pid: std.posix.pid_t = -1;
|
||||
@@ -673,7 +675,7 @@ pub fn main() !void {
|
||||
|
||||
// Skip event polling if autologin is set, use simulated Enter key press instead
|
||||
if (is_autologin) {
|
||||
event = termbox.tb_event{
|
||||
event = .{
|
||||
.type = termbox.TB_EVENT_KEY,
|
||||
.key = termbox.TB_KEY_ENTER,
|
||||
.ch = 0,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const TerminalBuffer = @import("TerminalBuffer.zig");
|
||||
|
||||
const termbox = TerminalBuffer.termbox;
|
||||
|
||||
const Cell = @This();
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
const std = @import("std");
|
||||
const ly_core = @import("ly-core");
|
||||
const Cell = @import("Cell.zig");
|
||||
|
||||
pub const termbox = @import("termbox2");
|
||||
|
||||
const Random = std.Random;
|
||||
|
||||
const ly_core = @import("ly-core");
|
||||
const interop = ly_core.interop;
|
||||
const LogFile = ly_core.LogFile;
|
||||
pub const termbox = @import("termbox2");
|
||||
|
||||
const Cell = @import("Cell.zig");
|
||||
|
||||
const TerminalBuffer = @This();
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
const TerminalBuffer = @import("../TerminalBuffer.zig");
|
||||
const generic = @import("generic.zig");
|
||||
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
const MessageLabel = generic.CyclableLabel(Message, Message);
|
||||
|
||||
const InfoLine = @This();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
const std = @import("std");
|
||||
const TerminalBuffer = @import("../TerminalBuffer.zig");
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
const enums = @import("../../enums.zig");
|
||||
const DisplayServer = enums.DisplayServer;
|
||||
const Environment = @import("../../Environment.zig");
|
||||
const TerminalBuffer = @import("../TerminalBuffer.zig");
|
||||
const generic = @import("generic.zig");
|
||||
const UserList = @import("UserList.zig");
|
||||
|
||||
const Allocator = std.mem.Allocator;
|
||||
const DisplayServer = enums.DisplayServer;
|
||||
|
||||
const Env = struct {
|
||||
environment: Environment,
|
||||
index: usize,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
const std = @import("std");
|
||||
const TerminalBuffer = @import("../TerminalBuffer.zig");
|
||||
|
||||
const Allocator = std.mem.Allocator;
|
||||
const DynamicString = std.ArrayListUnmanaged(u8);
|
||||
|
||||
const TerminalBuffer = @import("../TerminalBuffer.zig");
|
||||
const termbox = TerminalBuffer.termbox;
|
||||
|
||||
const DynamicString = std.ArrayListUnmanaged(u8);
|
||||
|
||||
const Text = @This();
|
||||
|
||||
allocator: Allocator,
|
||||
@@ -21,12 +21,10 @@ masked: bool,
|
||||
maybe_mask: ?u32,
|
||||
|
||||
pub fn init(allocator: Allocator, buffer: *TerminalBuffer, masked: bool, maybe_mask: ?u32) Text {
|
||||
const text: DynamicString = .empty;
|
||||
|
||||
return .{
|
||||
.allocator = allocator,
|
||||
.buffer = buffer,
|
||||
.text = text,
|
||||
.text = .empty,
|
||||
.end = 0,
|
||||
.cursor = 0,
|
||||
.visible_start = 0,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
const std = @import("std");
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
const SavedUsers = @import("../../config/SavedUsers.zig");
|
||||
const TerminalBuffer = @import("../TerminalBuffer.zig");
|
||||
const generic = @import("generic.zig");
|
||||
const Session = @import("Session.zig");
|
||||
const SavedUsers = @import("../../config/SavedUsers.zig");
|
||||
|
||||
const StringList = std.ArrayListUnmanaged([]const u8);
|
||||
const Allocator = std.mem.Allocator;
|
||||
|
||||
pub const User = struct {
|
||||
name: []const u8,
|
||||
session_index: *usize,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const std = @import("std");
|
||||
|
||||
const TerminalBuffer = @import("../TerminalBuffer.zig");
|
||||
|
||||
pub fn CyclableLabel(comptime ItemType: type, comptime ChangeItemType: type) type {
|
||||
|
||||
Reference in New Issue
Block a user