ENH add log contraints to spawnpipe
This commit is contained in:
parent
0895586cf7
commit
6891238793
|
@ -210,7 +210,7 @@ runClipMenu = sometimesIO_ "clipboard manager" "rofi greenclip" tree act
|
||||||
-- Shortcut menu
|
-- Shortcut menu
|
||||||
|
|
||||||
runShowKeys
|
runShowKeys
|
||||||
:: MonadUnliftIO m
|
:: (MonadReader env m, HasLogFunc env, MonadUnliftIO m)
|
||||||
=> Always ([((KeyMask, KeySym), NamedAction)] -> m ())
|
=> Always ([((KeyMask, KeySym), NamedAction)] -> m ())
|
||||||
runShowKeys =
|
runShowKeys =
|
||||||
Always "keyboard menu" $
|
Always "keyboard menu" $
|
||||||
|
@ -225,7 +225,7 @@ runShowKeys =
|
||||||
defNoteError {body = Just $ Text "could not display keymap"}
|
defNoteError {body = Just $ Text "could not display keymap"}
|
||||||
|
|
||||||
showKeysDMenu
|
showKeysDMenu
|
||||||
:: MonadUnliftIO m
|
:: (MonadReader env m, HasLogFunc env, MonadUnliftIO m)
|
||||||
=> SubfeatureRoot ([((KeyMask, KeySym), NamedAction)] -> m ())
|
=> SubfeatureRoot ([((KeyMask, KeySym), NamedAction)] -> m ())
|
||||||
showKeysDMenu =
|
showKeysDMenu =
|
||||||
Subfeature
|
Subfeature
|
||||||
|
@ -233,7 +233,10 @@ showKeysDMenu =
|
||||||
, sfData = IORoot_ showKeys $ Only_ dmenuDep
|
, sfData = IORoot_ showKeys $ Only_ dmenuDep
|
||||||
}
|
}
|
||||||
|
|
||||||
showKeys :: MonadUnliftIO m => [((KeyMask, KeySym), NamedAction)] -> m ()
|
showKeys
|
||||||
|
:: (MonadReader env m, HasLogFunc env, MonadUnliftIO m)
|
||||||
|
=> [((KeyMask, KeySym), NamedAction)]
|
||||||
|
-> m ()
|
||||||
showKeys kbs = do
|
showKeys kbs = do
|
||||||
h <- spawnPipe cmd
|
h <- spawnPipe cmd
|
||||||
B.hPut h $ BC.unlines $ BC.pack <$> showKm kbs
|
B.hPut h $ BC.unlines $ BC.pack <$> showKm kbs
|
||||||
|
|
|
@ -85,7 +85,10 @@ spawn :: MonadIO m => T.Text -> m ()
|
||||||
spawn = X.spawn . T.unpack
|
spawn = X.spawn . T.unpack
|
||||||
|
|
||||||
-- | Run 'XMonad.Run.Utils.spawnPipe' with 'Text' input.
|
-- | Run 'XMonad.Run.Utils.spawnPipe' with 'Text' input.
|
||||||
spawnPipe :: MonadIO m => T.Text -> m Handle
|
spawnPipe
|
||||||
|
:: (MonadReader env m, HasLogFunc env, MonadUnliftIO m)
|
||||||
|
=> T.Text
|
||||||
|
-> m Handle
|
||||||
spawnPipe = XR.spawnPipe . T.unpack
|
spawnPipe = XR.spawnPipe . T.unpack
|
||||||
|
|
||||||
-- | Run 'XMonad.Core.spawn' with a command and arguments
|
-- | Run 'XMonad.Core.spawn' with a command and arguments
|
||||||
|
|
Loading…
Reference in New Issue