dotfiles/.config/nvim/lua/plugins/alpha.lua

74 lines
4.0 KiB
Lua

-------------------
-- Helper functions
-------------------
local function clamp(x, min, max) return math.max(math.min(x, max), min) end
local function get_random_image()
images = {
{
[[██╗ █████╗ ██████╗██╗ ██╗███████╗]],
[[██║ ██╔══██╗██╔════╝██║ ██║██╔════╝]],
[[██║ ███████║██║ ███████║███████╗]],
[[██║ ██╔══██║██║ ██╔══██║╚════██║]],
[[███████╗██║ ██║╚██████╗██║ ██║███████║]],
[[╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝]]
},
{
[[ ,,,╓▄▄▓▓▓▓▄ ,▄▓∩]],
[[ ,╓▄▄▄▄▓▓▓▓▓▓▓▓▀▓▓▓▓▓▓▓▓▓▀▀▀▓@@æ▄╓,▄▄ ,▄▓▓▓▓ ]],
[[ ,▄▄▓▓█████▀╫╫Ñ▒Ñ▒▒▒▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒▀▀▀▓@#▓▓▀▓▓▓Ñ ]],
[[ -2▓╫▒▒▒▒▒╫▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▓▓▓ ]],
[[ ª╨╩Ñ▒▒▒▒▒╫▄▒▒▒▒▒▒▒░░▒▒▒▒▒▒▒▒▒░▒░░░░░░░═╨` `╫╫▓▓▓▓ ]],
[[ `ªº╩▒▒▒▒░░░░...░░▒▒▒▄▒▒▒ºª`` `▀▓▓▓ ]],
[[ ╙▓µ ]]
},
{
[[███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗]],
[[████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║]],
[[██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║]],
[[██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║]],
[[██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║]],
[[╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]]
}
}
local i = 3
math.randomseed(os.time())
if math.fmod(math.random(100), 5) == 0 then
if math.random(0, 1) == 0 then
i = 1
else
i = 2
end
end
return images[i]
end
-----------------
-- Configurtation
-----------------
return {
{
"goolord/alpha-nvim",
lazy = false,
config = function()
local dashboard = require("alpha.themes.dashboard")
dashboard.section.header.val = get_random_image()
dashboard.section.buttons.val = {
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
dashboard.button('r', ' Recent files', ':Telescope oldfiles <CR>'),
dashboard.button('f', '󰥨 Find file', ':Telescope find_files <CR>'),
dashboard.button('g', '󰱼 Find text', ':Telescope live_grep <CR>'),
dashboard.button('p', ' Open project', ':Telescope session-lens search_session<CR>'),
dashboard.button('l', '󰒲 Lazy', ':Lazy<CR>'),
dashboard.button('q', ' Quit', ':qa<CR>')
}
require("alpha").setup(dashboard.opts)
end
}
}