xmonad-contrib-0.17.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 | Safe-Inferred
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
- 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
- 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
- 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/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` 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:

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 `MagnifyMsg`. 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 XMonad.Doc.Extending.

# General combinators

magnify #

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

# Magnify Everything

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

Increase the size of the window that has focus

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

Magnifier that defaults to Off

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

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

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

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

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

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

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

A magnifier that greatly magnifies just the vertical direction

# Don't Magnify the Master Window

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

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 #

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 #

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

# Messages and Types

data MagnifyMsg #

Constructors

MagnifyMore |
MagnifyLess |
ToggleOn |
ToggleOff |
Toggle |

#### Instances

Instances details

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

data MagnifyThis #

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

data Magnifier a #

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

#### Instances

Instances details

LayoutModifier Magnifier Window # |
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)) # modifyLayoutWithUpdate :: LayoutClass l Window => Magnifier Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X (([(Window, Rectangle)], Maybe (l Window)), Maybe (Magnifier Window)) # handleMess :: Magnifier Window -> SomeMessage -> X (Maybe (Magnifier Window)) # handleMessOrMaybeModifyIt :: Magnifier Window -> SomeMessage -> X (Maybe (Either (Magnifier Window) SomeMessage)) # pureMess :: Magnifier Window -> SomeMessage -> Maybe (Magnifier Window) # redoLayout :: Magnifier Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (Magnifier Window)) # pureModifier :: Magnifier Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (Magnifier Window)) # hook :: Magnifier Window -> X () # unhook :: Magnifier Window -> X () # modifierDescription :: Magnifier Window -> String # modifyDescription :: LayoutClass l Window => Magnifier Window -> l Window -> String #
Read (Magnifier a) # |
Instance details Defined in XMonad.Layout.Magnifier Methods readsPrec :: Int -> ReadS (Magnifier a) # readList :: ReadS [Magnifier a] # readPrec :: ReadPrec (Magnifier a) readListPrec :: ReadPrec [Magnifier a]
Show (Magnifier a) # |
Instance details Defined in XMonad.Layout.Magnifier Methods showsPrec :: Int -> Magnifier a -> ShowS # show :: Magnifier a -> String # showList :: [Magnifier a] -> ShowS #