Open
Description
Problem Description
Creating a process in a keybinding fails. I know this can be fixed by using
xfork, but I would like to know why it does not work like this.
See this reddit thread.
Configuration File
{-# LANGUAGE TypeApplications #-}
module Main (main) where
import XMonad
import System.Process (readProcess)
import Control.Monad (void)
import Data.Map (singleton)
import Control.Exception (try, SomeException)
main :: IO ()
main = xmonad def
{ keys = \cfg ->
singleton
(modMask cfg, xK_a)
(io $ do
x <- try @SomeException (readProcess "dmenu" [] "")
case x of
Left e -> spawn ("xmessage \"Error: " ++ show e ++ "\"")
Right _ -> spawn "xmessage Good!")
<> keys def cfg
}
This first starts dmenu normally then after you press enter (or escape) it opens an xmessage window with the text:
Error: waitForProcess: does not exist (No child processes)
Checklist
-
I've read CONTRIBUTING.md
-
I tested my configuration with xmonad-testing
xmonad-testing does not seem to be up-to-date anymore? I've tested this with xmonad 0.15
from Hackage.
Metadata
Metadata
Assignees
Labels
No labels