aboutsummaryrefslogtreecommitdiffstats
path: root/ViewPrev.hs
blob: 840dd85dd228a75e185ff25359c591f0056614ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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'