diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2023-12-09 00:40:01 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2023-12-09 00:43:01 -0700 |
| commit | 7fcb150943032880abd5a0be6421a68b9cf234a5 (patch) | |
| tree | e962d37efd6f67c1c9af194ccdbae48b967eff9a /src/Rahm/Desktop/Keys | |
| parent | 04a1fd2e2f2eaa9878c4bc67351784d6685ca22b (diff) | |
| download | rde-7fcb150943032880abd5a0be6421a68b9cf234a5.tar.gz rde-7fcb150943032880abd5a0be6421a68b9cf234a5.tar.bz2 rde-7fcb150943032880abd5a0be6421a68b9cf234a5.zip | |
Added BorderColors.hs
This module manager border colors for the windows and handles
automatically maintaining the colors across stack changes.
This also adds green borders to pinned windows to differentiate them
from normal windows.
Diffstat (limited to 'src/Rahm/Desktop/Keys')
| -rw-r--r-- | src/Rahm/Desktop/Keys/Wml.hs | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs index 6555312..def3b27 100644 --- a/src/Rahm/Desktop/Keys/Wml.hs +++ b/src/Rahm/Desktop/Keys/Wml.hs @@ -43,7 +43,6 @@ module Rahm.Desktop.Keys.Wml locationSetForKeys, readNextWorkspaceName, workspaceName, - wmlLogHook, ) where @@ -79,7 +78,6 @@ import Rahm.Desktop.Common getCurrentWorkspace, gotoWorkspace, moveLocationToWorkspace, - setBorderColor, windowsInWorkspace, ) import Rahm.Desktop.History @@ -145,6 +143,7 @@ import XMonad import XMonad.Prompt.ConfirmPrompt (confirmPrompt) import qualified XMonad.Util.ExtensibleState as XS (get, modify, put) import Prelude hiding (head, last) +import Rahm.Desktop.BorderColors (setBorderColor, BorderColor (BorderColor)) type KeyString = [(KeyMask, KeySym, String)] @@ -184,9 +183,8 @@ saveMacros = do macros <- getMacros io $ writeFile dataFile $ show macros -selColor = "#b8b880" -selFocusColor = "#ffff00" +selColor = BorderColor "#ffff00" "#b8b880" insertWorkspaceMacroString :: (KeyMask, KeySym) -> KeyString -> X () insertWorkspaceMacroString k ks = do @@ -221,15 +219,7 @@ toggleWindowInSelection win = do (WindowSelect sel) <- XS.get case Map.lookup win sel of Nothing -> do - foc <- withWindowSet (return . W.peek) - - cleanup <- - setBorderColor - ( if Just win == foc - then selFocusColor - else selColor - ) - [win] + cleanup <- setBorderColor selColor [win] XS.put $ WindowSelect $ Map.insert win cleanup sel (Just cleanup) -> do @@ -243,13 +233,7 @@ addWindowToSelection win = do Nothing -> do foc <- withWindowSet (return . W.peek) - cleanup <- - setBorderColor - ( if Just win == foc - then selFocusColor - else selColor - ) - [win] + cleanup <- setBorderColor selColor [win] XS.put $ WindowSelect $ Map.insert win cleanup sel _ -> return () @@ -711,11 +695,3 @@ readNextLocationSet' = where mt :: (KeyFeeder m) => X a -> MaybeT m a mt = lift . fromX - -wmlLogHook :: X () -wmlLogHook = do - -- Reset the border colors for the selected window. - (WindowSelect (Map.keys -> sel)) <- XS.get - foc <- (withWindowSet (return . fromMaybe (0 :: Window) . W.peek) :: X Window) - void $ setBorderColor selColor (filter (/= foc) sel) - mapM_ (setBorderColor selFocusColor . (: [])) (find (== foc) sel) |