This commit is contained in:
Steve 2022-12-03 20:51:19 -05:00
commit e25cf3edec
34 changed files with 3718 additions and 0 deletions

View file

@ -0,0 +1,33 @@
local M = {}
local home = os.getenv('HOME')
function scandir(directory)
local i, t, popen = 0, {}, io.popen
local pfile = popen('ls "'..directory..'"')
for filename in pfile:lines() do
i = i + 1
t[i] = filename
end
pfile:close()
return t
end
function M()
catTable = scandir(vim.fn.stdpath('config') .. '/static/')
math.random()
math.randomseed(os.time()+math.random())
math.random(); math.random(); math.random();
file = vim.fn.stdpath('config') .. '/static/' .. catTable[math.random(#catTable)]
local fheight = io.popen('cat '..file..' | wc -l')
local fwidth = io.popen('awk "{print length}" '..file..' | sort -nr | head -1')
local db = require 'dashboard'
db.preview_command = 'cat | lolcat -F 0.3 -p 15'
db.preview_file_path = file
db.preview_file_height = tonumber(fheight:read("*a"))
db.preview_file_width = tonumber(fwidth:read("*a"))
db.header_pad = 0
end
return M()