diff --git a/CHANGES.md b/CHANGES.md index f5b01092..3784c991 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,8 @@ - It is now ensured that all arguments of `execute` and `eval` are quoted. + - Added `findFile` as a shorthand to call `find-file`. + ### Other changes ## 0.17.1 (September 3, 2022) diff --git a/XMonad/Util/Run.hs b/XMonad/Util/Run.hs index 735d2cc3..75983c6f 100644 --- a/XMonad/Util/Run.hs +++ b/XMonad/Util/Run.hs @@ -75,6 +75,7 @@ module XMonad.Util.Run ( require, progn, quote, + findFile, -- * Re-exports hPutStr, @@ -454,6 +455,13 @@ require = inParens . ("require " <>) . quote quote :: String -> String quote = inParens . ("quote " <>) +-- | Call @find-file@. +-- +-- >>> findFile "/path/to/file" +-- "(find-file \"/path/to/file\" )" +findFile :: String -> String +findFile = inParens . ("find-file" <>) . asString + ----------------------------------------------------------------------- -- Batch mode