/usr/share/doc/libghc-xmonad-doc/html/xmonad.txt is in libghc-xmonad-doc 0.11-6build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A tiling window manager
--
-- xmonad is a tiling window manager for X. Windows are arranged
-- automatically to tile the screen without gaps or overlap, maximising
-- screen use. All features of the window manager are accessible from the
-- keyboard: a mouse is strictly optional. xmonad is written and
-- extensible in Haskell. Custom layout algorithms, and other extensions,
-- may be written by the user in config files. Layouts are applied
-- dynamically, and different layouts may be used on each workspace.
-- Xinerama is fully supported, allowing windows to be tiled on several
-- screens.
@package xmonad
@version 0.11
module XMonad.StackSet
-- | A cursor into a non-empty list of workspaces.
--
-- We puncture the workspace list, producing a hole in the structure used
-- to track the currently focused workspace. The two other lists that are
-- produced are used to track those workspaces visible as Xinerama
-- screens, and those workspaces not visible anywhere.
data StackSet i l a sid sd
StackSet :: !(Screen i l a sid sd) -> [Screen i l a sid sd] -> [Workspace i l a] -> Map a RationalRect -> StackSet i l a sid sd
-- | currently focused workspace
current :: StackSet i l a sid sd -> !(Screen i l a sid sd)
-- | non-focused workspaces, visible in xinerama
visible :: StackSet i l a sid sd -> [Screen i l a sid sd]
-- | workspaces not visible anywhere
hidden :: StackSet i l a sid sd -> [Workspace i l a]
-- | floating windows
floating :: StackSet i l a sid sd -> Map a RationalRect
-- | A workspace is just a tag, a layout, and a stack.
data Workspace i l a
Workspace :: !i -> l -> Maybe (Stack a) -> Workspace i l a
tag :: Workspace i l a -> !i
layout :: Workspace i l a -> l
stack :: Workspace i l a -> Maybe (Stack a)
-- | Visible workspaces, and their Xinerama screens.
data Screen i l a sid sd
Screen :: !(Workspace i l a) -> !sid -> !sd -> Screen i l a sid sd
workspace :: Screen i l a sid sd -> !(Workspace i l a)
screen :: Screen i l a sid sd -> !sid
screenDetail :: Screen i l a sid sd -> !sd
-- | A stack is a cursor onto a window list. The data structure tracks
-- focus by construction, and the master window is by convention the
-- top-most item. Focus operations will not reorder the list that results
-- from flattening the cursor. The structure can be envisaged as:
--
-- <pre>
-- +-- master: < '7' >
-- up | [ '2' ]
-- +--------- [ '3' ]
-- focus: < '4' >
-- dn +----------- [ '8' ]
-- </pre>
--
-- A <a>Stack</a> can be viewed as a list with a hole punched in it to
-- make the focused position. Under the zipper/calculus view of such
-- structures, it is the differentiation of a [a], and integrating it
-- back has a natural implementation used in <a>index</a>.
data Stack a
Stack :: !a -> [a] -> [a] -> Stack a
focus :: Stack a -> !a
up :: Stack a -> [a]
down :: Stack a -> [a]
-- | A structure for window geometries
data RationalRect
RationalRect :: Rational -> Rational -> Rational -> Rational -> RationalRect
-- | <i>O(n)</i>. Create a new stackset, of empty stacks, with given tags,
-- with physical screens whose descriptions are given by <tt>m</tt>. The
-- number of physical screens (<tt>length <tt>m</tt></tt>) should be less
-- than or equal to the number of workspace tags. The first workspace in
-- the list will be current.
--
-- Xinerama: Virtual workspaces are assigned to physical screens,
-- starting at 0.
new :: Integral s => l -> [i] -> [sd] -> StackSet i l a s sd
-- | <i>O(w)</i>. Set focus to the workspace with index 'i'. If the index
-- is out of range, return the original <a>StackSet</a>.
--
-- Xinerama: If the workspace is not visible on any Xinerama screen, it
-- becomes the current screen. If it is in the visible list, it becomes
-- current.
view :: (Eq s, Eq i) => i -> StackSet i l a s sd -> StackSet i l a s sd
-- | Set focus to the given workspace. If that workspace does not exist in
-- the stackset, the original workspace is returned. If that workspace is
-- <a>hidden</a>, then display that workspace on the current screen, and
-- move the current workspace to <a>hidden</a>. If that workspace is
-- <a>visible</a> on another screen, the workspaces of the current screen
-- and the other screen are swapped.
greedyView :: (Eq s, Eq i) => i -> StackSet i l a s sd -> StackSet i l a s sd
-- | Find the tag of the workspace visible on Xinerama screen <tt>sc</tt>.
-- <a>Nothing</a> if screen is out of bounds.
lookupWorkspace :: Eq s => s -> StackSet i l a s sd -> Maybe i
-- | Get a list of all screens in the <a>StackSet</a>.
screens :: StackSet i l a s sd -> [Screen i l a s sd]
-- | Get a list of all workspaces in the <a>StackSet</a>.
workspaces :: StackSet i l a s sd -> [Workspace i l a]
-- | Get a list of all windows in the <a>StackSet</a> in no particular
-- order
allWindows :: Eq a => StackSet i l a s sd -> [a]
-- | Get the tag of the currently focused workspace.
currentTag :: StackSet i l a s sd -> i
-- | <i>O(1)</i>. Extract the focused element of the current stack. Return
-- <a>Just</a> that element, or <a>Nothing</a> for an empty stack.
peek :: StackSet i l a s sd -> Maybe a
-- | <i>O(s)</i>. Extract the stack on the current workspace, as a list.
-- The order of the stack is determined by the master window -- it will
-- be the head of the list. The implementation is given by the natural
-- integration of a one-hole list cursor, back to a list.
index :: StackSet i l a s sd -> [a]
-- | <i>O(n)</i>. Flatten a <a>Stack</a> into a list.
integrate :: Stack a -> [a]
-- | <i>O(n)</i> Flatten a possibly empty stack into a list.
integrate' :: Maybe (Stack a) -> [a]
-- | <i>O(n)</i>. Turn a list into a possibly empty stack (i.e., a zipper):
-- the first element of the list is current, and the rest of the list is
-- down.
differentiate :: [a] -> Maybe (Stack a)
-- | <i>O(1), O(w) on the wrapping case</i>.
--
-- focusUp, focusDown. Move the window focus up or down the stack,
-- wrapping if we reach the end. The wrapping should model a <a>cycle</a>
-- on the current stack. The <tt>master</tt> window, and window order,
-- are unaffected by movement of focus.
--
-- swapUp, swapDown, swap the neighbour in the stack ordering, wrapping
-- if we reach the end. Again the wrapping model should <a>cycle</a> on
-- the current stack.
focusUp :: StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(1), O(w) on the wrapping case</i>.
--
-- focusUp, focusDown. Move the window focus up or down the stack,
-- wrapping if we reach the end. The wrapping should model a <a>cycle</a>
-- on the current stack. The <tt>master</tt> window, and window order,
-- are unaffected by movement of focus.
--
-- swapUp, swapDown, swap the neighbour in the stack ordering, wrapping
-- if we reach the end. Again the wrapping model should <a>cycle</a> on
-- the current stack.
focusDown :: StackSet i l a s sd -> StackSet i l a s sd
-- | Variants of <a>focusUp</a> and <a>focusDown</a> that work on a
-- <a>Stack</a> rather than an entire <a>StackSet</a>.
focusUp' :: Stack a -> Stack a
-- | Variants of <a>focusUp</a> and <a>focusDown</a> that work on a
-- <a>Stack</a> rather than an entire <a>StackSet</a>.
focusDown' :: Stack a -> Stack a
-- | <i>O(s)</i>. Set focus to the master window.
focusMaster :: StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(1) on current window, O(n) in general</i>. Focus the window
-- <tt>w</tt>, and set its workspace as current.
focusWindow :: (Eq s, Eq a, Eq i) => a -> StackSet i l a s sd -> StackSet i l a s sd
-- | Is the given tag present in the <a>StackSet</a>?
tagMember :: Eq i => i -> StackSet i l a s sd -> Bool
-- | Rename a given tag if present in the <a>StackSet</a>.
renameTag :: Eq i => i -> i -> StackSet i l a s sd -> StackSet i l a s sd
-- | Ensure that a given set of workspace tags is present by renaming
-- existing workspaces and/or creating new hidden workspaces as
-- necessary.
ensureTags :: Eq i => l -> [i] -> StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(n)</i>. Is a window in the <a>StackSet</a>?
member :: Eq a => a -> StackSet i l a s sd -> Bool
-- | <i>O(1) on current window, O(n) in general</i>. Return <a>Just</a> the
-- workspace tag of the given window, or <a>Nothing</a> if the window is
-- not in the <a>StackSet</a>.
findTag :: Eq a => a -> StackSet i l a s sd -> Maybe i
-- | Map a function on all the workspaces in the <a>StackSet</a>.
mapWorkspace :: (Workspace i l a -> Workspace i l a) -> StackSet i l a s sd -> StackSet i l a s sd
-- | Map a function on all the layouts in the <a>StackSet</a>.
mapLayout :: (l -> l') -> StackSet i l a s sd -> StackSet i l' a s sd
-- | <i>O(n)</i>. (Complexity due to duplicate check). Insert a new element
-- into the stack, above the currently focused element. The new element
-- is given focus; the previously focused element is moved down.
--
-- If the element is already in the stackset, the original stackset is
-- returned unmodified.
--
-- Semantics in Huet's paper is that insert doesn't move the cursor.
-- However, we choose to insert above, and move the focus.
insertUp :: Eq a => a -> StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(1) on current window, O(n) in general</i>. Delete window
-- <tt>w</tt> if it exists. There are 4 cases to consider:
--
-- <ul>
-- <li>delete on an <a>Nothing</a> workspace leaves it Nothing</li>
-- <li>otherwise, try to move focus to the down</li>
-- <li>otherwise, try to move focus to the up</li>
-- <li>otherwise, you've got an empty workspace, becomes
-- <a>Nothing</a></li>
-- </ul>
--
-- Behaviour with respect to the master:
--
-- <ul>
-- <li>deleting the master window resets it to the newly focused
-- window</li>
-- <li>otherwise, delete doesn't affect the master.</li>
-- </ul>
delete :: (Ord a, Eq s) => a -> StackSet i l a s sd -> StackSet i l a s sd
-- | Only temporarily remove the window from the stack, thereby not
-- destroying special information saved in the <tt>Stackset</tt>
delete' :: (Eq a, Eq s) => a -> StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(n)</i>. 'filter p s' returns the elements of <tt>s</tt> such that
-- <tt>p</tt> evaluates to <a>True</a>. Order is preserved, and focus
-- moves as described for <a>delete</a>.
filter :: (a -> Bool) -> Stack a -> Maybe (Stack a)
-- | <i>O(1), O(w) on the wrapping case</i>.
--
-- focusUp, focusDown. Move the window focus up or down the stack,
-- wrapping if we reach the end. The wrapping should model a <a>cycle</a>
-- on the current stack. The <tt>master</tt> window, and window order,
-- are unaffected by movement of focus.
--
-- swapUp, swapDown, swap the neighbour in the stack ordering, wrapping
-- if we reach the end. Again the wrapping model should <a>cycle</a> on
-- the current stack.
swapUp :: StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(1), O(w) on the wrapping case</i>.
--
-- focusUp, focusDown. Move the window focus up or down the stack,
-- wrapping if we reach the end. The wrapping should model a <a>cycle</a>
-- on the current stack. The <tt>master</tt> window, and window order,
-- are unaffected by movement of focus.
--
-- swapUp, swapDown, swap the neighbour in the stack ordering, wrapping
-- if we reach the end. Again the wrapping model should <a>cycle</a> on
-- the current stack.
swapDown :: StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(s)</i>. Set the master window to the focused window. The old
-- master window is swapped in the tiling order with the focused window.
-- Focus stays with the item moved.
swapMaster :: StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(s)</i>. Set the master window to the focused window. The other
-- windows are kept in order and shifted down on the stack, as if you
-- just hit mod-shift-k a bunch of times. Focus stays with the item
-- moved.
shiftMaster :: StackSet i l a s sd -> StackSet i l a s sd
-- | Apply a function, and a default value for <a>Nothing</a>, to modify
-- the current stack.
modify :: Maybe (Stack a) -> (Stack a -> Maybe (Stack a)) -> StackSet i l a s sd -> StackSet i l a s sd
-- | Apply a function to modify the current stack if it isn't empty, and we
-- don't want to empty it.
modify' :: (Stack a -> Stack a) -> StackSet i l a s sd -> StackSet i l a s sd
-- | Given a window, and its preferred rectangle, set it as floating A
-- floating window should already be managed by the <a>StackSet</a>.
float :: Ord a => a -> RationalRect -> StackSet i l a s sd -> StackSet i l a s sd
-- | Clear the floating status of a window
sink :: Ord a => a -> StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(w)</i>. shift. Move the focused element of the current stack to
-- stack <tt>n</tt>, leaving it as the focused element on that stack. The
-- item is inserted above the currently focused element on that
-- workspace. The actual focused workspace doesn't change. If there is no
-- element on the current stack, the original stackSet is returned.
shift :: (Ord a, Eq s, Eq i) => i -> StackSet i l a s sd -> StackSet i l a s sd
-- | <i>O(n)</i>. shiftWin. Searches for the specified window <tt>w</tt> on
-- all workspaces of the stackSet and moves it to stack <tt>n</tt>,
-- leaving it as the focused element on that stack. The item is inserted
-- above the currently focused element on that workspace. The actual
-- focused workspace doesn't change. If the window is not found in the
-- stackSet, the original stackSet is returned.
shiftWin :: (Ord a, Eq a, Eq s, Eq i) => i -> a -> StackSet i l a s sd -> StackSet i l a s sd
-- | this function indicates to catch that an error is expected
abort :: String -> a
instance Show RationalRect
instance Read RationalRect
instance Eq RationalRect
instance Show a => Show (Stack a)
instance Read a => Read (Stack a)
instance Eq a => Eq (Stack a)
instance (Show i, Show l, Show a) => Show (Workspace i l a)
instance (Read i, Read l, Read a) => Read (Workspace i l a)
instance (Eq i, Eq l, Eq a) => Eq (Workspace i l a)
instance (Show i, Show l, Show a, Show sid, Show sd) => Show (Screen i l a sid sd)
instance (Read i, Read l, Read a, Read sid, Read sd) => Read (Screen i l a sid sd)
instance (Eq i, Eq l, Eq a, Eq sid, Eq sd) => Eq (Screen i l a sid sd)
instance (Show i, Show l, Show a, Show sid, Show sd) => Show (StackSet i l a sid sd)
instance (Ord a, Read i, Read l, Read a, Read sid, Read sd) => Read (StackSet i l a sid sd)
instance (Eq i, Eq l, Eq a, Eq sid, Eq sd) => Eq (StackSet i l a sid sd)
-- | The <a>X</a> monad, a state monad transformer over <a>IO</a>, for the
-- window manager state, and support routines.
module XMonad.Core
-- | The X monad, <a>ReaderT</a> and <a>StateT</a> transformers over
-- <a>IO</a> encapsulating the window manager configuration and state,
-- respectively.
--
-- Dynamic components may be retrieved with <a>get</a>, static components
-- with <a>ask</a>. With newtype deriving we get readers and state monads
-- instantiated on <a>XConf</a> and <a>XState</a> automatically.
data X a
type WindowSet = StackSet WorkspaceId (Layout Window) Window ScreenId ScreenDetail
type WindowSpace = Workspace WorkspaceId (Layout Window) Window
-- | Virtual workspace indices
type WorkspaceId = String
-- | Physical screen indices
newtype ScreenId
S :: Int -> ScreenId
-- | The <a>Rectangle</a> with screen dimensions
data ScreenDetail
SD :: !Rectangle -> ScreenDetail
screenRect :: ScreenDetail -> !Rectangle
-- | XState, the (mutable) window manager state.
data XState
XState :: !WindowSet -> !(Set Window) -> !(Map Window Int) -> !(Maybe (Position -> Position -> X (), X ())) -> !KeyMask -> !(Map String (Either String StateExtension)) -> XState
-- | workspace list
windowset :: XState -> !WindowSet
-- | the Set of mapped windows
mapped :: XState -> !(Set Window)
-- | the number of expected UnmapEvents
waitingUnmap :: XState -> !(Map Window Int)
dragging :: XState -> !(Maybe (Position -> Position -> X (), X ()))
-- | The numlock modifier
numberlockMask :: XState -> !KeyMask
-- | stores custom state information.
--
-- The module <a>XMonad.Utils.ExtensibleState</a> in xmonad-contrib
-- provides additional information and a simple interface for using this.
extensibleState :: XState -> !(Map String (Either String StateExtension))
-- | XConf, the (read-only) window manager configuration.
data XConf
XConf :: Display -> !(XConfig Layout) -> !Window -> !Pixel -> !Pixel -> !(Map (KeyMask, KeySym) (X ())) -> !(Map (KeyMask, Button) (Window -> X ())) -> !Bool -> !(Maybe (Position, Position)) -> !(Maybe Event) -> XConf
-- | the X11 display
display :: XConf -> Display
-- | initial user configuration
config :: XConf -> !(XConfig Layout)
-- | the root window
theRoot :: XConf -> !Window
-- | border color of unfocused windows
normalBorder :: XConf -> !Pixel
-- | border color of the focused window
focusedBorder :: XConf -> !Pixel
-- | a mapping of key presses to actions
keyActions :: XConf -> !(Map (KeyMask, KeySym) (X ()))
-- | a mapping of button presses to actions
buttonActions :: XConf -> !(Map (KeyMask, Button) (Window -> X ()))
-- | was refocus caused by mouse action?
mouseFocused :: XConf -> !Bool
-- | position of the mouse according to the event currently being processed
mousePosition :: XConf -> !(Maybe (Position, Position))
-- | event currently being processed
currentEvent :: XConf -> !(Maybe Event)
data XConfig l
XConfig :: !String -> !String -> !String -> !(l Window) -> !ManageHook -> !(Event -> X All) -> ![String] -> !KeyMask -> !(XConfig Layout -> Map (ButtonMask, KeySym) (X ())) -> !(XConfig Layout -> Map (ButtonMask, Button) (Window -> X ())) -> !Dimension -> !(X ()) -> !(X ()) -> !Bool -> !Bool -> XConfig l
-- | Non focused windows border color. Default: "#dddddd"
normalBorderColor :: XConfig l -> !String
-- | Focused windows border color. Default: "#ff0000"
focusedBorderColor :: XConfig l -> !String
-- | The preferred terminal application. Default: "xterm"
terminal :: XConfig l -> !String
-- | The available layouts
layoutHook :: XConfig l -> !(l Window)
-- | The action to run when a new window is opened
manageHook :: XConfig l -> !ManageHook
-- | Handle an X event, returns (All True) if the default handler should
-- also be run afterwards. mappend should be used for combining event
-- hooks in most cases.
handleEventHook :: XConfig l -> !(Event -> X All)
-- | The list of workspaces' names
workspaces :: XConfig l -> ![String]
-- | the mod modifier
modMask :: XConfig l -> !KeyMask
-- | The key binding: a map from key presses and actions
keys :: XConfig l -> !(XConfig Layout -> Map (ButtonMask, KeySym) (X ()))
-- | The mouse bindings
mouseBindings :: XConfig l -> !(XConfig Layout -> Map (ButtonMask, Button) (Window -> X ()))
-- | The border width
borderWidth :: XConfig l -> !Dimension
-- | The action to perform when the windows set is changed
logHook :: XConfig l -> !(X ())
-- | The action to perform on startup
startupHook :: XConfig l -> !(X ())
-- | Whether window entry events can change focus
focusFollowsMouse :: XConfig l -> !Bool
-- | False to make a click which changes focus to be additionally passed to
-- the window
clickJustFocuses :: XConfig l -> !Bool
-- | Every layout must be an instance of <a>LayoutClass</a>, which defines
-- the basic layout operations along with a sensible default for each.
--
-- Minimal complete definition:
--
-- <ul>
-- <li><a>runLayout</a> || ((<a>doLayout</a> || <a>pureLayout</a>)
-- && <a>emptyLayout</a>), and</li>
-- <li><a>handleMessage</a> || <a>pureMessage</a></li>
-- </ul>
--
-- You should also strongly consider implementing <a>description</a>,
-- although it is not required.
--
-- Note that any code which <i>uses</i> <a>LayoutClass</a> methods should
-- only ever call <a>runLayout</a>, <a>handleMessage</a>, and
-- <a>description</a>! In other words, the only calls to <a>doLayout</a>,
-- <a>pureMessage</a>, and other such methods should be from the default
-- implementations of <a>runLayout</a>, <a>handleMessage</a>, and so on.
-- This ensures that the proper methods will be used, regardless of the
-- particular methods that any <a>LayoutClass</a> instance chooses to
-- define.
class Show (layout a) => LayoutClass layout a where runLayout (Workspace _ l ms) r = maybe (emptyLayout l r) (doLayout l r) ms doLayout l r s = return (pureLayout l r s, Nothing) pureLayout _ r s = [(focus s, r)] emptyLayout _ _ = return ([], Nothing) handleMessage l = return . pureMessage l pureMessage _ _ = Nothing description = show
runLayout :: LayoutClass layout a => Workspace WorkspaceId (layout a) a -> Rectangle -> X ([(a, Rectangle)], Maybe (layout a))
doLayout :: LayoutClass layout a => layout a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (layout a))
pureLayout :: LayoutClass layout a => layout a -> Rectangle -> Stack a -> [(a, Rectangle)]
emptyLayout :: LayoutClass layout a => layout a -> Rectangle -> X ([(a, Rectangle)], Maybe (layout a))
handleMessage :: LayoutClass layout a => layout a -> SomeMessage -> X (Maybe (layout a))
pureMessage :: LayoutClass layout a => layout a -> SomeMessage -> Maybe (layout a)
description :: LayoutClass layout a => layout a -> String
-- | An existential type that can hold any object that is in <a>Read</a>
-- and <a>LayoutClass</a>.
data Layout a
Layout :: (l a) -> Layout a
-- | Using the <a>Layout</a> as a witness, parse existentially wrapped
-- windows from a <a>String</a>.
readsLayout :: Layout a -> String -> [(Layout a, String)]
-- | The class <a>Typeable</a> allows a concrete representation of a type
-- to be calculated.
class Typeable a
-- | Based on ideas in /An Extensible Dynamically-Typed Hierarchy of
-- Exceptions/, Simon Marlow, 2006. Use extensible messages to the
-- <a>handleMessage</a> handler.
--
-- User-extensible messages must be a member of this class.
class Typeable a => Message a
-- | A wrapped value of some type in the <a>Message</a> class.
data SomeMessage
SomeMessage :: a -> SomeMessage
-- | And now, unwrap a given, unknown <a>Message</a> type, performing a
-- (dynamic) type check on the result.
fromMessage :: Message m => SomeMessage -> Maybe m
-- | <a>LayoutMessages</a> are core messages that all layouts (especially
-- stateful layouts) should consider handling.
data LayoutMessages
-- | sent when a layout becomes non-visible
Hide :: LayoutMessages
-- | sent when xmonad is exiting or restarting
ReleaseResources :: LayoutMessages
-- | Existential type to store a state extension.
data StateExtension
-- | Non-persistent state extension
StateExtension :: a -> StateExtension
-- | Persistent extension
PersistentExtension :: a -> StateExtension
-- | Every module must make the data it wants to store an instance of this
-- class.
--
-- Minimal complete definition: initialValue
class Typeable a => ExtensionClass a where extensionType = StateExtension
initialValue :: ExtensionClass a => a
extensionType :: ExtensionClass a => a -> StateExtension
-- | Run the <a>X</a> monad, given a chunk of <a>X</a> monad code, and an
-- initial state Return the result, and final state
runX :: XConf -> XState -> X a -> IO (a, XState)
-- | Run in the <a>X</a> monad, and in case of exception, and catch it and
-- log it to stderr, and run the error case.
catchX :: X a -> X a -> X a
-- | Execute the argument, catching all exceptions. Either this function or
-- <a>catchX</a> should be used at all callsites of user customized code.
userCode :: X a -> X (Maybe a)
-- | Same as userCode but with a default argument to return instead of
-- using Maybe, provided for convenience.
userCodeDef :: a -> X a -> X a
-- | General utilities
--
-- Lift an <a>IO</a> action into the <a>X</a> monad
io :: MonadIO m => IO a -> m a
-- | Lift an <a>IO</a> action into the <a>X</a> monad. If the action
-- results in an <a>IO</a> exception, log the exception to stderr and
-- continue normal execution.
catchIO :: MonadIO m => IO () -> m ()
-- | Ignore SIGPIPE to avoid termination when a pipe is full, and SIGCHLD
-- to avoid zombie processes, and clean up any extant zombie processes.
installSignalHandlers :: MonadIO m => m ()
uninstallSignalHandlers :: MonadIO m => m ()
-- | Run a monad action with the current display settings
withDisplay :: (Display -> X a) -> X a
-- | Run a monadic action with the current stack set
withWindowSet :: (WindowSet -> X a) -> X a
-- | True if the given window is the root window
isRoot :: Window -> X Bool
-- | This is basically a map function, running a function in the <a>X</a>
-- monad on each workspace with the output of that function being the
-- modified workspace.
runOnWorkspaces :: (WindowSpace -> X WindowSpace) -> X ()
-- | Wrapper for the common case of atom internment
getAtom :: String -> X Atom
-- | spawn. Launch an external application. Specifically, it double-forks
-- and runs the <a>String</a> you pass as a command to /bin/sh.
--
-- Note this function assumes your locale uses utf8.
spawn :: MonadIO m => String -> m ()
-- | Like <a>spawn</a>, but returns the <a>ProcessID</a> of the launched
-- application
spawnPID :: MonadIO m => String -> m ProcessID
-- | A replacement for <a>forkProcess</a> which resets default signal
-- handlers.
xfork :: MonadIO m => IO () -> m ProcessID
-- | Return the path to <tt>~/.xmonad</tt>.
getXMonadDir :: MonadIO m => m String
-- | 'recompile force', recompile <tt>~/.xmonad/xmonad.hs</tt> when any of
-- the following apply:
--
-- <ul>
-- <li>force is <a>True</a></li>
-- <li>the xmonad executable does not exist</li>
-- <li>the xmonad executable is older than xmonad.hs or any file in
-- ~/.xmonad/lib</li>
-- </ul>
--
-- The -i flag is used to restrict recompilation to the xmonad.hs file
-- only, and any files in the ~/.xmonad/lib directory.
--
-- Compilation errors (if any) are logged to ~/.xmonad/xmonad.errors. If
-- GHC indicates failure with a non-zero exit code, an xmessage
-- displaying that file is spawned.
--
-- <a>False</a> is returned if there are compilation errors.
recompile :: MonadIO m => Bool -> m Bool
-- | A <a>trace</a> for the <a>X</a> monad. Logs a string to stderr. The
-- result may be found in your .xsession-errors file
trace :: MonadIO m => String -> m ()
-- | Conditionally run an action, using a <tt>Maybe a</tt> to decide.
whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()
-- | Conditionally run an action, using a <a>X</a> event to decide
whenX :: X Bool -> X () -> X ()
-- | Common non-predefined atoms
atom_WM_STATE :: X Atom
-- | Common non-predefined atoms
atom_WM_PROTOCOLS :: X Atom
-- | Common non-predefined atoms
atom_WM_DELETE_WINDOW :: X Atom
-- | Common non-predefined atoms
atom_WM_TAKE_FOCUS :: X Atom
type ManageHook = Query (Endo WindowSet)
newtype Query a
Query :: (ReaderT Window X a) -> Query a
runQuery :: Query a -> Window -> X a
instance Typeable LayoutMessages
instance Typeable1 X
instance Eq ScreenId
instance Ord ScreenId
instance Show ScreenId
instance Read ScreenId
instance Enum ScreenId
instance Num ScreenId
instance Integral ScreenId
instance Real ScreenId
instance Eq ScreenDetail
instance Show ScreenDetail
instance Read ScreenDetail
instance Eq LayoutMessages
instance Functor X
instance Monad X
instance MonadIO X
instance MonadState XState X
instance MonadReader XConf X
instance Functor Query
instance Monad Query
instance MonadReader Window Query
instance MonadIO Query
instance Message LayoutMessages
instance Message Event
instance Show (Layout a)
instance LayoutClass Layout Window
instance Monoid a => Monoid (Query a)
instance Monoid a => Monoid (X a)
instance Applicative X
-- | The collection of core layouts.
module XMonad.Layout
-- | Simple fullscreen mode. Renders the focused window fullscreen.
data Full a
Full :: Full a
-- | The builtin tiling mode of xmonad. Supports <a>Shrink</a>,
-- <a>Expand</a> and <a>IncMasterN</a>.
data Tall a
Tall :: !Int -> !Rational -> !Rational -> Tall a
-- | The default number of windows in the master pane (default: 1)
tallNMaster :: Tall a -> !Int
-- | Percent of screen to increment by when resizing panes (default: 3/100)
tallRatioIncrement :: Tall a -> !Rational
-- | Default proportion of screen occupied by master pane (default: 1/2)
tallRatio :: Tall a -> !Rational
-- | Mirror a layout, compute its 90 degree rotated form.
newtype Mirror l a
Mirror :: (l a) -> Mirror l a
-- | Change the size of the master pane.
data Resize
Shrink :: Resize
Expand :: Resize
-- | Increase the number of clients in the master pane.
data IncMasterN
IncMasterN :: !Int -> IncMasterN
-- | A layout that allows users to switch between various layout options.
data Choose l r a
-- | The layout choice combinator
(|||) :: (LayoutClass l a, LayoutClass r a) => l a -> r a -> Choose l r a
-- | Messages to change the current layout.
data ChangeLayout
FirstLayout :: ChangeLayout
NextLayout :: ChangeLayout
-- | Mirror a rectangle.
mirrorRect :: Rectangle -> Rectangle
splitVertically :: Int -> Rectangle -> [Rectangle]
splitHorizontally :: Int -> Rectangle -> [Rectangle]
splitHorizontallyBy :: RealFrac r => r -> Rectangle -> (Rectangle, Rectangle)
splitVerticallyBy :: RealFrac r => r -> Rectangle -> (Rectangle, Rectangle)
-- | Compute the positions for windows using the default two-pane tiling
-- algorithm.
--
-- The screen is divided into two panes. All clients are then partioned
-- between these two panes. One pane, the master, by convention has the
-- least number of windows in it.
tile :: Rational -> Rectangle -> Int -> Int -> [Rectangle]
instance Typeable Resize
instance Typeable IncMasterN
instance Typeable ChangeLayout
instance Typeable NextNoWrap
instance Show (Full a)
instance Read (Full a)
instance Show (Tall a)
instance Read (Tall a)
instance Show (l a) => Show (Mirror l a)
instance Read (l a) => Read (Mirror l a)
instance Eq ChangeLayout
instance Show ChangeLayout
instance Read LR
instance Show LR
instance Eq LR
instance (Read (l a), Read (r a)) => Read (Choose l r a)
instance (Show (l a), Show (r a)) => Show (Choose l r a)
instance Eq NextNoWrap
instance Show NextNoWrap
instance (LayoutClass l a, LayoutClass r a) => LayoutClass (Choose l r) a
instance Message NextNoWrap
instance Message ChangeLayout
instance LayoutClass l a => LayoutClass (Mirror l) a
instance LayoutClass Tall a
instance LayoutClass Full a
instance Message IncMasterN
instance Message Resize
-- | Operations.
module XMonad.Operations
-- | Window manager operations manage. Add a new window to be managed in
-- the current workspace. Bring it into focus.
--
-- Whether the window is already managed, or not, it is mapped, has its
-- border set, and its event mask set.
manage :: Window -> X ()
-- | unmanage. A window no longer exists, remove it from the window list,
-- on whatever workspace it is.
unmanage :: Window -> X ()
-- | Kill the specified window. If we do kill it, we'll get a delete notify
-- back from X.
--
-- There are two ways to delete a window. Either just kill it, or if it
-- supports the delete protocol, send a delete event (e.g. firefox)
killWindow :: Window -> X ()
-- | Kill the currently focused client.
kill :: X ()
-- | windows. Modify the current window list with a pure function, and
-- refresh
windows :: (WindowSet -> WindowSet) -> X ()
-- | Produce the actual rectangle from a screen and a ratio on that screen.
scaleRationalRect :: Rectangle -> RationalRect -> Rectangle
-- | setWMState. set the WM_STATE property
setWMState :: Window -> Int -> X ()
-- | hide. Hide a window by unmapping it, and setting Iconified.
hide :: Window -> X ()
-- | reveal. Show a window by mapping it and setting Normal this is
-- harmless if the window was already visible
reveal :: Window -> X ()
-- | The client events that xmonad is interested in
clientMask :: EventMask
-- | Set some properties when we initially gain control of a window
setInitialProperties :: Window -> X ()
-- | refresh. Render the currently visible workspaces, as determined by the
-- <tt>StackSet</tt>. Also, set focus to the focused window.
--
-- This is our <tt>view</tt> operation (MVC), in that it pretty prints
-- our model with X calls.
refresh :: X ()
-- | clearEvents. Remove all events of a given type from the event queue.
clearEvents :: EventMask -> X ()
-- | tileWindow. Moves and resizes w such that it fits inside the given
-- rectangle, including its border.
tileWindow :: Window -> Rectangle -> X ()
-- | Returns <a>True</a> if the first rectangle is contained within, but
-- not equal to the second.
containedIn :: Rectangle -> Rectangle -> Bool
-- | Given a list of screens, remove all duplicated screens and screens
-- that are entirely contained within another.
nubScreens :: [Rectangle] -> [Rectangle]
-- | Cleans the list of screens according to the rules documented for
-- nubScreens.
getCleanedScreenInfo :: MonadIO m => Display -> m [Rectangle]
-- | rescreen. The screen configuration may have changed (due to xrandr),
-- update the state and refresh the screen, and reset the gap.
rescreen :: X ()
-- | setButtonGrab. Tell whether or not to intercept clicks on a given
-- window
setButtonGrab :: Bool -> Window -> X ()
-- | Set the focus to the window on top of the stack, or root
setTopFocus :: X ()
-- | Set focus explicitly to window <tt>w</tt> if it is managed by us, or
-- root. This happens if X notices we've moved the mouse (and perhaps
-- moved the mouse to a new screen).
focus :: Window -> X ()
-- | Call X to set the keyboard focus details.
setFocusX :: Window -> X ()
-- | Throw a message to the current <a>LayoutClass</a> possibly modifying
-- how we layout the windows, then refresh.
sendMessage :: Message a => a -> X ()
-- | Send a message to all layouts, without refreshing.
broadcastMessage :: Message a => a -> X ()
-- | Send a message to a layout, without refreshing.
sendMessageWithNoRefresh :: Message a => a -> Workspace WorkspaceId (Layout Window) Window -> X ()
-- | Update the layout field of a workspace
updateLayout :: WorkspaceId -> Maybe (Layout Window) -> X ()
-- | Set the layout of the currently viewed workspace
setLayout :: Layout Window -> X ()
-- | Return workspace visible on screen <tt>sc</tt>, or <a>Nothing</a>.
screenWorkspace :: ScreenId -> X (Maybe WorkspaceId)
-- | Apply an <a>X</a> operation to the currently focused window, if there
-- is one.
withFocused :: (Window -> X ()) -> X ()
-- | <a>True</a> if window is under management by us
isClient :: Window -> X Bool
-- | Combinations of extra modifier masks we need to grab keys/buttons for.
-- (numlock and capslock)
extraModifiers :: X [KeyMask]
-- | Strip numlock/capslock from a mask
cleanMask :: KeyMask -> X KeyMask
-- | Get the <a>Pixel</a> value for a named color
initColor :: Display -> String -> IO (Maybe Pixel)
-- | <tt>restart name resume</tt>. Attempt to restart xmonad by executing
-- the program <tt>name</tt>. If <tt>resume</tt> is <a>True</a>, restart
-- with the current window state. When executing another window manager,
-- <tt>resume</tt> should be <a>False</a>.
restart :: String -> Bool -> X ()
-- | Floating layer support
--
-- Given a window, find the screen it is located on, and compute the
-- geometry of that window wrt. that screen.
floatLocation :: Window -> X (ScreenId, RationalRect)
-- | Given a point, determine the screen (if any) that contains it.
pointScreen :: Position -> Position -> X (Maybe (Screen WorkspaceId (Layout Window) Window ScreenId ScreenDetail))
-- | <tt>pointWithin x y r</tt> returns <a>True</a> if the <tt>(x, y)</tt>
-- co-ordinate is within <tt>r</tt>.
pointWithin :: Position -> Position -> Rectangle -> Bool
-- | Make a tiled window floating, using its suggested rectangle
float :: Window -> X ()
-- | Accumulate mouse motion events
mouseDrag :: (Position -> Position -> X ()) -> X () -> X ()
-- | XXX comment me
mouseMoveWindow :: Window -> X ()
-- | XXX comment me
mouseResizeWindow :: Window -> X ()
-- | Support for window size hints
type D = (Dimension, Dimension)
-- | Given a window, build an adjuster function that will reduce the given
-- dimensions according to the window's border width and size hints.
mkAdjust :: Window -> X (D -> D)
-- | Reduce the dimensions if needed to comply to the given SizeHints,
-- taking window borders into account.
applySizeHints :: Integral a => Dimension -> SizeHints -> (a, a) -> D
-- | Reduce the dimensions if needed to comply to the given SizeHints.
applySizeHintsContents :: Integral a => SizeHints -> (a, a) -> D
-- | XXX comment me
applySizeHints' :: SizeHints -> D -> D
-- | Reduce the dimensions so their aspect ratio falls between the two
-- given aspect ratios.
applyAspectHint :: (D, D) -> D -> D
-- | Reduce the dimensions so they are a multiple of the size increments.
applyResizeIncHint :: D -> D -> D
-- | Reduce the dimensions if they exceed the given maximum dimensions.
applyMaxSizeHint :: D -> D -> D
-- | An EDSL for ManageHooks
module XMonad.ManageHook
-- | Lift an <a>X</a> action to a <a>Query</a>.
liftX :: X a -> Query a
-- | The identity hook that returns the WindowSet unchanged.
idHook :: Monoid m => m
-- | Infix <a>mappend</a>. Compose two <a>ManageHook</a> from right to
-- left.
(<+>) :: Monoid m => m -> m -> m
-- | Compose the list of <a>ManageHook</a>s.
composeAll :: Monoid m => [m] -> m
-- | <tt>p --> x</tt>. If <tt>p</tt> returns <a>True</a>, execute the
-- <a>ManageHook</a>.
--
-- <pre>
-- (-->) :: Monoid m => Query Bool -> Query m -> Query m -- a simpler type
-- </pre>
(-->) :: (Monad m, Monoid a) => m Bool -> m a -> m a
-- | <tt>q =? x</tt>. if the result of <tt>q</tt> equals <tt>x</tt>, return
-- <a>True</a>.
(=?) :: Eq a => Query a -> a -> Query Bool
-- | <a>&&</a> lifted to a <a>Monad</a>.
(<&&>) :: Monad m => m Bool -> m Bool -> m Bool
-- | <a>||</a> lifted to a <a>Monad</a>.
(<||>) :: Monad m => m Bool -> m Bool -> m Bool
-- | Return the window title.
title :: Query String
-- | Return the application name.
appName :: Query String
-- | Backwards compatible alias for <a>appName</a>.
resource :: Query String
-- | Return the resource class.
className :: Query String
-- | A query that can return an arbitrary X property of type <a>String</a>,
-- identified by name.
stringProperty :: String -> Query String
getStringProperty :: Display -> Window -> String -> X (Maybe String)
-- | Modify the <a>WindowSet</a> with a pure function.
doF :: (s -> s) -> Query (Endo s)
-- | Move the window to the floating layer.
doFloat :: ManageHook
-- | Map the window and remove it from the <a>WindowSet</a>.
doIgnore :: ManageHook
-- | Move the window to a given workspace
doShift :: WorkspaceId -> ManageHook
-- | This module specifies the default configuration values for xmonad.
--
-- DO NOT MODIFY THIS FILE! It won't work. You may configure xmonad by
-- providing your own <tt>~/.xmonad/xmonad.hs</tt> that overrides
-- specific fields in <a>defaultConfig</a>. For a starting point, you can
-- copy the <tt>xmonad.hs</tt> found in the <tt>man</tt> directory, or
-- look at examples on the xmonad wiki.
module XMonad.Config
-- | The default set of configuration values itself
defaultConfig :: XConfig (Choose Tall (Choose (Mirror Tall) Full))
-- | xmonad, a minimalist, tiling window manager for X11
module XMonad.Main
-- | The main entry point
xmonad :: (LayoutClass l Window, Read (l Window)) => XConfig l -> IO ()
module XMonad
-- | Bitwise "or"
(.|.) :: Bits a => a -> a -> a
-- | Minimal definition is either both of <tt>get</tt> and <tt>put</tt> or
-- just <tt>state</tt>
class Monad m => MonadState s (m :: * -> *) | m -> s
get :: MonadState s m => m s
put :: MonadState s m => s -> m ()
state :: MonadState s m => (s -> (a, s)) -> m a
-- | Gets specific component of the state, using a projection function
-- supplied.
gets :: MonadState s m => (s -> a) -> m a
-- | Monadic state transformer.
--
-- Maps an old state to a new state inside a state monad. The old state
-- is thrown away.
--
-- <pre>
-- Main> :t modify ((+1) :: Int -> Int)
-- modify (...) :: (MonadState Int a) => a ()
-- </pre>
--
-- This says that <tt>modify (+1)</tt> acts over any Monad that is a
-- member of the <tt>MonadState</tt> class, with an <tt>Int</tt> state.
modify :: MonadState s m => (s -> s) -> m ()
-- | See examples in <a>Control.Monad.Reader</a>. Note, the partially
-- applied function type <tt>(->) r</tt> is a simple reader monad. See
-- the <tt>instance</tt> declaration below.
class Monad m => MonadReader r (m :: * -> *) | m -> r
ask :: MonadReader r m => m r
local :: MonadReader r m => (r -> r) -> m a -> m a
reader :: MonadReader r m => (r -> a) -> m a
-- | Retrieves a function of the current environment.
asks :: MonadReader r m => (r -> a) -> m a
class Monad m => MonadIO (m :: * -> *)
liftIO :: MonadIO m => IO a -> m a
|