From c3d64ab185aabd7a82a24ac6f9963181b4c6db0d Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 9 Dec 2025 20:14:07 -0500 Subject: [PATCH] scrollwm: fix keybind provider registration --- core/internal/keybinds/providers/sway.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/core/internal/keybinds/providers/sway.go b/core/internal/keybinds/providers/sway.go index f2f817ce..26c341f4 100644 --- a/core/internal/keybinds/providers/sway.go +++ b/core/internal/keybinds/providers/sway.go @@ -15,16 +15,20 @@ type SwayProvider struct { func NewSwayProvider(configPath string) *SwayProvider { isScroll := false - _, ok := os.LookupEnv("SCROLLSOCK") - if ok { - isScroll = true - } + _, scrollEnvSet := os.LookupEnv("SCROLLSOCK") + if configPath == "" { - configPath = "$HOME/.config/sway" - } - if isScroll && configPath == "" { - configPath = "$HOME/.config/scroll" + if scrollEnvSet { + configPath = "$HOME/.config/scroll" + isScroll = true + } else { + configPath = "$HOME/.config/sway" + } + } else { + // Determine isScroll based on the provided config path + isScroll = strings.Contains(configPath, "scroll") } + return &SwayProvider{ configPath: configPath, isScroll: isScroll,