11 Commits

Author SHA1 Message Date
AnErrupTion
5edf5251f6 Update to Zig 0.16.0 (#962)
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
2026-04-25 17:37:34 +02:00
AnErrupTion
e0a3364169 Merge branch 'master' of codeberg.org:fairyglade/ly
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2026-03-27 17:17:18 +01:00
RadsammyT
7a8d913531 Feature: Add custom command & label support (#945)
## 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

![image](/attachments/f9373ac9-567e-4f47-987c-1df6f4ee0d84)

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>
2026-03-27 17:15:49 +01:00
AnErrupTion
984ac596af Group for loops in event loop
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2026-03-26 21:55:35 +01:00
AnErrupTion
549576aa3e Make box widget not position-dependent
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2026-03-25 22:06:57 +01:00
AnErrupTion
60e3380375 Switch to single-instance Widget model
And make widget() functions return pointers to widgets instead of just
widgets

Signed-off-by: AnErrupTion <anerruption@disroot.org>
2026-03-21 16:19:33 +01:00
AnErrupTion
abe72c74ff Optimise event loop initialisation
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2026-03-18 20:26:00 +01:00
AnErrupTion
9c50297059 Fix insert mode hack + fix bugs
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2026-03-17 23:58:06 +01:00
AnErrupTion
acac884cfe Add support for local keybinds
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2026-03-17 22:58:39 +01:00
AnErrupTion
a89c918c5d Move back custom widgets into main project
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2026-03-17 21:59:24 +01:00
AnErrupTion
64539f4342 Split UI code into ly-ui library
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2026-03-17 21:44:33 +01:00