Implement recommendations from Brent's review

This commit is contained in:
Peter Jones
2017-01-03 15:46:07 -07:00
parent ab20f7df8d
commit e1c555e3e6
4 changed files with 35 additions and 14 deletions

View File

@@ -35,10 +35,16 @@
3. The `~/.xmonad` directory.
If none of these directories exist then (1) will be used if it is
set, otherwise (2) will be used. Of course, if neither (1) nor
(2) exist but (3) does then (3) will be used just like previous
versions of xmonad.
If none of these directories exist then an appropriate directory
will be created. If the relevant environment variable mentioned
in step (1) above is set, the referent directory will be created
and used. Otherwise the relevant XDG directory from (2) will be
used.
Note: If the environment variables mentioned in (1) above are not
set, the directories in (2) don't exist, and `~/.xmonad` does
exist, the traditional behavior of using `~/.xmonad` for
everything will be used.
This fixes a few issues, notably #7 and #56.
@@ -53,7 +59,8 @@
need to have newer time stamps than the generated executable in
order for the build script to be called.
This is one possible fix for issue #8.
This fixes #8. (One of two possible custom build solutions. See
the next entry for another solution.)
* For users who build their xmonad configuration using tools such as
cabal or stack, there is another option for executing xmonad.
@@ -70,7 +77,8 @@
See the documentation for the `launch` function in `XMonad.Main`
for more details.
This is another possible solution to issue #8.
Fixes #8. (Second way to have a custom build environment for
XMonad. See previous entry for another solution.)
## 0.12 (December 14, 2015)

View File

@@ -440,8 +440,14 @@ runOnWorkspaces job = do
$ current ws : visible ws
modify $ \s -> s { windowset = ws { current = c, visible = v, hidden = h } }
-- | Return the path to the xmonad configuration directory. Several
-- directories are considered. In order of preference:
-- | Return the path to the xmonad configuration directory. This
-- directory is where user configuration files are stored (e.g, the
-- xmonad.hs file). You may also create a @lib@ subdirectory in the
-- configuration directory and the default recompile command will add
-- it to the GHC include path.
--
-- Several directories are considered. In order of
-- preference:
--
-- 1. The directory specified in the @XMONAD_CONFIG_DIR@ environment variable.
-- 2. The @XDG_CONFIG_HOME/xmonad@ directory.
@@ -457,8 +463,11 @@ getXMonadDir =
, getAppUserDataDirectory "xmonad"
]
-- | Return the path to the xmonad cache directory. Several
-- directories are considered. In order of preference:
-- | Return the path to the xmonad cache directory. This directory is
-- used to store temporary files that can easily be recreated. For
-- example, the XPrompt history file.
--
-- Several directories are considered. In order of preference:
--
-- 1. The directory specified in the @XMONAD_CACHE_DIR@ environment variable.
-- 2. The @XDG_CACHE_HOME/xmonad@ directory.
@@ -474,8 +483,11 @@ getXMonadCacheDir =
, getAppUserDataDirectory "xmonad"
]
-- | Return the path to the xmonad data directory. Several
-- directories are considered. In order of preference:
-- | Return the path to the xmonad data directory. This directory is
-- used by XMonad to store data files such as the run-time state file
-- and the configuration binary generated by GHC.
--
-- Several directories are considered. In order of preference:
--
-- 1. The directory specified in the @XMONAD_DATA_DIR@ environment variable.
-- 2. The @XDG_DATA_HOME/xmonad@ directory.

View File

@@ -184,6 +184,8 @@ launch initxmc = do
-- (ugly, I know)
xSetErrorHandler -- in C, I'm too lazy to write the binding: dons
xinesc <- getCleanedScreenInfo dpy
nbc <- do v <- initColor dpy $ normalBorderColor xmc
~(Just nbc_) <- initColor dpy $ normalBorderColor Default.def
return (fromMaybe nbc_ v)
@@ -193,7 +195,6 @@ launch initxmc = do
return (fromMaybe fbc_ v)
hSetBuffering stdout NoBuffering
xinesc <- getCleanedScreenInfo dpy
let layout = layoutHook xmc
lreads = readsLayout layout

View File

@@ -469,7 +469,7 @@ writeStateToFile = do
readStateFile :: (LayoutClass l Window, Read (l Window)) => XConfig l -> X (Maybe XState)
readStateFile xmc = do
path <- stateFileName
raw <- userCode $ io (readFile path <* removeFile path)
raw <- userCode $ io (readFile path)
return $ do
sf <- maybeRead reads =<< raw