Skip to content

Instantly share code, notes, and snippets.

@Ou42
Created March 29, 2023 13:15
Show Gist options
  • Save Ou42/6355010c1829b7097b1fcf602b8c4beb to your computer and use it in GitHub Desktop.
Save Ou42/6355010c1829b7097b1fcf602b8c4beb to your computer and use it in GitHub Desktop.
xmonad complains when multiple layouts are defined ...
$ xmonad --recompile
XMonad will use stack ghc --stack-yaml "/home/me/.config/xmonad/stack.yaml" to recompile.
XMonad recompiling (forced).
Errors detected while compiling xmonad config: /home/me/.config/xmonad/xmonad.hs
$ stack build --silent --stack-yaml /home/me/.config/xmonad/stack.yaml
$ stack ghc --stack-yaml /home/me/.config/xmonad/stack.yaml -- --make xmonad.hs -i -ilib -fforce-recomp -main-is main -v0 -outputdir /home/me/.cache/xmonad/build-x86_64-linux -o /home/me/.cache/xmonad/xmonad-x86_64-linux
xmonad.hs:15:16: error:
• Couldn't match expected type ‘XMonad.Layout.Decoration.DefaultShrinker
-> Theme -> t1’
with actual type ‘t1’
‘t1’ is a rigid type variable bound by
the inferred type of
tabbed :: XMonad.Layout.Decoration.DefaultShrinker -> Theme -> t1
at xmonad.hs:15:5-63
• In the expression:
tabbed shrinkText def {fontName = "xft:Mono-16"}
In an equation for ‘tabbed’:
tabbed = tabbed shrinkText def {fontName = "xft:Mono-16"}
In an equation for ‘myLayout’:
myLayout
= tiled ||| Mirror tiled ||| Full ||| threeCol ||| tabbed
where
tabbed = tabbed shrinkText def {fontName = "xft:Mono-16"}
threeCol = ThreeColMid nmaster delta ratio
tiled = Tall nmaster delta ratio
nmaster = 1
....
• Relevant bindings include
tabbed :: XMonad.Layout.Decoration.DefaultShrinker -> Theme -> t1
(bound at xmonad.hs:15:5)
|
15 | tabbed = tabbed shrinkText def {fontName = "xft:Mono-16"}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
xmonad.hs:32:18: error:
• Couldn't match type ‘Theme -> t0’ with ‘GHC.Word.Word64’
Expected: Choose
Tall
(Choose
(Mirror Tall)
(Choose
Full
(Choose ThreeCol ((->) XMonad.Layout.Decoration.DefaultShrinker))))
Window
Actual: Choose
Tall
(Choose
(Mirror Tall)
(Choose
Full
(Choose ThreeCol ((->) XMonad.Layout.Decoration.DefaultShrinker))))
(Theme -> t0)
• In the ‘layoutHook’ field of a record
In the second argument of ‘($)’, namely
‘def
{borderWidth = 3, layoutHook = myLayout, modMask = mod4Mask,
terminal = "xfce4-terminal"}’
In the expression:
xmonad
$ def
{borderWidth = 3, layoutHook = myLayout, modMask = mod4Mask,
me at me-Ame-A10 in ~/.config/xmonad
$ xmonad --recompile
XMonad will use stack ghc --stack-yaml "/home/me/.config/xmonad/stack.yaml" to recompile.
XMonad recompiling (forced).
XMonad recompilation process exited with success!
me at me-Ame-A10 in ~/.config/xmonad
$ xmonad --recompile
XMonad will use stack ghc --stack-yaml "/home/me/.config/xmonad/stack.yaml" to recompile.
XMonad recompiling (forced).
XMonad recompilation process exited with success!
me at me-Ame-A10 in ~/.config/xmonad
$ xmonad --recompile
XMonad will use stack ghc --stack-yaml "/home/me/.config/xmonad/stack.yaml" to recompile.
XMonad recompiling (forced).
XMonad recompilation process exited with success!
me at me-Ame-A10 in ~/.config/xmonad
$ xmonad --recompile
XMonad will use stack ghc --stack-yaml "/home/me/.config/xmonad/stack.yaml" to recompile.
XMonad recompiling (forced).
XMonad recompilation process exited with success!
me at me-Ame-A10 in ~/.config/xmonad
$ xmonad --recompile
XMonad will use stack ghc --stack-yaml "/home/me/.config/xmonad/stack.yaml" to recompile.
XMonad recompiling (forced).
Errors detected while compiling xmonad config: /home/me/.config/xmonad/xmonad.hs
$ stack build --silent --stack-yaml /home/me/.config/xmonad/stack.yaml
$ stack ghc --stack-yaml /home/me/.config/xmonad/stack.yaml -- --make xmonad.hs -i -ilib -fforce-recomp -main-is main -v0 -outputdir /home/me/.cache/xmonad/build-x86_64-linux -o /home/me/.cache/xmonad/xmonad-x86_64-linux
xmonad.hs:29:18: error:
• Ambiguous type variable ‘a1’ arising from a use of ‘tabbed’
prevents the constraint ‘(Eq a1)’ from being solved.
Relevant bindings include
tabbedLayout01 :: XMonad.Layout.LayoutModifier.ModifiedLayout
(XMonad.Layout.Decoration.Decoration
TabbedDecoration XMonad.Layout.Decoration.DefaultShrinker)
XMonad.Layout.Simplest.Simplest
a1
(bound at xmonad.hs:29:1)
Probable fix: use a type annotation to specify what ‘a1’ should be.
These potential instances exist:
instance Eq FontSet -- Defined in ‘Graphics.X11.Xlib.Extras’
instance [safe] Eq Arc -- Defined in ‘Graphics.X11.Xlib.Types’
instance [safe] Eq Color -- Defined in ‘Graphics.X11.Xlib.Types’
...plus 41 others
...plus 54 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the expression: tabbed shrinkText (theme smallClean)
In an equation for ‘tabbedLayout01’:
tabbedLayout01 = tabbed shrinkText (theme smallClean)
|
29 | tabbedLayout01 = tabbed shrinkText (theme smallClean)
| ^^^^^^
xmonad.hs:30:18: error:
• Ambiguous type variable ‘a0’ arising from a use of ‘tabbed’
prevents the constraint ‘(Eq a0)’ from being solved.
Relevant bindings include
tabbedLayout02 :: XMonad.Layout.LayoutModifier.ModifiedLayout
(XMonad.Layout.Decoration.Decoration
TabbedDecoration XMonad.Layout.Decoration.DefaultShrinker)
XMonad.Layout.Simplest.Simplest
a0
(bound at xmonad.hs:30:1)
Probable fix: use a type annotation to specify what ‘a0’ should be.
These potential instances exist:
instance Eq FontSet -- Defined in ‘Graphics.X11.Xlib.Extras’
instance [safe] Eq Arc -- Defined in ‘Graphics.X11.Xlib.Types’
instance [safe] Eq Color -- Defined in ‘Graphics.X11.Xlib.Types’
...plus 41 others
...plus 54 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the expression: tabbed shrinkText (theme darkTheme)
In an equation for ‘tabbedLayout02’:
tabbedLayout02 = tabbed shrinkText (theme darkTheme)
|
30 | tabbedLayout02 = tabbed shrinkText (theme darkTheme)
| ^^^^^^
Please check the file for errors.
import XMonad
import XMonad.Layout.ThreeColumns
import XMonad.Layout.Tabbed
import XMonad.Util.EZConfig
import XMonad.Util.Themes
import XMonad.Util.Ungrab
-- doesn't work:
-- myLayout = tiled ||| Mirror tiled ||| Full
-- ||| threeCol ||| tabbed
-- works:
-- myLayout = tiled ||| Mirror tiled ||| Full ||| threeCol
-- ||| simpleTabbed
myLayout = tiled ||| Mirror tiled ||| Full ||| threeCol
||| simpleTabs ||| darkTabs
where
simpleTabs = tabbed shrinkText def {fontName = "xft:Mono-16"}
darkTabs = tabbed shrinkText (theme darkTheme) -- compiles?
threeCol = ThreeColMid nmaster delta ratio
tiled = Tall nmaster delta ratio
nmaster = 1
ratio = 1/2
delta = 3/100
-- Decordated Layouts only ?!
myTabsLayout01 = tabbed shrinkText (theme smallClean)
myTabsLayout02 = tabbed shrinkText (theme darkTheme)
main :: IO ()
main = xmonad $ def
{ borderWidth = 3
-- , layoutHook = myTabsLayout01
-- , layoutHook = myTabsLayout02
, layoutHook = myLayout
, modMask = mod4Mask -- Rebind Mod to the Super key
, terminal = "xfce4-terminal"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment