如何获取string.dump
中Window
的索引?
我已经浏览了http://hackage.haskell.org/package/xmonad-0.13/docs/XMonad-StackSet.html,但找不到任何相关内容。
答案 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