1

Since resetting my xorg.conf to use a second monitor, XMonad.Layout.NoBorders.smartBorders no longer works: Even if there is only one window open on either monitor, and no docks, the main window still has a border.

Might anyone have an idea of how to proceed debugging? Such as by dumping the XMonad stackset to stdout? Thank you.

edit: Alternatively, assuming the implementation of smartBorders is incorrect or is having a strange interaction with other layoutHooks or I'm making an error, is there a quick-and-easy way to write a layoutHook which checks the XMonad stackset, checks if length the_current_stack (windows in the current screen) is 1, and then dynamically switches the layout to fullscreen (and vice versa if a new window is opened)?

edit: noBorders seems to work. Other modules such as the smartBorder flag in XMonad.Layout.Spacing.smartBorder have no trouble working in multi-screen mode. There seems to be a section in the code above at the bottom involving an 'Ambiguity' combinator.

  • I don't know what the stackset is, but it would help to post your xmonad config (and any other relevant config details, like your xorg.conf) somewhere. – celadon Mar 5 at 1:48
  • The minimal test case is the default xorg.conf (with the second screen toggled on (Xinerama off)), and the default xmonad.hs (with layoutHook = smartBorders some_layout). It seems necessary to plumb the XMonad internals. – ninjagecko Mar 5 at 2:34
1

You could define a X () that could be triggered via keybinding.

For example:

import System.IO

debugStuff :: X ()
debugStuff = withWindowSet (\ws -> do
    liftIO $ print ws
    liftIO $ logToTmpFile $ show ws 
  )

myAppendFile :: FilePath -> String -> IO ()
myAppendFile f s = do
  withFile f AppendMode $ \h -> do
    hPutStrLn h s

logToTmpFile :: String -> IO ()
logToTmpFile = myAppendFile "/tmp/xmonad.log" . (++ "\n")

Bind debugStuff to a keybinding.

| improve this answer | |
  • Thank you! I am still new to the standard library so this was quite helpful thanks. – ninjagecko Mar 9 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.