nasin/internal/registrar/registrar_unix.go

28 lines
677 B
Go

//go:build unix && (!darwin)
package registrar
import "os"
import "log"
import "git.tebibyte.media/tomo/x"
import "git.tebibyte.media/tomo/tomo"
import "git.tebibyte.media/tomo/nasin/internal/theme/default"
import "git.tebibyte.media/tomo/nasin/internal/theme/xdgicons"
func Init () error {
theme := defaultTheme.Theme()
iconThemeName := os.Getenv("TOMO_XDG_ICON_THEME")
if iconThemeName != "" {
iconTheme, err := xdgIcons.FindThemeWarn(iconThemeName)
if err == nil {
theme.IconTheme = iconTheme
} else {
log.Printf("nasin: could not load icon theme '%s': %v", iconThemeName, err)
}
}
tomo.SetTheme(theme)
tomo.Register(1, x.NewBackend)
return nil
}