From 7fcb150943032880abd5a0be6421a68b9cf234a5 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 9 Dec 2023 00:40:01 -0700 Subject: 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. --- src/Main.hs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index 507bd43..f1938a6 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -2,7 +2,9 @@ import Control.Monad.Reader ( MonadReader (ask), ReaderT (runReaderT), ) +import Data.List (isPrefixOf) import Data.Monoid (Endo (Endo)) +import qualified Rahm.Desktop.BorderColors import Rahm.Desktop.Common ( Location (Location), getCurrentWorkspace, @@ -45,6 +47,7 @@ import XMonad terminal, workspaces ), + XState (dragging), appName, className, composeAll, @@ -53,11 +56,14 @@ import XMonad floatLocation, liftX, mod3Mask, + modify, + mouseDrag, + refresh, spawn, title, withWindowSet, (-->), - (=?), mouseDrag, refresh, modify, XState (dragging), + (=?), ) import qualified XMonad as X (xmonad) import XMonad.Hooks.DynamicProperty (dynamicTitle) @@ -65,8 +71,6 @@ import XMonad.Hooks.EwmhDesktops (ewmh) import XMonad.Hooks.ManageDocks (docks) import XMonad.Hooks.ManageHelpers (doFullFloat, isFullscreen) import XMonad.Layout.Fullscreen (fullscreenEventHook) -import Data.List (isPrefixOf) -import Rahm.Desktop.Keys.Wml (wmlLogHook) main = do logHook <- xMobarLogHook @@ -83,8 +87,13 @@ main = do (=<<) X.xmonad $ applyKeys $ - withStackChangeHook historyHook $ - ewmh $ + withStackChangeHook + ( mconcat + [ historyHook, + Rahm.Desktop.BorderColors.stackChangeHook + ] + ) + $ ewmh $ docks $ def { terminal = "alacritty", @@ -129,7 +138,7 @@ main = do ], focusFollowsMouse = False, clickJustFocuses = False, - logHook = wmlLogHook >> logHook xmobar + logHook = logHook xmobar } -- Should the chrome window float? Returns false if the window's title starts -- cgit