## What are the changes about?
TL;DR:

Slaps the entire LuaJIT runtime onto Ly, allowing for the creation of custom dynamic animations like GameOfLife, ColorWave, Doom, etc.
This PR adds the [ziglua](https://github.com/natecraddock/ziglua?ref=zig-0.16) dependency for its zig bindings and considerable buildtime config (mainly lua version selection).
### Example
<video src="/attachments/3f91cf72-ae24-459c-8ef6-099f71e866fd" title="Screencast_20260519_172320" controls></video>
```lua
ly.frame_delay = 5
local timer = 0
local clock = os.clock()
local clock_diff = 0
function draw()
timer = timer + 1
byte = string.byte(' ')
clock_diff = os.clock() - clock
clock = os.clock()
timer = timer + clock_diff
for x = 0, ly.width-1 do
for y = 0, ly.height-1 do
local xc = 0xFF
if x < 255 then xc = ((x + math.floor(timer / 2)) * 3) % 255 else xc = 0 end
local yc = 0xFF
if y < 255 then yc = ((y) * 3) % 255 else yc = 0 end
ly.putCell(byte, xc, bit.bor(xc, yc), x, y)
end
end
end
```
### The API
The API that Ly gives to the user is minimal. A table is globally available, named `ly`, which provides the following:
| Member | Purpose |
|---------|---------|
| `ly.width` & `ly.height` | Respective Width/Height from the `TerminalBuffer` |
| `ly.putCell(byte, fg, bg, x, y)` | Literally `Cell.init(byte, fg, bg).put(x, y)`.|
| `ly.clock()` | The current real-time, in microseconds. |
### Error Handling
On a Lua Error, Ly won't quit but will instead paint the entire background red. The lua error in question can be found in the Ly log file and on-screen.
```log
2026-05-19 16:13:40 [err/Lua] Error (Cannot call draw()): attempt to call a nil value
2026-05-19 11:05:51 [err/Lua] Lua Error: ...dsammyt/programming/probe/ly/scratch/testConfig/test.lua:30: bad argument #1 to 'ipairs' (table expected, got number)
```
## Pre-requisites
- [X] I have tested & confirmed the changes work locally
- [X] I have run `zig fmt` throughout my changes
Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/1001
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
Signed-off-by: AnErrupTion <anerruption@disroot.org>
## What are the changes about?
Ports the code base to Zig 0.16.0.
## What existing issue does this resolve?
N/A
## Pre-requisites
- [x] I have tested & confirmed the changes work locally
- [x] I have run `zig fmt` throughout my changes
Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/962
Replaced the local `termbox2.h` header file with a proper dependency managed by the Zig package manager. This improves maintainability and makes it easier to track and update the library in the future.
The previous `termbox2.h` contained a custom `tb_get_cell` function that is not present in the upstream repository. This function has been re-implemented in Zig (`src/tui/termbox_extras.zig`) to maintain compatibility, especially for the failed-login "cascade" animation.
This change also involved updating `build.zig` and `build.zig.zon` to use the new dependency.
* Add build.zig, remove makefile, add .idea directory to .gitignore
* Remove submodules, add projects directly
* Remove submodules
* Add projects
* Rename sub/ to dep/, remove makefiles
* Rewrite main.c
* Remove Argoat dependency
* Remove unused dependencies
* Rewrite config.c
* Add files
* Change default fg to 8 in config.ini
* Partially rewrite utils.c
* Use Zig package manager
* Rewrite INPUTS enum in Zig
* Commit unfinished full rewrite (Zig 0.11.0)
What needs to be dealt with:
- Matrix animation
- Authentication part
- Testing on actual TTY (not just virtual console)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Implement more (untested) authentication code
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Fix some bugs (hopefully)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Try to fix some more bugs
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Oops, forgot to allocate hehe
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Changes in the Zig rewrite (#596)
* Everything
* make matrix.zig a bit cleaner
* make long lines shorter and add changelog
* vi mode
* update changelog
* get errors from child process and (hopefully) fix some other things
* fix utmp entry
* run authentication in a child process
* update changelog
* small code improvements
* change that
* clear terminal on SIGTERM
* Remove LogFile
* moved ini to a lib, fixed alternative langs
* fix logging out
* oops
* code improvements
* consistency
* clearing the env isn't needed anymore (afaik)
* replace vi_mode with a bool
* type aliases, avoiding zeroes(), breaking a long line
* lowercase insert/normal, merge conditionals, code improvements
* Add experimental save file migrator + bug fixes + add "-dev" version suffix
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Resolve conflicts
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Clean up when SIGTERM is received (#597)
* clean up child processes on SIGTERM
* small code improvement
* consistency.. i guess?
* Properly set XDG_CURRENT_DESKTOP
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Zig 0.12.0 and more! (#599)
* less alloc, update migrator, get DesktopNames from .desktop
* small cleanup
* Update zigini to improve compatibility with old config
* Code improvements
* Update to zig version 0.12.0
* Some fixes
* tiny changes
* remove useless comment
* migrator changes, and small things
* set XDG env vars differently
* free memory on error when appending environments
* Fix out of bounds issue when using the Delete key
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Update zig-ini to fix configuration issue (#603)
* Mention display-manager-init for Gentoo/OpenRC in readme.md
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Tidy up readme.md
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Fix authentication in a few edge cases (#604)
* fix loginConv and auth
* fix potential mem leak with configs
* BIG changes
---------
Signed-off-by: AnErrupTion <anerruption@disroot.org>
Co-authored-by: アシュ <120780645+Kawaii-Ash@users.noreply.github.com>