aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2024-03-15 13:14:13 -0600
committerJosh Rahm <rahm@google.com>2024-03-15 13:14:13 -0600
commit1e388bd875ecaccde8047dceab1b97ef54175334 (patch)
tree878e1fd50334a40a50dc54fbf2c120c37ced5373 /src/Rahm
parent8ddcf499ce97be0aa607677cbca52d810c969684 (diff)
downloadrde-1e388bd875ecaccde8047dceab1b97ef54175334.tar.gz
rde-1e388bd875ecaccde8047dceab1b97ef54175334.tar.bz2
rde-1e388bd875ecaccde8047dceab1b97ef54175334.zip
Fix firefox matching with window-specific bindings
Diffstat (limited to 'src/Rahm')
-rw-r--r--src/Rahm/Desktop/Keys.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index 3866937..57ca2e0 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -17,9 +17,9 @@ import Control.Monad.Writer
lift,
tell,
)
-import Data.Char (isAlpha)
+import Data.Char (isAlpha, toLower)
import Data.IORef
-import Data.List (foldl')
+import Data.List (foldl', isInfixOf)
import Data.List.Safe ((!!))
import Data.Map (Map)
import qualified Data.Map as Map
@@ -1350,7 +1350,7 @@ windowSpecificBindings config = do
rawMask (m .|. mod3Mask) $
emitKey (m .|. controlMask, xK_Page_Down)
- configureIf (flip elem browsers <$> className) $ do
+ configureIf ((\c -> any ($ c) browsers) <$> className) $ do
-- if the window is a browser, configure these bindings. Lots of browsers
-- make up their own garbage bindings that are not standard across many
-- other applications. This alleviates the issue.
@@ -1407,8 +1407,7 @@ windowSpecificBindings config = do
noMod $
emitKey (controlMask, xK_F2)
where
- browsers = ["Google-chrome", "Brave-browser", "firefox-default", "Firefox"]
- spotify = ["Spotify"]
+ browsers = [(=="Google-chrome"), (=="Brave-browser"), ("firefox"`isInfixOf`) . map toLower]
-- Create a permutation from a list of modifiers.
--