## 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>
Notably, don't make the issue reproduction on a fresh install required.
This'll likely filter out the honest people who have actually done it
from the others who haven't.
Signed-off-by: AnErrupTion <anerruption@disroot.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>