summaryrefslogtreecommitdiff
path: root/pkgs/astal/src/lib.lua
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-06-20 16:16:16 -0400
committerFreya Murphy <freya@freyacat.org>2025-06-20 16:16:16 -0400
commit1ab1ca007d0073ccf07d8c8e4e61bced5deb7d0e (patch)
tree8e7b67455d192b3114744ec6d519b8d6f8162c04 /pkgs/astal/src/lib.lua
parentfix astal notification text justification (diff)
downloaddotfiles-nix-1ab1ca007d0073ccf07d8c8e4e61bced5deb7d0e.tar.gz
dotfiles-nix-1ab1ca007d0073ccf07d8c8e4e61bced5deb7d0e.tar.bz2
dotfiles-nix-1ab1ca007d0073ccf07d8c8e4e61bced5deb7d0e.zip
make astal launcher wrap with arrow keys
Diffstat (limited to 'pkgs/astal/src/lib.lua')
-rw-r--r--pkgs/astal/src/lib.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/astal/src/lib.lua b/pkgs/astal/src/lib.lua
index 98a5ecc..23c5dd1 100644
--- a/pkgs/astal/src/lib.lua
+++ b/pkgs/astal/src/lib.lua
@@ -103,6 +103,16 @@ lib = {
return lib.count(array) == 0
end,
+ --- clamps a number between two other numbers
+ clamp = function(num, low, high)
+ if low and num < low then
+ return low
+ elseif high and num > high then
+ return high
+ end
+ return num
+ end,
+
--- negates value
neg = function(val)
return not val