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 |
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
- data MagnifyThis
- 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
or 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 (magnifierxy
1 1000magnifierOff
); 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 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 the tutorial.
General combinators
:: Rational | Amount to magnify both directions |
-> MagnifyThis | What to magnify |
-> Bool | Whether magnification should start out on
( |
-> 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
:: Rational | Amount to magnify horizontally |
-> Rational | Amount to magnify vertically |
-> MagnifyThis | What to magnify |
-> Bool | Whether magnification should start out on
( |
-> 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 #
Instances
Message MagnifyMsg Source # | |
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.
Instances
Read MagnifyThis Source # | |
Defined in XMonad.Layout.Magnifier readsPrec :: Int -> ReadS MagnifyThis # readList :: ReadS [MagnifyThis] # readPrec :: ReadPrec MagnifyThis # readListPrec :: ReadPrec [MagnifyThis] # | |
Show MagnifyThis Source # | |
Defined in XMonad.Layout.Magnifier showsPrec :: Int -> MagnifyThis -> ShowS # show :: MagnifyThis -> String # showList :: [MagnifyThis] -> ShowS # |
The type for magnifying a given type; do note that the given type
a
is a phantom type.