2024-05-03 10:46:09 -06:00
|
|
|
//go:build unix && (!darwin)
|
2024-05-06 21:25:25 -06:00
|
|
|
package registrar
|
2024-04-29 14:21:53 -06:00
|
|
|
|
2024-05-28 19:56:52 -06:00
|
|
|
import "os"
|
|
|
|
import "log"
|
2024-04-29 14:21:53 -06:00
|
|
|
import "git.tebibyte.media/tomo/x"
|
|
|
|
import "git.tebibyte.media/tomo/tomo"
|
2024-05-03 17:58:28 -06:00
|
|
|
import "git.tebibyte.media/tomo/nasin/internal/theme/default"
|
2024-05-28 19:56:52 -06:00
|
|
|
import "git.tebibyte.media/tomo/nasin/internal/theme/xdgicons"
|
2024-04-29 14:21:53 -06:00
|
|
|
|
2024-05-03 10:46:09 -06:00
|
|
|
func Init () error {
|
2024-05-28 19:56:52 -06:00
|
|
|
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)
|
2024-04-29 14:21:53 -06:00
|
|
|
tomo.Register(1, x.NewBackend)
|
2024-05-03 10:46:09 -06:00
|
|
|
return nil
|
2024-04-29 14:21:53 -06:00
|
|
|
}
|