From 2c5ea5f94aee8c5669598316e0376fe5082a1efd Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Sat, 20 Aug 2022 12:01:42 -0400 Subject: [PATCH] change `XMonad.Prompt.AppendFile` to use `mkAbsolutePath` --- CHANGES.md | 7 +++++++ XMonad/Prompt/AppendFile.hs | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 457ce104..bd29dfcf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/XMonad/Prompt/AppendFile.hs b/XMonad/Prompt/AppendFile.hs index 99fe376d..f802d737 100644 --- a/XMonad/Prompt/AppendFile.hs +++ b/XMonad/Prompt/AppendFile.hs @@ -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