Skip to content

Instantly share code, notes, and snippets.

@coyotebush
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coyotebush/bc6c1a4f56e4cdc59b6a to your computer and use it in GitHub Desktop.
Save coyotebush/bc6c1a4f56e4cdc59b6a to your computer and use it in GitHub Desktop.
{-# 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