change XMonad.Prompt.AppendFile to use mkAbsolutePath

This commit is contained in:
brandon s allbery kf8nh
2022-08-20 12:01:42 -04:00
parent 64eb4e46ec
commit 2c5ea5f94a
2 changed files with 9 additions and 1 deletions

View File

@@ -94,6 +94,11 @@
### Bug Fixes and Minor Changes
* `XMonad.Prompt.AppendFile`
- Use `XMonad.Prelude.mkAbsolutePath` to force names to be relative to the
home directory and support `~/` prefixes.
* `XMonad.Prompt.OrgMode`
- Fixes the date parsing issue such that entries with format of
@@ -225,6 +230,8 @@
- Added a `Default` instance for `UrgencyConfig` and `DzenUrgencyHook`.
[this PR]: https://github.com/xmonad/xmonad-contrib/pull/744
### Other changes
* Migrated the sample build scripts from the deprecated `xmonad-testing` repo to

View File

@@ -30,6 +30,7 @@ module XMonad.Prompt.AppendFile (
import XMonad.Core
import XMonad.Prompt
import XMonad.Prelude (mkAbsolutePath)
import System.IO
@@ -91,4 +92,4 @@ appendFilePrompt' c trans fn = mkXPrompt (AppendFile fn)
-- | Append a string to a file.
doAppend :: (String -> String) -> FilePath -> String -> X ()
doAppend trans fn = io . withFile fn AppendMode . flip hPutStrLn . trans
doAppend trans fn s = mkAbsolutePath fn >>= \f -> (io . withFile f AppendMode . flip hPutStrLn . trans) s