Merge branch 'master' into master

This commit is contained in:
Brent Yorgey 2017-07-24 11:37:32 -04:00 committed by GitHub
commit dcc2a69fbc
7 changed files with 44 additions and 23 deletions

View File

@ -129,6 +129,10 @@
- Now has `withFirstMinimized` and `withFirstMinimized'` so you can perform - Now has `withFirstMinimized` and `withFirstMinimized'` so you can perform
actions with both the last and first minimized windows easily. actions with both the last and first minimized windows easily.
* `XMonad.Config.Gnome`
- Update logout key combination (modm+shift+Q) to work with modern
## 0.13 (February 10, 2017) ## 0.13 (February 10, 2017)
### Breaking Changes ### Breaking Changes

View File

@ -6,9 +6,9 @@ You need the ghc compiler and xmonad window manager installed in
order to use these extensions. order to use these extensions.
For installation and configuration instructions, please see the For installation and configuration instructions, please see the
[xmonad website] [xmonad], the documents included with the [xmonad website][xmonad], the documents included with the
[xmonad source distribution] [xmonad-git], and the [xmonad source distribution][xmonad-git], and the
[online haddock documentation] [xmonad-docs]. [online haddock documentation][xmonad-docs].
## Getting or Updating XMonadContrib ## Getting or Updating XMonadContrib
@ -17,7 +17,7 @@ For installation and configuration instructions, please see the
* Git version: <https://github.com/xmonad/xmonad-contrib> * Git version: <https://github.com/xmonad/xmonad-contrib>
(To use git xmonad-contrib you must also use the (To use git xmonad-contrib you must also use the
[git version of xmonad] [xmonad-git].) [git version of xmonad][xmonad-git].)
## Contributing ## Contributing
@ -28,15 +28,15 @@ example, to use the Grid layout, one would import:
XMonad.Layout.Grid XMonad.Layout.Grid
For further details, see the [documentation] [developing] for the For further details, see the [documentation][developing] for the
`XMonad.Doc.Developing` module and the [xmonad website] [xmonad]. `XMonad.Doc.Developing` module, XMonad's [CONTRIBUTING.md](https://github.com/xmonad/xmonad/blob/master/CONTRIBUTING.md) and the [xmonad website][xmonad].
## License ## License
Code submitted to the contrib repo is licensed under the same license as Code submitted to the contrib repo is licensed under the same license as
xmonad itself, with copyright held by the authors. xmonad itself, with copyright held by the authors.
[xmonad]: http://xmonad.org [xmonad]: http://xmonad.org
[xmonad-git]: https://github.com/xmonad/xmonad [xmonad-git]: https://github.com/xmonad/xmonad
[xmonad-docs]: http://www.xmonad.org/xmonad-docs [xmonad-docs]: http://hackage.haskell.org/package/xmonad
[developing]: http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Doc-Developing.html [developing]: http://hackage.haskell.org/package/xmonad-contrib/docs/XMonad-Doc-Developing.html

View File

@ -19,6 +19,7 @@ module XMonad.Actions.Commands (
-- $usage -- $usage
commandMap, commandMap,
runCommand, runCommand,
runCommandConfig,
runCommand', runCommand',
workspaceCommands, workspaceCommands,
screenCommands, screenCommands,
@ -103,11 +104,18 @@ defaultCommands = do
] ]
-- | Given a list of command\/action pairs, prompt the user to choose a -- | Given a list of command\/action pairs, prompt the user to choose a
-- command and return the corresponding action. -- command using dmenu and return the corresponding action.
runCommand :: [(String, X ())] -> X () runCommand :: [(String, X ())] -> X ()
runCommand cl = do runCommand = runCommandConfig dmenu
-- | Given a list of command\/action pairs, prompt the user to choose a
-- command using dmenu-compatible launcher and return the corresponding action.
-- See X.U.Dmenu for compatible launchers.
runCommandConfig :: ([String] -> X String) -> [(String, X ())] -> X()
runCommandConfig f cl = do
let m = commandMap cl let m = commandMap cl
choice <- dmenu (M.keys m) choice <- f (M.keys m)
fromMaybe (return ()) (M.lookup choice m) fromMaybe (return ()) (M.lookup choice m)
-- | Given the name of a command from 'defaultCommands', return the -- | Given the name of a command from 'defaultCommands', return the

View File

@ -47,7 +47,7 @@ gnomeConfig = desktopConfig
gnomeKeys (XConfig {modMask = modm}) = M.fromList $ gnomeKeys (XConfig {modMask = modm}) = M.fromList $
[ ((modm, xK_p), gnomeRun) [ ((modm, xK_p), gnomeRun)
, ((modm .|. shiftMask, xK_q), spawn "gnome-session-save --kill") ] , ((modm .|. shiftMask, xK_q), spawn "gnome-session-quit --logout") ]
-- | Launch the "Run Application" dialog. gnome-panel must be running for this -- | Launch the "Run Application" dialog. gnome-panel must be running for this
-- to work. -- to work.

View File

