ly/res
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
..
custom-sessions custom-sessions/README: remove extraneous comma (#927) 2026-02-08 13:16:25 +01:00
lang Feature: Add custom command & label support (#945) 2026-03-27 17:15:49 +01:00
ly-runit-service Remove config TTY options in OpenRC & runit services 2025-10-17 23:08:15 +02:00
ly-s6 Fix dinit & s6 service + don't hardcode paths in runit service 2025-08-29 02:18:11 +02:00
pam.d [Feature] Add autologin support (#841) (closes #200) 2025-10-25 23:09:24 +02:00
config.ini Feature: Add custom command & label support (#945) 2026-03-27 17:15:49 +01:00
example.dur [dur] Add support for alignments and negative offsets + Ly logo (#893) 2026-01-25 23:08:42 +01:00
ly-dinit Fix dinit & s6 service + don't hardcode paths in runit service 2025-08-29 02:18:11 +02:00
ly-freebsd-wrapper Update init service for FreeBSD 2025-10-18 11:23:57 +02:00
ly-kmsconvt@.service Use the unifont engine for KMSCON 2026-02-07 10:43:08 +01:00
ly-openrc Remove config TTY options in OpenRC & runit services 2025-10-17 23:08:15 +02:00
ly-sysvinit Add SysVinit service (closes #224) 2025-10-17 23:10:52 +02:00
ly@.service Escape TTY in systemd service (closes #889) (#890) 2025-12-18 12:17:00 +01:00
setup.sh Possibly fix .Xresources not being loaded (closes #600) 2025-03-06 20:06:28 +01:00
startup.sh Make default startup script more compatible 2026-02-12 17:10:52 +01:00