From 3a4879f1010e5f705e8df409bc775954e539fa0d Mon Sep 17 00:00:00 2001 From: nelhage Date: Fri, 10 Aug 2007 05:26:53 +0200 Subject: ViewPrev.hs Add a ViewPrev extension which gives a viewPrev command to view the previously visible workspace. darcs-hash:20070810032653-c0cde-7572ecce9b214674581d4c0643736b474988f769.gz --- ViewPrev.hs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ViewPrev.hs (limited to 'ViewPrev.hs') diff --git a/ViewPrev.hs b/ViewPrev.hs new file mode 100644 index 0000000..840dd85 --- /dev/null +++ b/ViewPrev.hs @@ -0,0 +1,28 @@ +----------------------------------------------------------------------------- +-- | +-- Module : XMonadContrib.ViewPrev +-- Copyright : (c) Nelson Elhage +-- License : BSD3-style (see LICENSE) +-- +-- Maintainer : Nelson Elhage +-- 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' -- cgit v1.2.3