From 729e030dd25da2e36fa5a1312b8ecb3415dc1675 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Tue, 23 Nov 2021 03:19:06 +0300 Subject: Huge update --- src/lib/XMonad/Custom/Prompt.hs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/lib/XMonad/Custom/Prompt.hs (limited to 'src/lib/XMonad/Custom/Prompt.hs') diff --git a/src/lib/XMonad/Custom/Prompt.hs b/src/lib/XMonad/Custom/Prompt.hs new file mode 100644 index 0000000..c54a00f --- /dev/null +++ b/src/lib/XMonad/Custom/Prompt.hs @@ -0,0 +1,28 @@ +-- | +-- Module : XMonad.Custom.Prompt +-- Description : Prompt configuration +-- Copyright : (c) Azat Bahawi 2018-2021 +-- SPDX-License-Identifier : GPL-3.0-or-later +-- Maintainer : azahi@teknik.io +-- Stability : experimental +-- Portability : non-portable +-- + +module XMonad.Custom.Prompt + ( listCompFunc + , aListCompFunc + , predicateFunction + ) where + +import Data.Char +import Data.List ( isInfixOf ) +import XMonad.Prompt + +listCompFunc :: XPConfig -> [String] -> String -> IO [String] +listCompFunc c xs s = return (filter (searchPredicate c s) xs) + +aListCompFunc :: XPConfig -> [(String, a)] -> String -> IO [String] +aListCompFunc c xs = listCompFunc c (map fst xs) + +predicateFunction :: String -> String -> Bool +predicateFunction x y = lc x `isInfixOf` lc y where lc = map toLower -- cgit 1.4.1