From 2df6bd80a737b9782f1f64d419a8276bd263cd34 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Mon, 17 Jan 2022 20:50:33 -0500 Subject: [PATCH 1/2] saturn: Provide usable lua shebang The end-result can be executed directly on my NixOS system. --- saturn/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saturn/Makefile b/saturn/Makefile index 852d14e..a2df6cc 100644 --- a/saturn/Makefile +++ b/saturn/Makefile @@ -7,7 +7,7 @@ MODULES=main.fnl lua $(FENNEL) --compile $< > $@ saturn: $(patsubst %.fnl,%.lua,$(MODULES)) Makefile - (echo -e "#!/usr/bin/lua\n" ; cat main.lua ) > $@ + (echo -e "#!/usr/bin/env lua\n" ; cat main.lua ) > $@ chmod +x $@ install: From 900b34a72184e5775578719d006aa59db9d031c8 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Mon, 17 Jan 2022 20:50:59 -0500 Subject: [PATCH 2/2] saturn: Use FlowBox rather than Grid This makes the app automagically more responsive! --- saturn/main.fnl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/saturn/main.fnl b/saturn/main.fnl index 14765ee..fe8650f 100644 --- a/saturn/main.fnl +++ b/saturn/main.fnl @@ -133,17 +133,13 @@ (local grid-columns 4) -(let [grid (Gtk.Grid { +(let [grid (Gtk.FlowBox { :column_spacing 2 :row_spacing 5 }) scrolled-window (Gtk.ScrolledWindow {})] - (var i 0) (each [_ app (pairs (all-apps))] - (let [x (% i grid-columns) - y (// i grid-columns)] - (set i (+ i 1)) - (grid:attach (button-for app) x y 1 1))) + (grid:insert (button-for app) -1)) (scrolled-window:add grid) (window:add scrolled-window))