Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
{-# LANGUAGE ExistentialQuantification, ImpredicativeTypes, MultiParamTypeClasses, FlexibleInstances #-}
module Topics (topics) where
import XMonad
import XMonad.StackSet
import XMonad.Layout.Grid
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Tabbed
data LayoutBox a = forall l. LayoutClass l a => LB (l a)
instance Show (LayoutBox a) where
show (LB lc) = show lc
instance LayoutClass LayoutBox a where
runLayout ws@(Workspace _ (LB l) _) r = runLayout ws {layout = l} r
doLayout (LB lc) = doLayout lc
pureLayout (LB lc) = pureLayout lc
emptyLayout (LB lc) = emptyLayout lc
handleMessage (LB lc) = handleMessage lc
pureMessage (LB lc) = pureMessage lc
description (LB lc) = description lc
layouts :: [forall l a. LayoutClass l a => l a]
layouts = [simpleTabbedBottom, GridRatio 1.3 ||| Full]
topics :: [forall l1 l2 a. LayoutClass l1 a => (String, FilePath, Maybe String, Maybe (WorkspaceId -> l2 a -> PerWorkspace l1 l2 a))]
topics = [ ("1", "", Just "thunar", Nothing)
, ("2:web", "", Just "firefox", Just $ topicLayout simpleTabbedBottom)
, ("3:com", "", Just "icedove", Just $ topicLayout (GridRatio 1.3 ||| Full))
, ("4:sys", "", Nothing, Nothing)
where topicLayout = flip onWorkspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment