## 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>
Animations bigger than the rendering area would have an alignment to the
top left instead of center.
## What are the changes about?
Fixes incorrect offset calculations for dur movies bigger than the screen.
## 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/966
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
## What are the changes about?
Added a new option in the configuration file for moving the box relative to the screen size.
```
box_h_position = 0.5
box_v_position = 0.5
```
The big clock is centered relative to the box. In the cases where it would be outside of the screen, it moves the box to fit in the screen.
## What existing issue does this resolve?
Add more options for personalization
## Examples
Normal usage:
```
box_h_position = 0.15
box_v_position = 0.35
```

Clock would be outside of the screen vertically:
```
box_h_position = 0.15
box_v_position = -1.0
```

Clock would be outside of the screen horizontally and vertically:
```
box_h_position = -1.0
box_v_position = -1.0
input_len = 3
```

Clock would be outside of the screen horizontally and vertically on the bottom left of the screen:
```
box_h_position = 2.0
box_v_position = 2.0
input_len = 3
```

## What existing issue does this resolve?
_Replace this with a reference to an existing issue, or N/A if there is none_
## Pre-requisites
- [x] I have tested & confirmed the changes work locally
- [x] I have run `zig fmt` throughout my changes
Co-authored-by: AnErrupTion <anerruption+codeberg@disroot.org>
Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/964
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
## What are the changes about?
Fixes battery label positioning in regards to custom binds.
Since the label was on the top-left, it only accounted for the first line of built-in keybinds, and it didn't account for the other lines of custom ones.
This also fixes the custom keybinds not disappearing on `hide_key_hints = false`, which is my bad. whoops.
Also, with https://codeberg.org/fairyglade/ly/pulls/963 being a thing, we should probably think about deprecating this hardcoded battery label in favor of a custom label command, top-left by default.
## 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/970
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
The shell session is unconditionally added to the session list with no way to hide it. This is inconsistent with `xinitrc`, which is omitted from the list when set to `null`.
This change adds a `shell` boolean config option (default `true`). Setting it to `false` hides the shell session from the list, following the same pattern as `xinitrc`.
Co-authored-by: Jackson Delahunt <jackson@stemn.com>
Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/955
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
Co-authored-by: Jackson Delahunt <sabrehagen@noreply.codeberg.org>
Co-committed-by: Jackson Delahunt <sabrehagen@noreply.codeberg.org>
When running multiple ly instances across different TTYs there is no way to tell which TTY a given login screen belongs to at a glance.
This change adds a `show_tty` boolean config option (default `false`) that displays the active TTY number (e.g. `tty3`) in the top right corner. When the clock is also enabled the TTY label sits immediately to its right on the same row. When the clock is disabled it occupies the top right corner on its own.
I'm open to advice from the maintainers on the placement of the TTY label — positioning it next to the clock is simply my personal preference and it doesn't need to stay there if a different position is more appropriate.
Co-authored-by: Jackson Delahunt <jackson@stemn.com>
Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/956
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
Co-authored-by: Jackson Delahunt <sabrehagen@noreply.codeberg.org>
Co-committed-by: Jackson Delahunt <sabrehagen@noreply.codeberg.org>
`waylandsessions` and `xsessions` are currently non-optional string fields, so there is no clean way to disable session type discovery for users who do not use Wayland or X11. Setting them to a nonexistent path works but produces log errors on every startup.
This change makes both fields optional (`?[]const u8`), consistent with other nullable config fields such as `xinitrc`. Setting either to `null` in `config.ini` cleanly skips crawling for that session type with no side effects.
Co-authored-by: Jackson Delahunt <jackson@stemn.com>
Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/954
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
Co-authored-by: Jackson Delahunt <sabrehagen@noreply.codeberg.org>
Co-committed-by: Jackson Delahunt <sabrehagen@noreply.codeberg.org>
## What are the changes about?
Fixes the order of custom labels and binds because of a HashMap shenanigan (no guaranteed order), so we use `ArrayHashMap` instead which preserves insertion order. They should now be shown in the order they are declared in the config.


## What existing issue does this resolve?
!950
## 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/951
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
Co-authored-by: RadsammyT <radsammyt@gmail.com>
Co-committed-by: RadsammyT <radsammyt@gmail.com>
## What are the changes about?
Adds customizable commands and labels to ly.
Solves https://codeberg.org/fairyglade/ly/issues/905.
Since Ly doesn't use INI headers. I use them exclusively for declarations of custom commands and labels.
### Commands
Bind a keybind to a command, and add a hint to the HUD. Useful for use cases like display brightness, switching between GPUs, etc.
Supports localization in the `name` field only. ex: where `lang = es`: `$brightness_up` => `bajar brillo`
Declared in config.ini with the following:
```ini
[cmd:F8]
name = custom command 2
cmd = touch /tmp/ly.gaming
```
### Labels
Add a label to the HUD. As specified in #905.
The text of the label corresponds to the output of the command specified in `[lbl:NAME]`.
Only shows the first line of the output.
Declared in config.ini with the following:
```ini
[lbl:kernel]
cmd = uname -srn
refresh = 0
```
Example to add to the config.ini:
```ini
# Declare a command with the F8 binding.
[cmd:F8]
#The name of the command to show up in Ly.
name = custom command
cmd = touch /tmp/ly.gaming
# Declare a label with an ID. This ID should be unique across all labels.
[lbl:kernel]
cmd = uname -srn
# In frames, the time to re-run the command and update the label. If 0, only run once- do not refresh.
refresh = 0
# Once you're done setting up labels and commands, add an empty header
# below to continue configurating the rest of Ly.
# Put other settings not belonging to custom commands/labels below here.
[]
```
## Pre-requisites
- [x] I have tested & confirmed the changes work locally

Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/945
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
Co-authored-by: RadsammyT <radsammyt@gmail.com>
Co-committed-by: RadsammyT <radsammyt@gmail.com>
## What are the changes about?
Add an argument to info log function to fix compiler error.
## What existing issue does this resolve?
If building with `zig build -Denable_x11_support=false` there is a compiler error about a missing argument.
```
install
└─ install ly
└─ compile exe ly Debug native 1 errors
src/main.zig:730:27: error: member function expected 3 argument(s), found 2
try state.log_file.info(
~~~~~~~~~~~~~~^~~~~
ly-core/src/LogFile.zig:26:5: note: function declared here
pub fn info(self: *LogFile, category: []const u8, comptime message: []const u8, args: anytype) !void {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
callMain [inlined]: /home/oskar/.cache/zig/p/N-V-__8AACFNhBSaulceFT2Wx6Mx-ycGtZh7CEztyVdtX2jW/lib/std/start.zig:627:37
callMainWithArgs [inlined]: /home/oskar/.cache/zig/p/N-V-__8AACFNhBSaulceFT2Wx6Mx-ycGtZh7CEztyVdtX2jW/lib/std/start.zig:587:20
main: /home/oskar/.cache/zig/p/N-V-__8AACFNhBSaulceFT2Wx6Mx-ycGtZh7CEztyVdtX2jW/lib/std/start.zig:602:28
1 reference(s) hidden; use '-freference-trace=4' to see all references
```
## Pre-requisites
- [x] I have tested & confirmed the changes work locally
Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/947
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
Co-authored-by: Mr. Cat <mrcat@posteo.com>
Co-committed-by: Mr. Cat <mrcat@posteo.com>