Skip to content

Commit 2213b2b

Browse files
gwuen4e554c4c
authored andcommitted
fix: treat color-scheme of value 0 (no preference) as light mode
Some environments (including GNOME) only expose the values of `0` (no preference) and `1` (prefer dark) in the settings. Currently, the plugin only handles values of `1` and `2`, with `0` leading to an error. This is fixed by treating `0` as light mode. Fixes #6
1 parent 300b441 commit 2213b2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
const (
12-
UNKNOWN = iota
12+
NO_PREFERENCE = iota
1313
DARK
1414
LIGHT
1515
UNINITIALIZED
@@ -43,7 +43,7 @@ func (args *setupArgs) handleNewMode() error {
4343
if args.Colorscheme != nil {
4444
colorscheme = args.Colorscheme.Dark
4545
}
46-
case LIGHT:
46+
case LIGHT, NO_PREFERENCE:
4747
background, event = "light", "LightMode"
4848
if args.Colorscheme != nil {
4949
colorscheme = args.Colorscheme.Light

0 commit comments

Comments
 (0)