XDG icon themes can be loaded by setting $TOMO_XDG_ICON_THEME
This commit is contained in:
parent
7d9d93fa3f
commit
072eaa6029
@ -1,12 +1,27 @@
|
||||
//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 {
|
||||
tomo.SetTheme(defaultTheme.Theme())
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user