Confirmation prompt not appearing
rainer2208 opened this issue · 8 comments
I am on Arch Linux and trying my first xmonad setup. I have prior experience with i3, leftwm and AwesomeWm. I love window managers.
I am just getting started with xmonad and have added the following code to my xmonad.hs config file :
import XMonad.Prompt.ConfirmPrompt
mykeys ....
((modm , xK_l), confirmPrompt defaultXPConfig "exit" $ io (exitWith ExitSuccess))
According to the documentation, this should produce a confirmation message or dialogue. But it does not.
I have installed all xmonad packages I could find in the package manager, but to no avail.
Any hints?
Cool, haven't tried the recompile command, very useful ..
There are indeed a few errors, even after changing the code to confirmPrompt def "exit" $ io (exitWith ExitSuccess)
and installing 'xmessage'
xmonad.hs:160:7: error:
• Couldn't match expected type: ((KeyMask, KeySym), X ())
with actual type: (KeyMask, KeySym, X ())
• In the expression:
(modMask .|. shiftMask, xK_y,
confirmPrompt def "exit" $ io (exitWith ExitSuccess))
In the first argument of ‘(++)’, namely
‘[((modMask, xK_Return), spawn myTerminal),
((modMask, xK_d),
spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\""),
((modMask, xK_i), spawn myBrowser),
((modMask, xK_F12), spawn "rofi -show drun"), ....]’
In the second argument of ‘($)’, namely
‘[((modMask, xK_Return), spawn myTerminal),
((modMask, xK_d),
spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\""),
((modMask, xK_i), spawn myBrowser),
((modMask, xK_F12), spawn "rofi -show drun"), ....]
++
[((m .|. modMask, k), windows $ f i) |
(i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9],
(f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
++
[((m .|. modMask, key),
screenWorkspace sc >>= flip whenJust (windows . f)) |
(key, sc) <- zip [xK_w, xK_e, xK_r] [0 .. ],
(f, m) <- [(W.view, 0), (W.shift, shiftMask)]]’
|
160 | , (modMask .|. shiftMask, xK_y, confirmPrompt def "exit" $ io (exitWith ExitSuccess))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Please check the file for errors.
Warning: Missing charsets in String to FontSet conversion
Warning: Cannot convert string "-*-fixed-medium-r-normal-*-18-*-*-*-*-*-*-*,-*-fixed-*-*-*-*-18-*-*-*-*-*-*-*,-*-*-*-*-*-*-18-*-*-*-*-*-*-*" to type FontSet
~ ▓▒░ Warning: Missing charsets in String to FontSet conversiont 12:24:36
~ ▓▒░
The error is telling you that (a,b,c)
and ((a,b),c)
are two different things.
The warning is the font issue @slotThe mentioned; but since xmonad didn't recompile successfully, it's probably from xmessage.
I actually used the code that was provided ...
How do I get around the error ?
The code you initially showed was
((modm , xK_l), confirmPrompt defaultXPConfig "exit" $ io (exitWith ExitSuccess))
which is correct. The code the error message shows is
(modMask .|. shiftMask, xK_y, confirmPrompt def "exit" $ io (exitWith ExitSuccess))
which is wrong (it's a 3-tuple instead of a nested tuple). Use the first one.
many thanks for all the inputs, guys, I can't imagine the necessary to actually build xmonad..
That is the line that actually solved it, besides installing xmessage:
, ((modMask .|. shiftMask , xK_y ), confirmPrompt def "exit" $ io exitSuccess)
will do ....