New patches: [add XMonad.Actions.CycleSelectedLayouts Roman Cheplyaka **20080116205020] { addfile ./XMonad/Actions/CycleSelectedLayouts.hs hunk ./XMonad/Actions/CycleSelectedLayouts.hs 1 +----------------------------------------------------------------------------- +-- | +-- Module : XMonad.Actions.CycleSelectedLayouts +-- Copyright : (c) Roman Cheplyaka +-- License : BSD3-style (see LICENSE) +-- +-- Maintainer : Roman Cheplyaka +-- Stability : unstable +-- Portability : unportable +-- +-- This module allows to cycle through the given subset of layouts. +-- +----------------------------------------------------------------------------- + +module XMonad.Actions.CycleSelectedLayouts ( + -- * Usage + -- $usage + cycleThroughLayouts) where + +import XMonad +import Data.List (findIndex) +import Data.Maybe (fromMaybe) +import XMonad.Layout.LayoutCombinators (JumpToLayout(..)) +import qualified XMonad.StackSet as S + +-- $usage +-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: +-- +-- > import XMonad hiding ((|||)) +-- > import XMonad.Layout.LayoutCombinators ((|||)) +-- > import XMonad.Actions.CycleSelectedLayouts +-- +-- > , ((modMask x, xK_t ), cycleThroughLayouts ["Tall", "Mirror Tall"]) +-- +-- Make sure you are using NewSelect from XMonad.Layout.LayoutCombinators, +-- rather than the Select defined in xmonad core. + +cycleToNext :: (Eq a) => [a] -> a -> Maybe a +cycleToNext lst a = do + -- not beautiful but simple and readable + ind <- findIndex (a==) lst + return $ lst !! if ind == length lst - 1 then 0 else ind+1 + +-- | If the current layout is in the list, cycle to the next layout. Otherwise, +-- apply the first layout from list. +cycleThroughLayouts :: [String] -> X () +cycleThroughLayouts lst = do + winset <- gets windowset + let ld = description . S.layout . S.workspace . S.current $ winset + let newld = fromMaybe (head lst) (cycleToNext lst ld) + sendMessage $ JumpToLayout newld hunk ./xmonad-contrib.cabal 55 + XMonad.Actions.CycleSelectedLayouts } Context: [Reflect.hs: minor haddock fix Brent Yorgey **20080116203546] [Reflect.hs: use -fglasgow-exts for now instead of LANGUAGE pragmas, for compatibility with ghc 6.6 Brent Yorgey **20080115194811] [Reflect.hs: add MultiToggle support Brent Yorgey **20080115193519] [MultiToggle.hs: improve 'description' implementation in LayoutClass instance to display the current transformed layout rather than just 'MultiToggle' Brent Yorgey **20080115193311] [Layout.Reflect: new contrib module for reflecting layouts horizontally/vertically Brent Yorgey **20080115030947] [ShowWName.hs: switch color/bgcolor in call to paintAndWrite Brent Yorgey **20080114153821] [Prompt: clean up and optimize moveWord a bit Andrea Rossato **20080113164745] [Prompt: added moveWord to move the cursor to the word boundaries Andrea Rossato **20080113123529 The actions have been bound to ctrl+Left and Right ] [Doc.Extending: added links and description of recent module addition Andrea Rossato **20080113093211] [Action.Search: small haddock fixes Andrea Rossato **20080113092646] [ShowWName now uses Timer and XUtils to display the workspace name Andrea Rossato **20080113091107] [Add XMonad.Util.Timer, a module to set up timers and to handle them Andrea Rossato **20080113090140] [de-obfuscate the initState and set the init offset to the length of the default text Andrea Rossato **20080110140951] [prompt: Allow to provide a default text in the prompt config. nicolas.pouillard@gmail.com**20080109213916] [Correct caps in module header. Joachim Fasting **20071230061920] [Use LANGUAGE pragma. Joachim Fasting **20071230061817] [shiftPrevScreen and shiftNextScreen, to make CycleWS consistent mail@joachim-breitner.de**20071231171609] [formatting Don Stewart **20071204174920] [PerWorkspace.hs: add an explanatory note Brent Yorgey **20071231135806] [Add ShowWName a layout modifier to show the workspace name Andrea Rossato **20071231130441 This module requires dzen ] [ManageDocks: some documentation fixes Andrea Rossato **20071231101820] [-Wall police (again) Spencer Janssen **20071228061841] [-Wall police Spencer Janssen **20071228061822] [Fulfill the EWMH specification by listing the supported ATOMs, doesnt really make a differene AFAIK mail@joachim-breitner.de**20071227215607] [display all visible windows on the current desktop in the pager mail@joachim-breitner.de**20071227204349 This is my best shot at modeling xmonad’s WM behaviour in a way that the Extended Window Manager Hints specification allows. Unfortunately, we can not tell the panel what size and position it should think the apps are. ] [Although I do not need the curr variable after all, this is nicer mail@joachim-breitner.de**20071227190113] [Add support for cycling through screens to CycleWS mail@joachim-breitner.de**20071227182635] [Clear _NET_ACTIVE_WINDOW when nothing is focused mail@joachim-breitner.de**20071228154222] [textExtentsXMF doesn't require the display Andrea Rossato **20071228125913] [Don't bother checking executable bits of items in $PATH, yields a significant speed-up Spencer Janssen **20071226032412] [ResizableTile.hs: fix resizing to work in the presence of floating windows (resolves issue #100) Brent Yorgey **20071225135839] [LayoutScreens: haddock fixes Andrea Rossato **20071225105316] [XMonad.Actions.Search: haddock fix Andrea Rossato **20071224171115] [Fix isssue 105 Andrea Rossato **20071224171020 issue 105 was due to the fact that tab windows created when bootstrapping the windowset after a restart where managed. Setting the override_redirect attributes to True fixes the issue. Added the possibility to set the override_redirect attribute with XMonad.Util.XUtils.creationNewWindow ] [Prompt.hs: mv .xmonad_history into .xmonad/ gwern0@gmail.com**20071224054610 See my email to mailing list. This will slightly break anyone who upgrades while running and expects to see their prompt history, and leave a stray file, I think, but nothing else, and it'll permanently improve tab-completion, and is tidier. ] [Search.hs: +docs, and export simpleEngine so users can define their own gwern0@gmail.com**20071224043828] [Search.hs: mv into Actions/ per IRC suggestion gwern0@gmail.com**20071224043735] [add XMonad.Actions.NoBorders Lukas Mai **20071220203953] [AvoidStruts: add support for partial struts Spencer Janssen **20071222133425] [Search.hs: add hoogle Brent Yorgey **20071222184912] [ManageDocks: ignore desktop windows also Spencer Janssen **20071222113808] [Wibble Spencer Janssen **20071222110641] [EwmhDesktops: add _NET_ACTIVE_WINDOW support Spencer Janssen **20071222110552] [A few short comments for WorkspaceCompare Spencer Janssen **20071222105045] [EwmhDesktops: drop 'Workspace' from displayed workspace names Spencer Janssen **20071222104559] [Factor workspace sorting into a separate module Spencer Janssen **20071222104114] [No more tabs Spencer Janssen **20071222050439] [Refactor Search.hs Spencer Janssen **20071222044714] [Generalize XSelection functions to MonadIO Spencer Janssen **20071222044514] [Search.hs: +imdb & amazon engines for unk_red gwern0@gmail.com**20071222035837] [Search.hs: cleanup and refactor gwern0@gmail.com**20071220174001] [Update various restart bindings Spencer Janssen **20071219220634] [Doc/Developing.hs: add some information about Haddock documentation. Brent Yorgey **20071219215300] [require haddock documentation to build successfully in order to record a patch. Brent Yorgey **20071219215217] [Fix typo. Roman Cheplyaka **20071219073857] [Remove inaccurate comment about 'banish' Spencer Janssen **20071217231540] [Warp.hs: haddock fixes Brent Yorgey **20071217224712] [Warp.hs: +doc gwern0@gmail.com**20071216030015 Describe how to emulate Ratpoison's 'banish' functionality on one's config ] [Util/Search.hs: a few updates/fixes Brent Yorgey **20071217222930 * fix shadowing warning (ghc 6.8.2 complains) * export a few more of the functions * re-de-obfuscate generated URLs by not escaping alphanumerics or punct. ] [Util.Search: import escapeURIString, and fall back on the ugly const false hack to avoid copy-pasting even more gwern0@gmail.com**20071215211638] [update Config.Droundy to use a few nice hooks. David Roundy **20071216185653] [Add UrgencyHook support to Tabbed Shachaf Ben-Kiki **20071215171617] [DynamicLog.hs: some documentation updates. Brent Yorgey **20071215143727] [DynamicLog.hs: fix shadowing warning Brent Yorgey **20071215143227] [Add UrgencyHook support to DynamicLog Shachaf Ben-Kiki **20071214043528 Someone with Xinerama should look at this -- I don't know exactly how that should behave. ] [Depend on X11-1.4.1, it has crucial bugfixes Spencer Janssen **20071215022151] [Remove network dependency, potentially breaking XMonad.Util.Search Spencer Janssen **20071214231859] [Search.hs: fix shadowing warning and haddock errors Brent Yorgey **20071214163119] [+cabal support for XMonad.Util.Search gwern0@gmail.com**20071213205654] [+XMonad.Util.Search: new module gwern0@gmail.com**20071213205159 This module is intended to provide helpful functions for easily running web searchs; just hit a bound key, enter your query, and up opens a new tab/browser/window with the search results. In theory anyway; the Wikipedia and Google ones work fine for me, but the Internet Archive's docs on how to do don't necessarily seem to be correct. If you were, like me, previously running shell commands to call Surfraw or similar shell scripts to do the same thing, you can now scrap them and replace them. There aren't too many search engines defined here; new ones would be good, and they're easy to add! ] [Add support for _NET_WM_STRUT_PARTIAL Spencer Janssen **20071213021704] [ManageDocks: when there are struts on opposing edges, the right/bottom strut Spencer Janssen **20071210021030 was ignored. TODO: quickchecks ] [Run.hs: fix documentation, cleanup whitespace "Valery V. Vorotyntsev" **20071212091516] [Man.hs: input speedup "Valery V. Vorotyntsev" **20071212090256 Descend manpage directories once -- when `manPrompt' is called. (Previous version used to search directories upon each character arrival.) ] [new XMonad.Hooks.ManageHelpers module Lukas Mai **20071211183040] [Magnifier: custom zoom ratio for magnifier' too intrigeri@boum.org**20071211015554] [Magnifier.hs: minor haddock fixes Brent Yorgey **20071211011154] [fix haddock on Magnifier tim.thelion@gmail.com**20071210231942] [Custom zoom levels for magnifier tim.thelion@gmail.com**20071208230844] [TAG 0.5 Spencer Janssen **20071209233056] Patch bundle hash: 52b371db06322d3e319702ac3cb8f18f1e059de1