[XMonad] Remove dynamic workspace naming
This commit is contained in:
parent
bc211078fc
commit
c02771714f
@ -365,7 +365,6 @@ myLayoutHook =
|
|||||||
mkToggle1 GAPS .
|
mkToggle1 GAPS .
|
||||||
mkToggle1 MAGICFOCUS .
|
mkToggle1 MAGICFOCUS .
|
||||||
mkToggle1 NBFULL .
|
mkToggle1 NBFULL .
|
||||||
workspaceNamesHook .
|
|
||||||
lessBorders Screen $ fst layoutInfo
|
lessBorders Screen $ fst layoutInfo
|
||||||
|
|
||||||
-- WindowBringer
|
-- WindowBringer
|
||||||
@ -456,35 +455,7 @@ myReplaceWindow =
|
|||||||
myWindowAct myWindowBringerConfig $
|
myWindowAct myWindowBringerConfig $
|
||||||
chromeTabAction True (windows . swapFocusedWith)
|
chromeTabAction True (windows . swapFocusedWith)
|
||||||
|
|
||||||
-- Dynamic Workspace Renaming
|
|
||||||
|
|
||||||
windowClassFontAwesomeFile =
|
|
||||||
fmap (</> ".lib/resources/window_class_to_fontawesome.json") getHomeDirectory
|
|
||||||
|
|
||||||
getClassRemap =
|
|
||||||
fmap (fromMaybe M.empty . decode) $
|
|
||||||
windowClassFontAwesomeFile >>= B.readFile
|
|
||||||
|
|
||||||
getClassRemapF = flip maybeRemap <$> getClassRemap
|
|
||||||
getWSClassNames' w = mapM getClass $ W.integrate' $ W.stack w
|
|
||||||
getWSClassNames w = io (fmap map getClassRemapF) <*> getWSClassNames' w
|
|
||||||
currentWSName ws = fromMaybe "" <$> (getWorkspaceNames' <$$> W.tag ws)
|
|
||||||
desiredWSName = (intercalate "|" <$>) . getWSClassNames
|
|
||||||
|
|
||||||
setWorkspaceNameToFocusedWindow workspace = do
|
|
||||||
currentName <- currentWSName workspace
|
|
||||||
newName <- desiredWSName workspace
|
|
||||||
when (currentName /= newName) $ setWorkspaceName (W.tag workspace) newName
|
|
||||||
|
|
||||||
setWorkspaceNames =
|
|
||||||
gets windowset >>= mapM_ setWorkspaceNameToFocusedWindow . W.workspaces
|
|
||||||
|
|
||||||
data WorkspaceNamesHook a = WorkspaceNamesHook deriving (Show, Read)
|
|
||||||
|
|
||||||
instance LayoutModifier WorkspaceNamesHook Window where
|
|
||||||
hook _ = setWorkspaceNames
|
|
||||||
|
|
||||||
workspaceNamesHook = ModifiedLayout WorkspaceNamesHook
|
|
||||||
|
|
||||||
-- Toggleable fade
|
-- Toggleable fade
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user