xmonad-contrib-0.18.1: Community-maintained extensions for xmonad

Copyright | (c) Peter De Wachter and Andrea Rossato 2007
License | BSD-style (see xmonad/LICENSE)
Maintainer | andrea.rossato@unibz.it
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Layout.Magnifier

Contents

- Usage
- General combinators
- Magnify Everything
- Don't Magnify the Master Window
- Messages and Types

Description

This is a layout modifier that will make a layout change the size of the window that has focus.

Example screenshot using `magnifiercz' 1.3` with one of the two stack windows focused.

Synopsis

- magnify :: Rational -> MagnifyThis -> Bool -> l a -> ModifiedLayout Magnifier l a
- magnifyxy :: Rational -> Rational -> MagnifyThis -> Bool -> l a -> ModifiedLayout Magnifier l a
- magnifier :: l a -> ModifiedLayout Magnifier l a
- magnifierOff :: l a -> ModifiedLayout Magnifier l a
- magnifiercz :: Rational -> l a -> ModifiedLayout Magnifier l a
- magnifierczOff :: Rational -> l a -> ModifiedLayout Magnifier l a
- magnifierxy :: Rational -> Rational -> l a -> ModifiedLayout Magnifier l a
- magnifierxyOff :: Rational -> Rational -> l a -> ModifiedLayout Magnifier l a
- maxMagnifierOff :: l a -> ModifiedLayout Magnifier l a
- maximizeVertical :: l a -> ModifiedLayout Magnifier l a
- magnifier' :: l a -> ModifiedLayout Magnifier l a
- magnifiercz' :: Rational -> l a -> ModifiedLayout Magnifier l a
- magnifierczOff' :: Rational -> l a -> ModifiedLayout Magnifier l a
- magnifierxy' :: Rational -> Rational -> l a -> ModifiedLayout Magnifier l a
- magnifierxyOff' :: Rational -> Rational -> l a -> ModifiedLayout Magnifier l a
- data MagnifyMsg
  - = MagnifyMore
  - | MagnifyLess
  - | ToggleOn
  - | ToggleOff
  - | Toggle
- data MagnifyThis
  - = AllWins !Natural
  - | NoMaster !Natural
- data Magnifier a

# Usage

You can use this module with the following in your `xmonad.hs`:

    import XMonad.Layout.Magnifier

Then edit your `layoutHook` by e.g. adding the `magnifier` layout modifier to some layout:

    myLayout = magnifier (Tall 1 (3/100) (1/2))  ||| Full ||| etc..
    main = xmonad def { layoutHook = myLayout }

By default `magnifier` increases the focused window's size by `1.5`.

You can also use ``magnifiercz` 1.2` or ``magnifierxy` 1 1000` to use a custom level of magnification. You can even make the focused window smaller for a pop in effect. There's also the possibility of starting out not magnifying anything at all (`magnifierOff`); see below for ways to toggle this on while in use.

The most general combinator available is `magnify`—all of the other functions in this module are essentially just creative applications of it.

For more detailed instructions on editing the layoutHook see the tutorial and XMonad.Doc.Extending.

Magnifier supports some commands, see `MagnifyMsg`. To use them add something like this to your key bindings:

       , ((modm .|. controlMask              , xK_plus ), sendMessage MagnifyMore)
       , ((modm .|. controlMask              , xK_minus), sendMessage MagnifyLess)
       , ((modm .|. controlMask              , xK_o    ), sendMessage ToggleOff  )
       , ((modm .|. controlMask .|. shiftMask, xK_o    ), sendMessage ToggleOn   )
       , ((modm .|. controlMask              , xK_m    ), sendMessage Toggle     )

Note that a few other extension modules, such as XMonad.Layout.MultiToggle and XMonad.Layout.ToggleLayouts, also define a message named `Toggle`. To avoid conflicts when using these modules together, you can import Magnifier qualified, like this:

    import qualified XMonad.Layout.Magnifier as Mag

and then prefix `Mag` to the front of everything from this module, like `Mag.Toggle`, `Mag.magnifier`, and so on.

For detailed instruction on editing the key binding see the tutorial.

# General combinators

magnify Source #

Arguments

:: Rational | Amount to magnify both directions
-> MagnifyThis | What to magnify
-> Bool | Whether magnification should start out on (`True`) or off (`False`)
-> l a | Input layout
-> ModifiedLayout Magnifier l a |

Add magnification capabilities to a certain layout.

For example, to re-create `magnifiercz` 1.3', you would do

    >>> magnify 1.3 (NoMaster 1) True

magnifyxy Source #

Arguments

:: Rational | Amount to magnify horizontally
-> Rational | Amount to magnify vertically
-> MagnifyThis | What to magnify
-> Bool | Whether magnification should start out on (`True`) or off (`False`)
-> l a | Input layout
-> ModifiedLayout Magnifier l a |

Like `magnify`, but with the ability to specify different amounts of horizontal and vertical magnification.

    >>> magnifyxy 1.3 1.6 (NoMaster 1) True

# Magnify Everything

