Fix example.lua doc + add ly-community in README

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2026-06-19 20:18:45 +02:00
parent eeccb7421b
commit 4d882f7997
2 changed files with 52 additions and 48 deletions

View File

@@ -56,6 +56,10 @@ Join us on Matrix over at [#ly-dm:matrix.org](https://matrix.to/#/#ly-dm:matrix.
[![Packaging status](https://repology.org/badge/vertical-allrepos/ly-display-manager.svg?exclude_unsupported=1)](https://repology.org/project/ly-display-manager/versions)
## Custom animations & user scripts
If you want to pimp your Ly installation even further than what the traditional configuration file allows you to, a [community repository](https://codeberg.org/fairyglade/ly-community) exists containing custom animations & scripts, so go check it out!
## Support
Every environment that works on other login managers also should work on Ly.

View File

@@ -22,7 +22,7 @@
--
-- For the byte argument, you may use string.byte to fill this argument.
--
-- putCell(byte, fg, bg, x, y, w, h) -- Draw a rectangle.
-- putRect(byte, fg, bg, x, y, w, h) -- Draw a rectangle.
-- Arguments are the same as putCell except for w and h, which are also
-- unsigned integers. The rectangle will be drawn from the top-left, with
-- argument w extending it to the right and argument h extending downwards.
@@ -52,7 +52,7 @@
-- you create.
local FPS_COUNT = 40
local function FPS()
return (1/FPS_COUNT)*1000000
return (1 / FPS_COUNT) * 1000000
end
@@ -68,7 +68,7 @@ for i = 1, SQUARE_COUNT do
local vy = 1
if math.random(1, 2) == 2 then vx = -vx end
if math.random(1, 2) == 2 then vy = -vy end
squares[#squares+1] = {
squares[#squares + 1] = {
x = math.random(1, ly.width - SQUARE_WIDTH),
y = math.random(1, ly.height - SQUARE_HEIGHT),
vx = vx,
@@ -94,13 +94,13 @@ function draw()
if v.x == 0 then
v.vx = 1; v.color = math.random(0xFFFFFF)
end
if v.x + SQUARE_WIDTH >= ly.width-1 then
if v.x + SQUARE_WIDTH >= ly.width - 1 then
v.vx = -1; v.color = math.random(0xFFFFFF)
end
if v.y == 0 then
v.vy = 1; v.color = math.random(0xFFFFFF)
end
if v.y + SQUARE_HEIGHT >= ly.height-1 then
if v.y + SQUARE_HEIGHT >= ly.height - 1 then
v.vy = -1; v.color = math.random(0xFFFFFF)
end
end
@@ -113,7 +113,7 @@ function draw()
end
local new_perf = ly.clock()
local str = "FT: "..((new_perf - perf) / 1000).."ms"
ly.putLabel(str , 0x00FFFFFF, 0, (ly.width/2) - (string.len(str)/2), ly.height-1)
local str = "FT: " .. ((new_perf - perf) / 1000) .. "ms"
ly.putLabel(str, 0x00FFFFFF, 0, (ly.width / 2) - (string.len(str) / 2), ly.height - 1)
perf = new_perf
end