mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39: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
|
hs-source-dirs: lib
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
XMonad.Layout.Reflect.Message
|
XMonad.Layout.Reflect.Message
|
||||||
XMonad.Layout.ResizableTile.FixDescription
|
|
||||||
Data.Char.Greek
|
Data.Char.Greek
|
||||||
|
|
||||||
executable leanamonad
|
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.Reflect.Message
|
||||||
import XMonad.Layout.Renamed
|
import XMonad.Layout.Renamed
|
||||||
import XMonad.Layout.ResizableTile
|
import XMonad.Layout.ResizableTile
|
||||||
import XMonad.Layout.ResizableTile.FixDescription
|
|
||||||
import XMonad.Layout.Spacing
|
import XMonad.Layout.Spacing
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
|
|
@ -64,10 +63,9 @@ main =
|
||||||
`additionalKeys` keybinds
|
`additionalKeys` keybinds
|
||||||
|
|
||||||
myLayout =
|
myLayout =
|
||||||
let tallr = renamed [ KeepWordsRight 2 ] {- keep "ResizableTall n" -}
|
let tallr = renamed [ Replace "Tall" ]
|
||||||
$ smartSpacingWithEdge 5
|
$ smartSpacingWithEdge 5
|
||||||
$ reflectMsg . reflectHoriz
|
$ reflectMsg . reflectHoriz
|
||||||
$ RTFixDescription
|
|
||||||
$ ResizableTall 1 (1/10) (3/7) []
|
$ ResizableTall 1 (1/10) (3/7) []
|
||||||
mag = magnifyxy 1.05 1.3 (NoMaster 3) False
|
mag = magnifyxy 1.05 1.3 (NoMaster 3) False
|
||||||
in avoidStruts
|
in avoidStruts
|
||||||
|
|
@ -332,12 +330,18 @@ fullFloat = W.RationalRect 0 0 1 1
|
||||||
buttomRightFloat = W.RationalRect (1%2) (1%2) (1%2) (1%2)
|
buttomRightFloat = W.RationalRect (1%2) (1%2) (1%2) (1%2)
|
||||||
|
|
||||||
xmobarConfig :: StatusBarConfig
|
xmobarConfig :: StatusBarConfig
|
||||||
xmobarConfig = statusBarProp "xmobar -x 0" (pure myPrettyPrinter)
|
xmobarConfig = statusBarProp "xmobar -x 0" myPrettyPrinter
|
||||||
where
|
where
|
||||||
myPrettyPrinter =
|
windowCount :: X Int
|
||||||
filterOutWsPP [scratchpadWorkspaceTag]
|
windowCount = gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset
|
||||||
|
|
||||||
|
myPrettyPrinter :: X PP
|
||||||
|
myPrettyPrinter = do
|
||||||
|
wCount <- windowCount
|
||||||
|
pure
|
||||||
|
$ filterOutWsPP [scratchpadWorkspaceTag]
|
||||||
$ def
|
$ def
|
||||||
{ ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " " . fmap toUpper
|
{ ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " " . ( <> ":" <> show wCount)
|
||||||
, ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅"
|
, ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅"
|
||||||
, ppSep = " | "
|
, ppSep = " | "
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue