如何在XMonad中获取Stackset中Window的索引?

时间:2018-07-08 13:24:28

标签: xmonad

如何获取string.dumpWindow的索引?

我已经浏览了http://hackage.haskell.org/package/xmonad-0.13/docs/XMonad-StackSet.html,但找不到任何相关内容。

1 个答案:

答案 0 :(得分:0)

import qualified XMonad.StackSet as W
import XMonad.StackSet
import Data.List (elemIndex)


windowIndex :: Window -> StackSet i l Window s sd -> Maybe Int
windowIndex w s = elemIndex w $ allWindowsInCurrentWorkspace s


allWindowsInCurrentWorkspace :: W.StackSet i l a sid sd -> [a]
allWindowsInCurrentWorkspace ws =
  W.integrate' . W.stack . W.workspace . W.current $ ws