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/Layout | |
| 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/Layout')
| -rw-r--r-- | src/Rahm/Desktop/Layout/PinWindow.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Rahm/Desktop/Layout/PinWindow.hs b/src/Rahm/Desktop/Layout/PinWindow.hs index f993eec..6ccf35a 100644 --- a/src/Rahm/Desktop/Layout/PinWindow.hs +++ b/src/Rahm/Desktop/Layout/PinWindow.hs @@ -22,6 +22,7 @@ import qualified Rahm.Desktop.StackSet as W import XMonad import qualified XMonad.StackSet as W (filter) import qualified XMonad.Util.ExtensibleState as XS +import Rahm.Desktop.BorderColors (setBorderColor, BorderColor (BorderColor), resetBorderColor) newtype PinWindowState = PinWindowState (Map ScreenId [(Window, W.RationalRect)]) deriving (Show, Read) @@ -36,6 +37,8 @@ instance ExtensionClass PinWindowState where newtype PinWindowLayout (l :: * -> *) (a :: *) = PinWindowLayout (l a) deriving (Show, Read) +pinnedWindowColor = BorderColor "#00ff00" "#408040" + instance (LayoutClass l a, sid ~ ScreenId, a ~ Window) => LayoutClass (PinWindowLayout l) a where runLayout (W.Workspace t (PinWindowLayout l) stack) rect = do -- Clean up window id's thare should not be pinned anymore because the @@ -100,6 +103,7 @@ pinWindow win = runMaybeT_ $ do -- Don't float the window anymore. modifyWindowSet $ W.sink win + setBorderColor pinnedWindowColor [win] where hoist = MaybeT . return @@ -115,6 +119,7 @@ unpinWindow win = runMaybeT_ $ do -- refloat the window. modifyWindowSet $ W.float win rect + resetBorderColor [win] where hoist = MaybeT . return |