Renormalized + itronb adjustments

This commit is contained in:
Lüdecke Sascha
2026-03-23 15:09:06 +01:00
parent 2b47d7a9cd
commit fd5c73f099
25 changed files with 2143 additions and 2102 deletions

View File

@@ -1,109 +1,116 @@
local alpha = require 'alpha'
local dashboard = require 'alpha.themes.dashboard'
_Gopts = {
position = 'center',
hl = 'Type',
wrap = 'overflow',
}
-- DASHBOARD HEADER
local function getGreeting()
local tableTime = os.date '*t'
local datetime = os.date ' %Y-%m-%d-%A  %H:%M:%S '
local hour = tableTime.hour
local greetingsTable = {
[1] = ' Sleep well',
[2] = ' Good morning',
[3] = ' Good afternoon',
[4] = ' Good evening',
[5] = '󰖔 Good night',
}
local greetingIndex = 0
if hour == 23 or hour < 7 then
greetingIndex = 1
elseif hour < 12 then
greetingIndex = 2
elseif hour >= 12 and hour < 18 then
greetingIndex = 3
elseif hour >= 18 and hour < 21 then
greetingIndex = 4
elseif hour >= 21 then
greetingIndex = 5
end
return datetime .. ' ' .. greetingsTable[greetingIndex]
end
local logo = [[

████ ██████ █████ ██
███████████ █████ 
█████████ ███████████████████ ███ ███████████
█████████ ███ █████████████ █████ ██████████████
█████████ ██████████ █████████ █████ █████ ████ █████
███████████ ███ ███ █████████ █████ █████ ████ █████
██████ █████████████████████ ████ █████ █████ ████ ██████
]]
local greeting = getGreeting()
local marginBottom = 0
-- Split logo into lines
local logoWidth = 0
for line in logo:gmatch '[^\n]+' do
logoWidth = math.max(logoWidth, #line / 2)
end
logoWidth = 75 -- code above does not work with utf8 strings in lua 5.1
-- Calculate padding for centering the greeting
local greetingWidth = #greeting - 3
local padding = math.floor((logoWidth - greetingWidth) / 2)
-- Generate spaces for padding
local paddedGreeting = string.rep(' ', padding) .. greeting
local userName = "You work as '" .. vim.env.USER .. "'."
-- Calculate padding for centering the username
local userNameWidth = #userName
local padding = math.floor((logoWidth - userNameWidth) / 2)
-- Generate spaces for padding
local userNamePadded = string.rep(' ', padding) .. userName
-- Add margin lines below the padded greeting
local margin = string.rep('\n', marginBottom * 5)
-- Concatenate logo, padded greeting, and margin
local adjustedLogo = logo .. '\n' .. paddedGreeting .. '\n\n' .. userNamePadded .. '\n' .. margin
dashboard.section.header.val = vim.split(adjustedLogo, '\n')
dashboard.section.buttons.val = {
dashboard.button('d', ' Diary Entry', '<cmd>Diary<CR>'),
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'),
dashboard.button('u', '󱐥 Update plugins', '<cmd>Lazy update<CR>'),
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
dashboard.button('q', '󰤆 Quit', '<cmd>qa<CR>'),
}
-- dashboard.section.footer.val = greeting
vim.api.nvim_create_autocmd('User', {
pattern = 'LazyVimStarted',
desc = 'Add Alpha dashboard footer',
once = true,
callback = function()
local stats = require('lazy').stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
dashboard.section.footer.val = { ' ', ' ', ' ', ' Loaded ' .. stats.count .. ' plugins  in ' .. ms .. ' ms ' }
dashboard.section.header.opts.hl = 'DashboardFooter'
pcall(vim.cmd.AlphaRedraw)
end,
})
dashboard.opts.opts.noautocmd = true
alpha.setup(dashboard.opts)
local alpha = require 'alpha'
local dashboard = require 'alpha.themes.dashboard'
_Gopts = {
position = 'center',
hl = 'Type',
wrap = 'overflow',
}
-- DASHBOARD HEADER
local function getGreeting()
local tableTime = os.date '*t'
local datetime = os.date ' %Y-%m-%d-%A  %H:%M:%S '
local hour = tableTime.hour
local greetingsTable = {
[1] = ' Sleep well',
[2] = ' Good morning',
[3] = ' Good afternoon',
[4] = ' Good evening',
[5] = '󰖔 Good night',
}
local greetingIndex = 0
if hour == 23 or hour < 7 then
greetingIndex = 1
elseif hour < 12 then
greetingIndex = 2
elseif hour >= 12 and hour < 18 then
greetingIndex = 3
elseif hour >= 18 and hour < 21 then
greetingIndex = 4
elseif hour >= 21 then
greetingIndex = 5
end
return datetime .. ' ' .. greetingsTable[greetingIndex]
end
local logo = [[

████ ██████ █████ ██
███████████ █████ 
█████████ ███████████████████ ███ ███████████
█████████ ███ █████████████ █████ ██████████████
█████████ ██████████ █████████ █████ █████ ████ █████
███████████ ███ ███ █████████ █████ █████ ████ █████
██████ █████████████████████ ████ █████ █████ ████ ██████
]]
local greeting = getGreeting()
local marginBottom = 0
-- Split logo into lines
local logoWidth = 0
for line in logo:gmatch '[^\n]+' do
logoWidth = math.max(logoWidth, #line / 2)
end
logoWidth = 75 -- code above does not work with utf8 strings in lua 5.1
-- Calculate padding for centering the greeting
local greetingWidth = #greeting - 3
local padding = math.floor((logoWidth - greetingWidth) / 2)
-- Generate spaces for padding
local paddedGreeting = string.rep(' ', padding) .. greeting
local userName = "You work as '" .. (vim.env.USER or vim.env.USERNAME) .. "'."
-- Calculate padding for centering the username
local userNameWidth = #userName
local padding = math.floor((logoWidth - userNameWidth) / 2)
-- Generate spaces for padding
local userNamePadded = string.rep(' ', padding) .. userName
-- Add margin lines below the padded greeting
local margin = string.rep('\n', marginBottom * 5)
-- Concatenate logo, padded greeting, and margin
local adjustedLogo = logo .. '\n' .. paddedGreeting .. '\n\n' .. userNamePadded .. '\n' .. margin
dashboard.section.header.val = vim.split(adjustedLogo, '\n')
local buttons = {
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
dashboard.button('s', ' Settings', '<cmd>WorkspacesOpen config-nvim<CR>'),
dashboard.button('t', '[] Todo List', '<cmd>Org agenda t<CR>'),
dashboard.button('u', '󱐥 Update plugins', '<cmd>Lazy update<CR>'),
dashboard.button('w', ' Workspaces', '<cmd>WorkspacesOpen<CR>'),
dashboard.button('q', '󰤆 Quit', '<cmd>qa<CR>'),
}
if vim.loop.os_gethostname() == 'ccflow' then
table.insert(buttons, 1,
dashboard.button('d', ' Diary Entry', '<cmd>Diary<CR>'))
end
dashboard.section.buttons.val = buttons
-- dashboard.section.footer.val = greeting
vim.api.nvim_create_autocmd('User', {
pattern = 'LazyVimStarted',
desc = 'Add Alpha dashboard footer',
once = true,
callback = function()
local stats = require('lazy').stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
dashboard.section.footer.val = { ' ', ' ', ' ', ' Loaded ' .. stats.count .. ' plugins  in ' .. ms .. ' ms ' }
dashboard.section.header.opts.hl = 'DashboardFooter'
pcall(vim.cmd.AlphaRedraw)
end,
})
dashboard.opts.opts.noautocmd = true
alpha.setup(dashboard.opts)

View File

@@ -1,41 +1,41 @@
require("lualine").setup {
options = {
icons_enabled = false,
theme = 'papercolor_light',
component_separators = {},
section_separators = {},
disabled_filetypes = {
statusline = {},
winbar = { "neo-tree" },
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = {},
lualine_x = { 'encoding', 'fileformat', 'filetype', 'lsp_status' },
lualine_y = { 'filesize' },
lualine_z = { 'progress', 'location' }
},
inactive_sections = {
lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
lualine_b = {},
lualine_c = {},
-- lualine_x = { 'encoding', 'fileformat', 'filetype' },
lualine_x = {},
lualine_y = { 'filesize' },
lualine_z = { 'location' }
},
tabline = {},
winbar = {}, -- formerly breadcrumb here
inactive_winbar = {},
extensions = {}
}
require("lualine").setup {
options = {
icons_enabled = false,
theme = 'papercolor_light',
component_separators = {},
section_separators = {},
disabled_filetypes = {
statusline = {},
winbar = { "neo-tree" },
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = {},
lualine_x = { 'encoding', 'fileformat', 'filetype', 'lsp_status' },
lualine_y = { 'filesize' },
lualine_z = { 'progress', 'location' }
},
inactive_sections = {
lualine_a = { { 'filename', path = 1, shorting_target = 50 } },
lualine_b = {},
lualine_c = {},
-- lualine_x = { 'encoding', 'fileformat', 'filetype' },
lualine_x = {},
lualine_y = { 'filesize' },
lualine_z = { 'location' }
},
tabline = {},
winbar = {}, -- formerly breadcrumb here
inactive_winbar = {},
extensions = {}
}