From 046556cce3f6d79f47e8a599447d5def7601d966 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 12 Jun 2024 00:27:34 -0400 Subject: [PATCH] Update registrar --- application.go | 8 +++++--- internal/registrar/registrar_unix.go | 10 +++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/application.go b/application.go index 6a6debd..4ed417c 100644 --- a/application.go +++ b/application.go @@ -105,10 +105,12 @@ func (role ApplicationRole) Icon () tomo.Icon { // RunApplication is like tomo.Run, but runs an application. If something fails // to initialize, an error is written to the standard logger. func RunApplication (application Application) { - err := registrar.Init() - if err != nil { log.Fatal("nasin: could not init registry:", err) } + err := registrar.RegisterBackend() + if err != nil { log.Fatal("nasin: could not register backend:", err) } err = tomo.Run(func () { - err := application.Init() + err := registrar.SetTheme() + if err != nil { log.Fatal("nasin: could not set theme:", err) } + err = application.Init() if err != nil { log.Fatal("nasin: could not run application:", err) } }) if err != nil { log.Fatal("nasin: could not run application:", err) } diff --git a/internal/registrar/registrar_unix.go b/internal/registrar/registrar_unix.go index ee9a8ea..c0b572b 100644 --- a/internal/registrar/registrar_unix.go +++ b/internal/registrar/registrar_unix.go @@ -11,7 +11,12 @@ import "git.tebibyte.media/tomo/nasin/internal/icons/fallback" import "git.tebibyte.media/tomo/nasin/internal/style/fallback" import "git.tebibyte.media/tomo/nasin/internal/style/aluminum" -func Init () error { +func RegisterBackend () error { + tomo.Register(1, x.New) + return nil +} + +func SetTheme () error { var styl *style.Style // TODO eventually get rid of this when we make a file format for // storing visual styles @@ -34,6 +39,5 @@ func Init () error { tomo.SetStyle(styl) tomo.SetIcons(icons) - tomo.Register(1, x.New) - return nil + return nil }