magnifier :: l a -> ModifiedLayout Magnifier l a Source #

Increase the size of the window that has focus

magnifierOff :: l a -> ModifiedLayout Magnifier l a Source #

Magnifier that defaults to Off

magnifiercz :: Rational -> l a -> ModifiedLayout Magnifier l a Source #

Change the size of the window that has focus by a custom zoom

magnifierczOff :: Rational -> l a -> ModifiedLayout Magnifier l a Source #

Like `magnifiercz`, but default to `Off`.

magnifierxy :: Rational -> Rational -> l a -> ModifiedLayout Magnifier l a Source #

Increase the size of the window that has focus by a custom zoom in both directions.

magnifierxyOff :: Rational -> Rational -> l a -> ModifiedLayout Magnifier l a Source #

Like `magnifierxy`, but default to `Off`.

maxMagnifierOff :: l a -> ModifiedLayout Magnifier l a Source #

A magnifier that greatly magnifies the focused window; defaults to `Off`.

maximizeVertical :: l a -> ModifiedLayout Magnifier l a Source #

A magnifier that greatly magnifies just the vertical direction; defaults to `Off`.

# Don't Magnify the Master Window

magnifier' :: l a -> ModifiedLayout Magnifier l a Source #

Increase the size of the window that has focus, unless if it is one of the master windows.

magnifiercz' :: Rational -> l a -> ModifiedLayout Magnifier l a Source #

Increase the size of the window that has focus by a custom zoom, unless if it is one of the the master windows.

magnifierczOff' :: Rational -> l a -> ModifiedLayout Magnifier l a Source #

Like `magnifiercz'`, but default to `Off`.

magnifierxy' :: Rational -> Rational -> l a -> ModifiedLayout Magnifier l a Source #

Increase the size of the window that has focus by a custom zoom in both directions, unless it is one of the master windows.

magnifierxyOff' :: Rational -> Rational -> l a -> ModifiedLayout Magnifier l a Source #

Like `magnifierxy'`, but defaults to `Off`.

# Messages and Types

data MagnifyMsg Source #

Constructors

MagnifyMore |
MagnifyLess |
ToggleOn |
ToggleOff |
Toggle |

#### Instances

Instances details

Message MagnifyMsg Source # |
Instance details Defined in XMonad.Layout.Magnifier

data MagnifyThis Source #

Which windows to magnify and when to start doing so. Note that magnifying will start at the cut-off, so `AllWins 3` will start magnifying when there are at least three windows present in the stack set.

Constructors

AllWins !Natural | Every window
NoMaster !Natural | Only stack windows

#### Instances

Instances details

Read MagnifyThis Source # |
Instance details Defined in XMonad.Layout.Magnifier Methods readsPrec :: Int -> ReadS MagnifyThis Source # readList :: ReadS [MagnifyThis] Source # readPrec :: ReadPrec MagnifyThis Source # readListPrec :: ReadPrec [MagnifyThis] Source #
Show MagnifyThis Source # |
Instance details Defined in XMonad.Layout.Magnifier Methods showsPrec :: Int -> MagnifyThis -> ShowS Source # show :: MagnifyThis -> String Source # showList :: [MagnifyThis] -> ShowS Source #

data Magnifier a Source #

The type for magnifying a given type; do note that the given type `a` is a phantom type.

#### Instances

Instances details

LayoutModifier Magnifier Window Source # |

Instance details

Defined in XMonad.Layout.Magnifier

Methods

modifyLayout :: LayoutClass l Window => Magnifier Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (l Window)) Source #

modifyLayoutWithUpdate :: LayoutClass l Window => Magnifier Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X (([(Window, Rectangle)], Maybe (l Window)), Maybe (Magnifier Window)) Source #

handleMess :: Magnifier Window -> SomeMessage -> X (Maybe (Magnifier Window)) Source #

handleMessOrMaybeModifyIt :: Magnifier Window -> SomeMessage -> X (Maybe (Either (Magnifier Window) SomeMessage)) Source #

pureMess :: Magnifier Window -> SomeMessage -> Maybe (Magnifier Window) Source #

redoLayout :: Magnifier Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (Magnifier Window)) Source #

pureModifier :: Magnifier Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (Magnifier Window)) Source #

hook :: Magnifier Window -> X () Source #

unhook :: Magnifier Window -> X () Source #

modifierDescription :: Magnifier Window -> String Source #

modifyDescription :: LayoutClass l Window => Magnifier Window -> l Window -> String Source #

Read (Magnifier a) Source # |
Instance details Defined in XMonad.Layout.Magnifier Methods readsPrec :: Int -> ReadS (Magnifier a) Source # readList :: ReadS [Magnifier a] Source # readPrec :: ReadPrec (Magnifier a) Source # readListPrec :: ReadPrec [Magnifier a] Source #
Show (Magnifier a) Source # |
Instance details Defined in XMonad.Layout.Magnifier Methods showsPrec :: Int -> Magnifier a -> ShowS Source # show :: Magnifier a -> String Source # showList :: [Magnifier a] -> ShowS Source #