From 4fd7572c12c9cdc2e034fd9cbaf1423d40153081 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 3 Aug 2022 14:00:30 -0600 Subject: Add new conditional description for workspaces. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the "<" condition, it used as "in" i.e. " doFullFloat + , doLogWindow , className =? "Tilda" --> doFloat , className =? "yakuake" --> doFloat , className =? "MPlayer" --> doFloat @@ -72,7 +75,10 @@ main = do composeAll [ fullscreenEventHook, remapHook, - swallowHook] + swallowHook, + dynamicTitle (composeAll [ + title =? "Spotify" --> doMarkWindow "s" + ])] , focusFollowsMouse = False , clickJustFocuses = False , logHook = xMobarLogHook xmobar @@ -83,6 +89,19 @@ changeHook :: Location -> Location -> X () changeHook l1 l2 = logs Info "Change %s -> %s" (show l1) (show l2) +doLogWindow :: ManageHook +doLogWindow = do + t <- title + c <- className + a <- appName + liftX $ logs Debug "New Window {title: \"%s\", class: \"%s\", appName: \"%s\"}" t c a + return (Endo id) + +doMarkWindow :: Mark -> ManageHook +doMarkWindow m = ask >>= (\w -> liftX (do + ws <- getCurrentWorkspace + markAllLocations m [Location ws (Just w)]) >> return (Endo id)) + doCenterFloat :: ManageHook doCenterFloat = ask >>= \w -> doF . W.float w . centerRect . snd =<< liftX (floatLocation w) -- cgit