mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
vanadium/xmonad: show current window count in pp
This commit is contained in:
parent
d3489e5730
commit
60bfd4f5c9
3 changed files with 15 additions and 35 deletions
|
|
@ -25,7 +25,6 @@ library
|
|||
hs-source-dirs: lib
|
||||
exposed-modules:
|
||||
XMonad.Layout.Reflect.Message
|
||||
XMonad.Layout.ResizableTile.FixDescription
|
||||
Data.Char.Greek
|
||||
|
||||
executable leanamonad
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
|
||||
|
||||
module XMonad.Layout.ResizableTile.FixDescription
|
||||
( RTFixDescription(..)
|
||||
) where
|
||||
|
||||
import XMonad
|
||||
import qualified XMonad.StackSet as W
|
||||
import XMonad.Layout.ResizableTile
|
||||
|
||||
newtype RTFixDescription a = RTFixDescription { unwrapRT :: ResizableTall a }
|
||||
deriving (Read, Show)
|
||||
|
||||
instance LayoutClass RTFixDescription a where
|
||||
runLayout (W.Workspace t l s) =
|
||||
let ws' = W.Workspace t (unwrapRT l) s
|
||||
in (fmap . fmap . fmap) RTFixDescription . runLayout ws'
|
||||
|
||||
handleMessage (RTFixDescription l) =
|
||||
(fmap . fmap) RTFixDescription . handleMessage l
|
||||
|
||||
description (RTFixDescription l) =
|
||||
description l <> " " <> show (_nmaster l)
|
||||
|
|
@ -19,7 +19,6 @@ import XMonad.Layout.Reflect
|
|||
import XMonad.Layout.Reflect.Message
|
||||
import XMonad.Layout.Renamed
|
||||
import XMonad.Layout.ResizableTile
|
||||
import XMonad.Layout.ResizableTile.FixDescription
|
||||
import XMonad.Layout.Spacing
|
||||
import qualified XMonad.StackSet as W
|
||||
import XMonad.Util.EZConfig
|
||||
|
|
@ -64,10 +63,9 @@ main =
|
|||
`additionalKeys` keybinds
|
||||
|
||||
myLayout =
|
||||
let tallr = renamed [ KeepWordsRight 2 ] {- keep "ResizableTall n" -}
|
||||
let tallr = renamed [ Replace "Tall" ]
|
||||
$ smartSpacingWithEdge 5
|
||||
$ reflectMsg . reflectHoriz
|
||||
$ RTFixDescription
|
||||
$ ResizableTall 1 (1/10) (3/7) []
|
||||
mag = magnifyxy 1.05 1.3 (NoMaster 3) False
|
||||
in avoidStruts
|
||||
|
|
@ -332,15 +330,21 @@ fullFloat = W.RationalRect 0 0 1 1
|
|||
buttomRightFloat = W.RationalRect (1%2) (1%2) (1%2) (1%2)
|
||||
|
||||
xmobarConfig :: StatusBarConfig
|
||||
xmobarConfig = statusBarProp "xmobar -x 0" (pure myPrettyPrinter)
|
||||
xmobarConfig = statusBarProp "xmobar -x 0" myPrettyPrinter
|
||||
where
|
||||
myPrettyPrinter =
|
||||
filterOutWsPP [scratchpadWorkspaceTag]
|
||||
$ def
|
||||
{ ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " " . fmap toUpper
|
||||
, ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅"
|
||||
, ppSep = " | "
|
||||
}
|
||||
windowCount :: X Int
|
||||
windowCount = gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset
|
||||
|
||||
myPrettyPrinter :: X PP
|
||||
myPrettyPrinter = do
|
||||
wCount <- windowCount
|
||||
pure
|
||||
$ filterOutWsPP [scratchpadWorkspaceTag]
|
||||
$ def
|
||||
{ ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " " . ( <> ":" <> show wCount)
|
||||
, ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅"
|
||||
, ppSep = " | "
|
||||
}
|
||||
|
||||
myScratchpads :: [NamedScratchpad]
|
||||
myScratchpads =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue