start of startscreen overhaul

This commit is contained in:
nova 2024-01-30 00:10:59 +01:00
parent 95a377929a
commit 516fe4a063
2 changed files with 36 additions and 175 deletions

View File

@ -69,7 +69,9 @@ local plugins = {
--start screen --start screen
{ {
'goolord/alpha-nvim', 'nvimdev/dashboard-nvim',
event = 'VimEnter',
dependencies = { {'nvim-tree/nvim-web-devicons'}}
}, },
-- }}} -- }}}

View File

@ -1,177 +1,36 @@
local alpha = require("alpha") local dash = require('dashboard')
local custom_header = {
local col = function(strlist, opts) ' .█▄╥ _▄K¥▄ ',
-- strlist is a TABLE of TABLES, representing columns of text ' █ `▀▄_ ▄▄ ╓▄▀" ▀▌ ',
-- opts is a text display option ' █ "▀▄, ▓ ▀▀▄ ▄▀- █ ',
' ▐▌ ▀▄▌▀▀▀▀`""▀▀█ ▀▄ _▄▀ ▓ ',
-- column spacing ' ▓ "▓╥ "▓_.▓▀ ╫ ',
local padding = 12 ' )▌ ▀█ ╫ ',
-- fill lines up to the maximim length with 'fillchar' ' ▐∩ █ ',
local fillchar = ' ' ' ▐∩ ▐▌ ',
-- columns padding char (for testing) ' ▐µ █▌ ',
local padchar = ' ' ' ▓ ╨▓▓█▄▄╥_ ,▄▄█████▄ █ ',
' ▐▄ `"▀▀██▄ ▐███▌╓_ .▓" ',
-- define maximum string length in a table ' "▓▄ _▄▄███▀` ▄▄▄▄┐ "▀▀█████▄ .▄K▀▀▀▀█ ',
local maxlen = function(str) '▐▌▀▀▀▀ª ▀▀` "▀▄, _ _╥▄▀ ',
local max = 0 ' ▓▄ _╥µ __ ,▄▄ ]µ ` ╫▌@╨ ▀▌ ',
for i in pairs(str) do ' "▀▄` ▓K" *▌▄▄▀" "▀▀▓▀ ▀▄ ',
if #str[i] > max then ' █. ▐▌ j▌ _ █ ',
max = #str[i] ' █ , ▀▄ ▐▌ ▄▓"▀▀▀▀" ',
end ' ▐█K▀▀"▀¥██▌▄▄_ ╨▓_ _█ ,▄▄K▀▀ ',
end ' ▐▌ "▀W "▀" "█µ ',
return max ' ▐█ "▓_ ',
end ' _▓▀ ▀▄ ',
' j█____ _ ▀▄ ',
-- add as much right-padding to align the text block ' ``"▓" ▓⌐ ',
local pad = function(str, max) ' █ ▐▌ ',
local strlist = {} ' ▀ ▀ ',
for i in pairs(str) do
if #str[i] < max then
local newstr = str[i] .. string.rep(fillchar, max-#str[i])
table.insert(strlist, newstr)
else
table.insert(strlist, str[i])
end
end
return strlist
end
-- this is a table for text strings
local values = {}
-- process all the lines
for i=1,maxlen(strlist) do
local str = ''
-- process all the columns but last, because we dont wand extra padding
-- after last column
for column=1,#strlist-1 do
local maxstr = maxlen(strlist[column])
local padded = pad(strlist[column], maxstr)
if strlist[column][i] == nil then
str = str .. string.rep(fillchar, maxstr) .. string.rep(padchar, padding)
else
str = str .. padded[i] .. string.rep(padchar, padding)
end
end
-- lets process the last column, no extra padding
do
local maxstr = maxlen(strlist[#strlist])
local padded = pad(strlist[#strlist], maxstr)
if strlist[#strlist][i] == nil then
str = str .. string.rep(fillchar, maxlen(strlist[#strlist]))
else
str = str .. padded[i]
end
end
-- insert result into output table
table.insert(values, { type = "text", val = str, opts = opts })
end
return values
end
local window_managment = {
"ALT-ENT new tab terminal",
"ALT-NUM move to tab n",
"ALT-v horizontal split",
"ALT-v vertical split",
}
local text_managment = {
"CTRL-t new file",
"CTRL-w :q",
"CTRL-n open file manager"
} }
local applications = { dash.setup{
"ALT+ESC htop", config = {
"ALT+t termusic", theme = 'doom',
"ALT+r ranger", header = custom_header,
"ALT+m matrix",
} }
local head = {
type = "text",
val = {
[[ .█▄╥ _▄K¥▄ ]],
[[ █ '▀▄_ ▄▄ ╓▄▀" ▀▌ ]],
[[ █ "▀▄, ▓ ▀▀▄ ▄▀- █ ]],
[[ ▐▌ ▀▄▌▀▀▀▀'""▀▀█ ▀▄ _▄▀ ▓ ]],
[[ ▓ "▓╥ "▓_.▓▀ ╫ ]],
[[ )▌ ▀█ ╫ ]],
[[ ▐∩ █ ]],
[[ ▐∩ ▐▌ ]],
[[ ▐µ █▌ ]],
[[ ▓ ╨▓▓█▄▄╥_ ,▄▄█████▄ █ ]],
[[ ▐▄ `"▀▀██▄ ▐███▌╓_ .▓" ]],
[[ "▓▄ _▄▄███▀' ▄▄▄▄┐ "▀▀█████▄ .▄K▀▀▀▀█ ]],
[[▐▌▀▀▀▀ª ▀▀' "▀▄, _ _╥▄▀ ]],
[[ ▓▄ _╥µ __ ,▄▄ ]µ ` ╫▌@╨ ▀▌ ]],
[[ "▀▄` ▓K" *▌▄▄▀" "▀▀▓▀ ▀▄ ]],
[[ █. ▐▌ j▌ _ █ ]],
[[ █ , ▀▄ ▐▌ ▄▓"▀▀▀▀" ]],
[[ ▐█K▀▀"▀¥██▌▄▄_ ╨▓_ _█ ,▄▄K▀▀ ]],
[[ ▐▌ "▀W "▀" "█µ ]],
[[ ▐█ "▓_ ]],
[[ _▓▀ ▀▄ ]],
[[ j█____ _ ▀▄ ]],
[[ ''"▓" ▓⌐ ]],
[[ █ ▐▌ ]],
[[ ▀ ▀ ]],
},
opts = {
position = "center",
hl = "Type",
},
} }
local foot = {
type = "text",
val = "footer",
opts = {
position = "center",
hl = "Number",
},
}
local block1 = {
type = "group",
val = col({window_managment, text_managment}, { position = "center", hl = {{ "Title", 0, 7 }, {"Comment", 7, 37}, {"Title", 37, 44}, {"Comment", 44, -1}}}),
opts = {
spacing = 0
},
}
local block2 = {
type = "group",
val = col({applications}, { position = "center", hl = {{"Comment", 7, -1}, { "Title", 0, 7 }} }),
opts = {
spacing = 0
},
}
local opts = {
layout = {
{ type = "padding", val = 2 },
head,
{ type = "padding", val = 2 },
block1,
{ type = "padding", val = 2 },
block2,
},
opts = {
noautocmd = true,
margin = 5,
},
}
alpha.setup(opts)