feat: add conditional rendering for dashboard sections based on Neovide
This commit is contained in:
@@ -31,45 +31,74 @@ return {
|
|||||||
keys = require('data.dash').dashboard_nvim.choices,
|
keys = require('data.dash').dashboard_nvim.choices,
|
||||||
header = read_file(require('data.dash').logo),
|
header = read_file(require('data.dash').logo),
|
||||||
},
|
},
|
||||||
sections = {
|
sections = function()
|
||||||
-- { section = 'header' },
|
if not require('data.func').is_neovide() then
|
||||||
{
|
return {
|
||||||
section = 'terminal',
|
-- { section = 'header' },
|
||||||
cmd = 'pokemon-colorscripts -n porygon-z --no-title',
|
{
|
||||||
padding = 0,
|
section = 'terminal',
|
||||||
height = 20,
|
cmd = 'pokemon-colorscripts -n porygon-z --no-title',
|
||||||
indent = 44,
|
padding = 0,
|
||||||
},
|
height = 20,
|
||||||
{ section = 'keys', gap = 1, padding = 1 },
|
indent = 44,
|
||||||
{
|
},
|
||||||
pane = 2,
|
{ section = 'keys', gap = 1, padding = 1 },
|
||||||
icon = ' ',
|
{
|
||||||
title = 'Recent Files',
|
pane = 2,
|
||||||
section = 'recent_files',
|
icon = ' ',
|
||||||
indent = 2,
|
title = 'Recent Files',
|
||||||
padding = { 2, 20 },
|
section = 'recent_files',
|
||||||
},
|
indent = 2,
|
||||||
{
|
padding = { 2, 20 },
|
||||||
pane = 2,
|
},
|
||||||
icon = ' ',
|
{
|
||||||
title = 'Projects',
|
pane = 2,
|
||||||
section = 'projects',
|
icon = ' ',
|
||||||
indent = 2,
|
title = 'Projects',
|
||||||
padding = 2,
|
section = 'projects',
|
||||||
},
|
indent = 2,
|
||||||
{
|
padding = 2,
|
||||||
pane = 2,
|
},
|
||||||
icon = ' ',
|
{
|
||||||
title = 'Git Status',
|
pane = 2,
|
||||||
section = 'terminal',
|
icon = ' ',
|
||||||
enabled = require('data.func').is_git_repo(),
|
title = 'Git Status',
|
||||||
cmd = 'hub status --short --branch --renames',
|
section = 'terminal',
|
||||||
padding = 2,
|
enabled = require('data.func').is_git_repo(),
|
||||||
indent = 3,
|
cmd = 'hub status --short --branch --renames',
|
||||||
ttl = 1 * 60, -- Time between git updates
|
padding = 2,
|
||||||
},
|
indent = 3,
|
||||||
{ section = 'startup' },
|
ttl = 1 * 60, -- Time between git updates
|
||||||
},
|
},
|
||||||
|
{ section = 'startup' },
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
section = 'header',
|
||||||
|
indent = 40,
|
||||||
|
},
|
||||||
|
{ section = 'keys', gap = 1, padding = 1 },
|
||||||
|
{
|
||||||
|
pane = 2,
|
||||||
|
icon = ' ',
|
||||||
|
title = 'Recent Files',
|
||||||
|
section = 'recent_files',
|
||||||
|
indent = 2,
|
||||||
|
padding = { 2, 20 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pane = 2,
|
||||||
|
icon = ' ',
|
||||||
|
title = 'Projects',
|
||||||
|
section = 'projects',
|
||||||
|
indent = 2,
|
||||||
|
padding = 2,
|
||||||
|
},
|
||||||
|
{ section = 'startup' },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user