mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
Make the number of workspaces configurable.
This commit is contained in:
parent
9a5523d53c
commit
d280e17ab7
28
Main.hs
28
Main.hs
@ -30,11 +30,17 @@ import Control.Monad.State
|
|||||||
|
|
||||||
import W
|
import W
|
||||||
|
|
||||||
|
--
|
||||||
|
-- The number of workspaces:
|
||||||
|
--
|
||||||
|
workspaces :: Int
|
||||||
|
workspaces = 5
|
||||||
|
|
||||||
--
|
--
|
||||||
-- The keys list
|
-- The keys list
|
||||||
--
|
--
|
||||||
keys :: M.Map (KeyMask, KeySym) (W ())
|
keys :: M.Map (KeyMask, KeySym) (W ())
|
||||||
keys = M.fromList
|
keys = M.fromList $
|
||||||
[ ((mod1Mask .|. shiftMask, xK_Return), spawn "xterm")
|
[ ((mod1Mask .|. shiftMask, xK_Return), spawn "xterm")
|
||||||
, ((mod1Mask, xK_p ), spawn "exe=`dmenu_path | dmenu` && exec $exe")
|
, ((mod1Mask, xK_p ), spawn "exe=`dmenu_path | dmenu` && exec $exe")
|
||||||
, ((controlMask, xK_space ), spawn "gmrun")
|
, ((controlMask, xK_space ), spawn "gmrun")
|
||||||
@ -43,20 +49,12 @@ keys = M.fromList
|
|||||||
, ((mod1Mask, xK_k ), focus (-1))
|
, ((mod1Mask, xK_k ), focus (-1))
|
||||||
, ((mod1Mask .|. shiftMask, xK_c ), kill)
|
, ((mod1Mask .|. shiftMask, xK_c ), kill)
|
||||||
, ((mod1Mask .|. shiftMask, xK_q ), io $ exitWith ExitSuccess)
|
, ((mod1Mask .|. shiftMask, xK_q ), io $ exitWith ExitSuccess)
|
||||||
|
] ++
|
||||||
|
-- generate keybindings for each workspace:
|
||||||
|
[((m .|. mod1Mask, xK_0 + fromIntegral i), f i)
|
||||||
|
| i <- [1 .. workspaces]
|
||||||
|
, (f, m) <- [(view, 0), (tag, shiftMask)]]
|
||||||
|
|
||||||
, ((mod1Mask, xK_1 ), view 1)
|
|
||||||
, ((mod1Mask, xK_2 ), view 2)
|
|
||||||
, ((mod1Mask, xK_3 ), view 3)
|
|
||||||
, ((mod1Mask, xK_4 ), view 4)
|
|
||||||
, ((mod1Mask, xK_5 ), view 5)
|
|
||||||
|
|
||||||
, ((mod1Mask .|. shiftMask, xK_1 ), tag 1)
|
|
||||||
, ((mod1Mask .|. shiftMask, xK_2 ), tag 2)
|
|
||||||
, ((mod1Mask .|. shiftMask, xK_3 ), tag 3)
|
|
||||||
, ((mod1Mask .|. shiftMask, xK_4 ), tag 4)
|
|
||||||
, ((mod1Mask .|. shiftMask, xK_5 ), tag 5)
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- let's get underway
|
-- let's get underway
|
||||||
@ -69,7 +67,7 @@ main = do
|
|||||||
{ display = dpy
|
{ display = dpy
|
||||||
, screenWidth = displayWidth dpy dflt
|
, screenWidth = displayWidth dpy dflt
|
||||||
, screenHeight = displayHeight dpy dflt
|
, screenHeight = displayHeight dpy dflt
|
||||||
, workspace = (0,S.fromList (replicate 5 [])) -- 5 empty workspaces
|
, workspace = (0,S.fromList (replicate workspaces [])) -- empty workspaces
|
||||||
}
|
}
|
||||||
|
|
||||||
runW initState $ do
|
runW initState $ do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user