mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-10 17:51:51 -07:00
Add alt-c, kill client
This commit is contained in:
39
Main.hs
39
Main.hs
@@ -27,6 +27,21 @@ import Control.Monad.State
|
||||
|
||||
import W
|
||||
|
||||
--
|
||||
-- The keys list
|
||||
--
|
||||
keys :: [(KeyMask, KeySym, W ())]
|
||||
keys =
|
||||
[ (mod1Mask .|. shiftMask, xK_Return, spawn "xterm")
|
||||
, (mod1Mask, xK_p, spawn "exe=`dmenu_path | dmenu` && exec $exe")
|
||||
, (controlMask, xK_space, spawn "gmrun")
|
||||
, (mod1Mask, xK_Tab, focus 1)
|
||||
, (mod1Mask, xK_j, focus 1)
|
||||
, (mod1Mask, xK_k, focus (-1))
|
||||
, (mod1Mask .|. shiftMask, xK_c, kill)
|
||||
, (mod1Mask .|. shiftMask, xK_q, io $ exitWith ExitSuccess)
|
||||
]
|
||||
|
||||
--
|
||||
-- let's get underway
|
||||
--
|
||||
@@ -63,17 +78,6 @@ registerKeys dpy root =
|
||||
kc <- io (keysymToKeycode dpy sym)
|
||||
io $ grabKey dpy kc mod root True grabModeAsync grabModeAsync
|
||||
|
||||
keys :: [(KeyMask, KeySym, W ())]
|
||||
keys =
|
||||
[ (mod1Mask .|. shiftMask, xK_Return, spawn "xterm")
|
||||
, (mod1Mask, xK_p, spawn "exe=`dmenu_path | dmenu` && exec $exe")
|
||||
, (controlMask, xK_space, spawn "gmrun")
|
||||
, (mod1Mask, xK_Tab, focus 1)
|
||||
, (mod1Mask, xK_j, focus 1)
|
||||
, (mod1Mask, xK_k, focus (-1))
|
||||
, (mod1Mask .|. shiftMask, xK_q, io $ exitWith ExitSuccess)
|
||||
]
|
||||
|
||||
--
|
||||
-- The event handler
|
||||
--
|
||||
@@ -162,3 +166,16 @@ focus n = withWindows (rotate n)
|
||||
-- | spawn. Launch an external application
|
||||
spawn :: String -> W ()
|
||||
spawn = io_ . runCommand
|
||||
|
||||
-- | Kill the currently focused client
|
||||
kill :: W ()
|
||||
kill = do
|
||||
ws <- gets windows
|
||||
dpy <- gets display
|
||||
case ws of
|
||||
[] -> return ()
|
||||
(w:_) -> do
|
||||
-- if(isprotodel(sel))
|
||||
-- sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]);
|
||||
io $ xKillClient dpy w -- ignoring result
|
||||
return ()
|
||||
|
Reference in New Issue
Block a user