From 1603b07525eda74bc9dfb616b197e5598b45a6ff Mon Sep 17 00:00:00 2001 From: n loewen Date: Sat, 11 May 2024 17:32:25 -0700 Subject: [PATCH] Script: Update for classroom Mac screen dimensions etc. --- src/vidgrid.lua | 40 +++++++++++++++++++---------------- vidgrid.app/vidgrid-script.sh | 40 +++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 36 deletions(-) diff --git a/src/vidgrid.lua b/src/vidgrid.lua index 94483c4..e8334f2 100755 --- a/src/vidgrid.lua +++ b/src/vidgrid.lua @@ -2,9 +2,13 @@ -- 1. CONFIGURATION -screen_width = 1080 -- FIXME +screen_width = 1150 -- FIXME... + -- The screen is actually 1280, but at that height + -- 3 rows of videos is actually too tall, so this is a quick + -- hack to make sure they all fit vertically aspect_ratio = 1.5 -- a good default for dragonframe's typical 1620x1080 exports -menubar_height = 39 +-- menubar_height = 39 +menubar_height = 22 -- at 1280x800 the menu bar is shorter -- 2. UTILITY FUNCTIONS @@ -35,23 +39,23 @@ if number_of_windows <= 9 then cols = 3 rows = 3 elseif number_of_windows <= 12 then - cols = 3 - rows = 4 -elseif number_of_windows <= 16 then cols = 4 - rows = 4 -elseif number_of_windows <= 20 then - cols = 4 - rows = 5 -elseif number_of_windows <= 25 then - cols = 5 - rows = 5 -elseif number_of_windows <= 30 then - cols = 5 - rows = 6 -elseif number_of_windows <= 36 then - cols = 6 - rows = 6 + rows = 3 +-- elseif number_of_windows <= 16 then +-- cols = 5 +-- rows = 3 +--elseif number_of_windows <= 20 then +-- cols = 4 +-- rows = 5 +--elseif number_of_windows <= 25 then +-- cols = 5 +-- rows = 5 +--elseif number_of_windows <= 30 then +-- cols = 5 +-- rows = 6 +--elseif number_of_windows <= 36 then +-- cols = 6 +-- rows = 6 else os.execute("osascript -e 'display dialog \"you have too many videos lol\"'") os.exit() diff --git a/vidgrid.app/vidgrid-script.sh b/vidgrid.app/vidgrid-script.sh index 94483c4..e8334f2 100755 --- a/vidgrid.app/vidgrid-script.sh +++ b/vidgrid.app/vidgrid-script.sh @@ -2,9 +2,13 @@ -- 1. CONFIGURATION -screen_width = 1080 -- FIXME +screen_width = 1150 -- FIXME... + -- The screen is actually 1280, but at that height + -- 3 rows of videos is actually too tall, so this is a quick + -- hack to make sure they all fit vertically aspect_ratio = 1.5 -- a good default for dragonframe's typical 1620x1080 exports -menubar_height = 39 +-- menubar_height = 39 +menubar_height = 22 -- at 1280x800 the menu bar is shorter -- 2. UTILITY FUNCTIONS @@ -35,23 +39,23 @@ if number_of_windows <= 9 then cols = 3 rows = 3 elseif number_of_windows <= 12 then - cols = 3 - rows = 4 -elseif number_of_windows <= 16 then cols = 4 - rows = 4 -elseif number_of_windows <= 20 then - cols = 4 - rows = 5 -elseif number_of_windows <= 25 then - cols = 5 - rows = 5 -elseif number_of_windows <= 30 then - cols = 5 - rows = 6 -elseif number_of_windows <= 36 then - cols = 6 - rows = 6 + rows = 3 +-- elseif number_of_windows <= 16 then +-- cols = 5 +-- rows = 3 +--elseif number_of_windows <= 20 then +-- cols = 4 +-- rows = 5 +--elseif number_of_windows <= 25 then +-- cols = 5 +-- rows = 5 +--elseif number_of_windows <= 30 then +-- cols = 5 +-- rows = 6 +--elseif number_of_windows <= 36 then +-- cols = 6 +-- rows = 6 else os.execute("osascript -e 'display dialog \"you have too many videos lol\"'") os.exit()