1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-12-04 14:46:37 -05:00

Merge pull request #38 from BreadMakesYouFat/nologo

Optionally hide splash and banner?
This commit is contained in:
mrusme 2023-06-25 14:56:07 -05:00 committed by GitHub
commit 3b0adfc6f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -45,6 +45,8 @@ type Config struct {
Browser string
RenderShadows bool
RenderImages bool
RenderSplash bool
RenderBanner bool
Systems []SystemConfig
@ -192,6 +194,8 @@ func SetDefaults(cacheDir string) {
viper.SetDefault("RenderShadows", "true")
viper.SetDefault("RenderImages", "true")
viper.SetDefault("RenderSplash", "true")
viper.SetDefault("RenderBanner", "true")
// --- Header ---
// Header Selector

View File

@ -111,6 +111,10 @@ func (m Model) View() string {
spinner = m.spinner.View()
}
if !m.ctx.Config.RenderBanner{
banner = ""
}
row = lipgloss.JoinHorizontal(lipgloss.Bottom,
banner,
" ",

View File

@ -33,6 +33,9 @@ func NewModel(c *ctx.Ctx) Model {
ctx: c,
pix: nil,
}
if !m.ctx.Config.RenderSplash {
return m
}
m.splashscreen, err = m.ctx.EmbedFS.ReadFile("splashscreen.png")
if err != nil {
@ -74,7 +77,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (m *Model) sleep() tea.Cmd {
return func() tea.Msg {
time.Sleep(time.Second * 5)
if m.ctx.Config.RenderSplash {
time.Sleep(time.Second * 5)
}
c := cmd.New(
cmd.ViewOpen,