mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-14 11:45:54 -07:00
ViewPrev.hs
Add a ViewPrev extension which gives a viewPrev command to view the previously visible workspace.
This commit is contained in:
28
ViewPrev.hs
Normal file
28
ViewPrev.hs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
-----------------------------------------------------------------------------
|
||||||
|
-- |
|
||||||
|
-- Module : XMonadContrib.ViewPrev
|
||||||
|
-- Copyright : (c) Nelson Elhage <nelhage@mit.edu>
|
||||||
|
-- License : BSD3-style (see LICENSE)
|
||||||
|
--
|
||||||
|
-- Maintainer : Nelson Elhage <nelhage@mit.edu>
|
||||||
|
-- Stability : unstable
|
||||||
|
-- Portability : unportable
|
||||||
|
--
|
||||||
|
-- A module that implements a command to switch to the previously
|
||||||
|
-- viewed workspace
|
||||||
|
--
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
module XMonadContrib.ViewPrev (
|
||||||
|
viewPrev
|
||||||
|
) where
|
||||||
|
|
||||||
|
import XMonad
|
||||||
|
import Operations
|
||||||
|
import qualified StackSet as W
|
||||||
|
|
||||||
|
viewPrev' :: (Eq a, Eq s, Eq i) => W.StackSet i a s sd -> W.StackSet i a s sd
|
||||||
|
viewPrev' x = W.view (W.tag . head . W.hidden $ x) x
|
||||||
|
|
||||||
|
viewPrev :: X ()
|
||||||
|
viewPrev = windows viewPrev'
|
Reference in New Issue
Block a user