@ -14,7 +14,9 @@
-- be used for tiling, along with support for toggling gaps on and -- be used for tiling, along with support for toggling gaps on and
-- off. -- off.
-- --
-- Note that "XMonad.Hooks.ManageDocks" is the preferred solution for -- Note 1: For gaps\/space around /windows/ see "XMonad.Layout.Spacing".
--
-- Note 2: "XMonad.Hooks.ManageDocks" is the preferred solution for
-- leaving space for your dock-type applications (status bars, -- leaving space for your dock-type applications (status bars,
-- toolbars, docks, etc.), since it automatically sets up appropriate -- toolbars, docks, etc.), since it automatically sets up appropriate
-- gaps, allows them to be toggled, etc. However, this module may -- gaps, allows them to be toggled, etc. However, this module may

View File

@ -12,6 +12,8 @@
-- Portability : portable -- Portability : portable
-- --
-- Add a configurable amount of space around windows. -- Add a configurable amount of space around windows.
--
-- Note: For space\/gaps along edges of the /screen/ see "XMonad.Layout.Gaps".
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
module XMonad.Layout.Spacing ( module XMonad.Layout.Spacing (

View File

@ -24,6 +24,7 @@ import XMonad
import qualified XMonad.StackSet as W import qualified XMonad.StackSet as W
import qualified Data.Map as M import qualified Data.Map as M
import XMonad.Util.Run import XMonad.Util.Run
import Control.Monad (liftM)
-- $usage -- $usage
-- You can use this module with the following in your Config.hs file: -- You can use this module with the following in your Config.hs file:
@ -41,28 +42,32 @@ import XMonad.Util.Run
-- <http://www.jcreigh.com/dmenu/dmenu-3.2-xinerama.patch> -- <http://www.jcreigh.com/dmenu/dmenu-3.2-xinerama.patch>
dmenuXinerama :: [String] -> X String dmenuXinerama :: [String] -> X String
dmenuXinerama opts = do dmenuXinerama opts = do
curscreen <- (fromIntegral . W.screen . W.current) `fmap` gets windowset :: X Int curscreen <-
runProcessWithInput "dmenu" ["-xs", show (curscreen+1)] (unlines opts) (fromIntegral . W.screen . W.current) `fmap` gets windowset :: X Int
_ <-
runProcessWithInput "dmenu" ["-xs", show (curscreen+1)] (unlines opts)
menuArgs "dmenu" ["-xs", show (curscreen+1)] opts menuArgs "dmenu" ["-xs", show (curscreen+1)] opts
-- | Run dmenu to select an option from a list. -- | Run dmenu to select an option from a list.
dmenu :: [String] -> X String dmenu :: MonadIO m => [String] -> m String
dmenu opts = menu "dmenu" opts dmenu opts = menu "dmenu" opts
-- | like 'dmenu' but also takes the command to run. -- | like 'dmenu' but also takes the command to run.
menu :: String -> [String] -> X String menu :: MonadIO m => String -> [String] -> m String
menu menuCmd opts = menuArgs menuCmd [] opts menu menuCmd opts = menuArgs menuCmd [] opts
-- | Like 'menu' but also takes a list of command line arguments. -- | Like 'menu' but also takes a list of command line arguments.
menuArgs :: String -> [String] -> [String] -> X String menuArgs :: MonadIO m => String -> [String] -> [String] -> m String
menuArgs menuCmd args opts = fmap (filter (/='\n')) $ runProcessWithInput menuCmd args (unlines opts) menuArgs menuCmd args opts = liftM (filter (/='\n')) $
runProcessWithInput menuCmd args (unlines opts)
-- | Like 'dmenuMap' but also takes the command to run. -- | Like 'dmenuMap' but also takes the command to run.
menuMap :: String -> M.Map String a -> X (Maybe a) menuMap :: MonadIO m => String -> M.Map String a -> m (Maybe a)
menuMap menuCmd selectionMap = menuMapArgs menuCmd [] selectionMap menuMap menuCmd selectionMap = menuMapArgs menuCmd [] selectionMap
-- | Like 'menuMap' but also takes a list of command line arguments. -- | Like 'menuMap' but also takes a list of command line arguments.
menuMapArgs :: String -> [String] -> M.Map String a -> X (Maybe a) menuMapArgs :: MonadIO m => String -> [String] -> M.Map String a ->
m (Maybe a)
menuMapArgs menuCmd args selectionMap = do menuMapArgs menuCmd args selectionMap = do
selection <- menuFunction (M.keys selectionMap) selection <- menuFunction (M.keys selectionMap)
return $ M.lookup selection selectionMap return $ M.lookup selection selectionMap
@ -70,5 +75,5 @@ menuMapArgs menuCmd args selectionMap = do
menuFunction = menuArgs menuCmd args menuFunction = menuArgs menuCmd args
-- | Run dmenu to select an entry from a map based on the key. -- | Run dmenu to select an entry from a map based on the key.
dmenuMap :: M.Map String a -> X (Maybe a) dmenuMap :: MonadIO m => M.Map String a -> m (Maybe a)
dmenuMap selectionMap = menuMap "dmenu" selectionMap dmenuMap selectionMap = menuMap "dmenu" selectionMap