diff options
author | nelhage <nelhage@mit.edu> | 2007-08-10 05:26:53 +0200 |
---|---|---|
committer | nelhage <nelhage@mit.edu> | 2007-08-10 05:26:53 +0200 |
commit | 3a4879f1010e5f705e8df409bc775954e539fa0d (patch) | |
tree | 0cda4333de306b30e5aa9a48880d783f4581648c /ViewPrev.hs | |
parent | 31ce9b7ef003e80dfba1b737956963a65d1374fe (diff) | |
download | XMonadContrib-3a4879f1010e5f705e8df409bc775954e539fa0d.tar.gz XMonadContrib-3a4879f1010e5f705e8df409bc775954e539fa0d.tar.xz XMonadContrib-3a4879f1010e5f705e8df409bc775954e539fa0d.zip |
ViewPrev.hs
Add a ViewPrev extension which gives a viewPrev command to view the
previously visible workspace.
darcs-hash:20070810032653-c0cde-7572ecce9b214674581d4c0643736b474988f769.gz
Diffstat (limited to 'ViewPrev.hs')
-rw-r--r-- | ViewPrev.hs | 28 |
1 files changed, 28 insertions, 0 deletions
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 <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' |