<commit_before>-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.Actions.CycleWS
-- Copyright   :  (c) <NAME> <<EMAIL>>,
--                    <NAME> <<EMAIL>> (`toggleWS' function)
-- License     :  BSD3-style (see LICENSE)
--
-- Maintainer  :  <NAME> <<EMAIL>>
-- Stability   :  unstable
-- Portability :  unportable
--
-- Provides bindings to cycle forward or backward through the list
-- of workspaces, and to move windows there.
--
-----------------------------------------------------------------------------

module XMonad.Actions.CycleWS (
                              -- * Usage
                              -- $usage
                              nextWS,
                              prevWS,
                              shiftToNext,
                              shiftToPrev,
                              toggleWS,
                             ) where

import Control.Monad.Reader ( asks )
import Control.Monad.State ( gets )
import Data.List ( sortBy, findIndex )
import Data.Maybe ( fromMaybe )
import Data.Ord ( comparing )

import XMonad hiding (workspaces)
import qualified XMonad (workspaces)
import XMonad.StackSet hiding (filter)
import XMonad.Operations

-- $usage
-- You can use this module with the following in your Config.hs file:
--
-- > import XMonad.Actions.CycleWS
--
-- >   , ((modMask,               xK_Right), nextWS)
-- >   , ((modMask,               xK_Left),  prevWS)
-- >   , ((modMask .|. shiftMask, xK_Right), shiftToNext)
-- >   , ((modMask .|. shiftMask, xK_Left),  shiftToPrev)
-- >   , ((modMask,               xK_t),     toggleWS)
--
-- If you want to follow the moved window, you can use both actions:
--
-- >   , ((modMask .|. shiftMask, xK_Right), shiftToNext >> nextWS)
-- >   , ((modMask .|. shiftMask, xK_Left),  shiftToPrev >> prevWS)
--

-- %import XMonad.Actions.CycleWS
-- %keybind , ((modMask,               xK_Right), nextWS)
-- %keybind , ((modMask,               xK_Left),  prevWS)
-- %keybind , ((modMask .|. shiftMask, xK_Right), shiftToNext)
-- %keybind , ((modMask .|. shiftMask, xK_Left),  shiftToPrev)
-- %keybind , ((modMask,               xK_t),     toggleWS)


-- | Switch to next workspace
nextWS :: X ()
nextWS = switchWorkspace 1

-- | Switch to previous workspace
prevWS :: X ()
prevWS = switchWorkspace (-1)

-- | Move focused window to next workspace<commit_msg>CycleWS: haddock updates<commit_after>-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.Actions.CycleWS
-- Copyright   :  (c) <NAME> <<EMAIL>>,
--                    <NAME> <<EMAIL>> (`toggleWS' function)
-- License     :  BSD3-style (see LICENSE)
--
-- Maintainer  :  <NAME> <<EMAIL>>
-- Stability   :  unstable
-- Portability :  unportable
--
-- Provides bindings to cycle forward or backward through the list
-- of workspaces, and to move windows there.
--
-----------------------------------------------------------------------------

module XMonad.Actions.CycleWS (
                              -- * Usage
                              -- $usage
                              nextWS,
                              prevWS,
                              shiftToNext,
                              shiftToPrev,
                              toggleWS,
                             ) where

import Control.Monad.Reader ( asks )
import Control.Monad.State ( gets )
import Data.List ( sortBy, findIndex )
import Data.Maybe ( fromMaybe )
import Data.Ord ( comparing )

import XMonad hiding (workspaces)
import qualified XMonad (workspaces)
import XMonad.StackSet hiding (filter)
import XMonad.Operations

-- $usage
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@ file:
--
-- > import XMonad.Actions.CycleWS
--
-- >   , ((modMask,               xK_Right), nextWS)
-- >   , ((modMask,               xK_Left),  prevWS)
-- >   , ((modMask .|. shiftMask, xK_Right), shiftToNext)
-- >   , ((modMask .|. shiftMask, xK_Left),  shiftToPrev)
-- >   , ((modMask,               xK_t),     toggleWS)
--
-- If you want to follow the moved window, you can use both actions:
--
-- >   , ((modMask .|. shiftMask, xK_Right), shiftToNext >> nextWS)
-- >   , ((modMask .|. shiftMask, xK_Left),  shiftToPrev >> prevWS)
--
-- For detailed instructions on editing your key bindings, see
-- "XMonad.Doc.Extending#Editing_key_bindings".


-- | Switch to next workspace
nextWS :: X ()
nextWS = switchWorkspace 1

-- | Switch to previous workspace
prevWS :: X ()
prevWS = switchWorkspace (-1)

-- | Move focused window to next workspace
{'fraction_non_alphanumeric': 0.19059028534088435, 'fraction_numerical': 0.001306904813766064, 'mean_word_length': 1.5356156819436775, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6404995', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1304, 'n_words': 351}