Update xmonad.hs

b1d391c98d6c6605838666152eb7c1dc24a90b99
Alexis Sellier committed ago 1 parent 78b9b53a
.xmonad/xmonad.hs +10 -4
11 11
import XMonad.Hooks.EwmhDesktops
12 12
import XMonad.Actions.CycleWS
13 13
import XMonad.Util.EZConfig (additionalKeys, additionalKeysP)
14 14
import XMonad.Prompt
15 15
import XMonad.Prompt.XMonad
16 -
import XMonad.Prompt.Input
17 16
18 17
import XMonad.Hooks.UrgencyHook
19 18
import XMonad.Hooks.FloatNext
20 19
21 20
import Graphics.X11.ExtraTypes.XF86
27 26
import Text.Printf
28 27
import Data.Map (Map)
29 28
import qualified Data.Map as Map
30 29
import Control.Monad
31 30
31 +
data InputPrompt = InputPrompt String
32 +
33 +
instance XPrompt InputPrompt where
34 +
    showXPrompt (InputPrompt s) = " " ++ s
35 +
36 +
inputPrompt :: XPConfig -> String -> X (Maybe String)
37 +
inputPrompt c p = mkXPromptWithReturn (InputPrompt p) c (const (pure [])) return
38 +
32 39
data EnterPrompt = EnterPrompt String
33 40
34 41
instance XPrompt EnterPrompt where
35 42
    showXPrompt (EnterPrompt n) = " " ++ n ++ " "
36 43
47 54
    cfg = myXPConfig { position = CenteredAt 0.5 0.3
48 55
                     , defaultText = "" }
49 56
50 57
editPrompt :: String -> X ()
51 58
editPrompt home = do
52 -
    str <- inputPrompt cfg "Edit (~)"
59 +
    str <- inputPrompt cfg "✎ ~/"
53 60
    case str of
54 61
        Just s  -> openInEditor s
55 62
        Nothing -> pure ()
56 63
  where
57 64
    cfg = myXPConfig { position = CenteredAt 0.5 0.3
132 139
myXPConfig = def
133 140
  { position          = CenteredAt 0.5 0.1
134 141
  , alwaysHighlight   = True
135 142
  , height            = 60
136 143
  , promptBorderWidth = 1
137 -
  , font              = "xft:Fira Code:size=13"
144 +
  , font              = "xft:monospace:size=13"
138 145
  , borderColor       = "#555555"
139 146
  , bgColor           = "#111111"
140 147
  }
141 148
142 149
myKeys :: FilePath -> XConfig Layout -> Map (KeyMask, KeySym) (X ())
172 179
            , "-color-window", "#111,#555"
173 180
            , "-font", "Fira Code 13"
174 181
            , "-hide-scrollbar"
175 182
            , "-levenshtein-sort"
176 183
            , "-lines", "7"
177 -
            , "-matching", "fuzzy"
178 184
            , "-padding", "10"
179 185
            , "-separator-style", "none"
180 186
            , "-width", "30"
181 187
            ])
182 188