Commands: added recent layout commands

This commit is contained in:
Andrea Rossato
2007-09-30 21:32:25 +00:00
parent 3ed5f5cde0
commit 7eea993964

View File

@@ -29,7 +29,7 @@ import XMonad
import Operations import Operations
import StackSet hiding (workspaces) import StackSet hiding (workspaces)
import XMonadContrib.Dmenu (dmenu) import XMonadContrib.Dmenu (dmenu)
import {-# SOURCE #-} Config (workspaces) import {-# SOURCE #-} Config (workspaces,possibleLayouts)
import qualified Data.Map as M import qualified Data.Map as M
import System.Exit import System.Exit
@@ -77,23 +77,26 @@ screenCommands = [((m ++ show sc), screenWorkspace (fromIntegral sc) >>= flip wh
defaultCommands :: [(String, X ())] defaultCommands :: [(String, X ())]
defaultCommands = workspaceCommands ++ screenCommands defaultCommands = workspaceCommands ++ screenCommands
++ [ ("shrink", sendMessage Shrink) ++ [ ("shrink" , sendMessage Shrink )
, ("expand", sendMessage Expand) , ("expand" , sendMessage Expand )
, ("restart-wm", restart Nothing True) , ("next-layout" , sendMessage NextLayout )
, ("restart-wm-no-resume", restart Nothing False) , ("previous-layout" , sendMessage PrevLayout )
, ("layout", sendMessage NextLayout) , ("default-layout" , setLayout (head possibleLayouts) )
, ("xterm", spawn "xterm") , ("restart-wm" , sr >> restart Nothing True )
, ("run", spawn "exe=`dmenu_path | dmenu -b` && exec $exe") , ("restart-wm-no-resume", sr >> restart Nothing False )
, ("kill", kill) , ("xterm" , spawn "xterm" )
, ("refresh", refresh) , ("run" , spawn "exe=`dmenu_path | dmenu -b` && exec $exe" )
, ("focus-up", windows $ focusUp) , ("kill" , kill )
, ("focus-down", windows $ focusDown) , ("refresh" , refresh )
, ("swap-up", windows $ swapUp) , ("focus-up" , windows $ focusUp )
, ("swap-down", windows $ swapDown) , ("focus-down" , windows $ focusDown )
, ("swap-master", windows $ swapMaster) , ("swap-up" , windows $ swapUp )
, ("sink", withFocused $ windows . sink) , ("swap-down" , windows $ swapDown )
, ("quit-wm", io $ exitWith ExitSuccess) , ("swap-master" , windows $ swapMaster )
, ("sink" , withFocused $ windows . sink )
, ("quit-wm" , io $ exitWith ExitSuccess )
] ]
where sr = broadcastMessage ReleaseResources
runCommand :: [(String, X ())] -> X () runCommand :: [(String, X ())] -> X ()
runCommand cl = do runCommand cl = do