blob: c54a00fdb90a57e06a60019dabd64d4541029903 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
|