purebred-0.1.0.0: An mail user agent built around notmuch

Safe HaskellNone
LanguageHaskell2010

Purebred

Description

Synopsis

To customise purebred configuration, create ~/.config/purebred/purebred.hs and change the default config to your liking. For example, the following configuration adds some custom keybindings:

import Purebred

scrollKeybindings :: (Scrollable w) => [Keybinding v w]
scrollKeybindings =
  [ Keybinding (EvKey (KChar j) []) (scrollDown `chain` continue)
  , Keybinding (EvKey (KChar k) []) (scrollUp `chain` continue)
  , Keybinding (EvKey (KChar d) []) (scrollPageDown `chain` continue)
  , Keybinding (EvKey (KChar u) []) (scrollPageUp `chain` continue)
  ]

mailViewKeybindings =
  [ Keybinding (EvKey (KChar J) []) (listDown `chain'` displayMail `chain` continue)
  , Keybinding (EvKey (KChar K) []) (listUp `chain'` displayMail `chain` continue)
  , Keybinding (EvKey (KChar G) []) (listJumpToEnd `chain` continue)
  , Keybinding (EvKey (KChar g) []) (listJumpToStart `chain` continue)
  ]
  <> scrollKeybindings

main = purebred $ tweak defaultConfig where
  tweak =
    over (confMailView . mvKeybindings) (mailViewKeybindings <>)
    . over (confHelpView . hvKeybindings) (scrollKeybindings <>)

The invoke the program, just run purebred:

Overriding the config directory

If you want to override the configuration file location, use the PUREBRED_CONFIG_DIR environment variable. The configuration file, located in this directory, must always be name purebred.hs.

The binary is normally cached in ~/.cache/purebred/. If you override the configuration directory, the configuration directory is also used as the cache directory, to avoid clobbering the cached binary for the other configurations.

Recompilation

Passing extra arguments to GHC

If you want to pass extra arguments to GHC, use the GHCOPTS environment variable. For example, to compile with profiling:

GHCOPTS="-prof" purebred

Note that the presence of the GHCOPTS environment variable will not force recompilation to occur. To force recompilation you could make a benign change to the custom configuration file (e.g. add or remove an empty line).

With Cabal (newstyle)

purebred should be able to determine the correct package-id and pass this datum to GHC when recompiling. Whether running from the repository or not, recompile should just work, regardless of where you are running the program from.

With Stack

If recompilation is needed and you used stack to build and install the program, it will not be able to find the libraries:

ftweedal% purebred
Configuration '/home/ftweedal/.config/purebred/purebred.hs' changed. Recompiling.
Error occurred while loading configuration file.
Launching custom binary /home/ftweedal/.cache/purebred/purebred-linux-x86_64

purebred-linux-x86_64: 
/home/ftweedal/.config/purebred/purebred.hs:4:1: error:
    Could not find module ‘Purebred’
    Use -v to see a list of the files searched for.
  |
4 | import Purebred
  | ^^^^^^^^^^^^^^^

CallStack (from HasCallStack):
  error, called at src/Purebred.hs:205:32 in purebred-0.1.0.0-8yyFpK6IBghCAYUvNAhJRk:Purebred

To avoid this, don't use stack. But if you insist, you can run stack exec purebred from the source tree.

Synopsis

Documentation

module Types

module Error

module UI.Actions

data Event #

Constructors

EvKey Key [Modifier] 
EvMouseDown Int Int Button [Modifier] 
EvMouseUp Int Int (Maybe Button) 
EvResize Int Int 
EvPaste ByteString 
EvLostFocus 
EvGainedFocus 
Instances
Eq Event 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

(==) :: Event -> Event -> Bool

(/=) :: Event -> Event -> Bool

Ord Event 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

compare :: Event -> Event -> Ordering

(<) :: Event -> Event -> Bool

(<=) :: Event -> Event -> Bool

(>) :: Event -> Event -> Bool

(>=) :: Event -> Event -> Bool

max :: Event -> Event -> Event

min :: Event -> Event -> Event

Read Event 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

readsPrec :: Int -> ReadS Event

readList :: ReadS [Event]

readPrec :: ReadPrec Event

readListPrec :: ReadPrec [Event]

Show Event 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

showsPrec :: Int -> Event -> ShowS

show :: Event -> String

showList :: [Event] -> ShowS

Generic Event 
Instance details

Defined in Graphics.Vty.Input.Events

Associated Types

type Rep Event :: Type -> Type

Methods

from :: Event -> Rep Event x

to :: Rep Event x -> Event

type Rep Event 
Instance details

Defined in Graphics.Vty.Input.Events

type Rep Event = D1 (MetaData "Event" "Graphics.Vty.Input.Events" "vty-5.25.1-HM2SWWbjSR83s8nFz7tVbZ" False) ((C1 (MetaCons "EvKey" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Key) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Modifier])) :+: (C1 (MetaCons "EvMouseDown" PrefixI False) ((S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Button) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Modifier]))) :+: C1 (MetaCons "EvMouseUp" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Button)))))) :+: ((C1 (MetaCons "EvResize" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) :+: C1 (MetaCons "EvPaste" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString))) :+: (C1 (MetaCons "EvLostFocus" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "EvGainedFocus" PrefixI False) (U1 :: Type -> Type))))

data Key #

Instances
Eq Key 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

(==) :: Key -> Key -> Bool

(/=) :: Key -> Key -> Bool

Ord Key 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

compare :: Key -> Key -> Ordering

(<) :: Key -> Key -> Bool

(<=) :: Key -> Key -> Bool

(>) :: Key -> Key -> Bool

(>=) :: Key -> Key -> Bool

max :: Key -> Key -> Key

min :: Key -> Key -> Key

Read Key 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

readsPrec :: Int -> ReadS Key

readList :: ReadS [Key]

readPrec :: ReadPrec Key

readListPrec :: ReadPrec [Key]

Show Key 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

showsPrec :: Int -> Key -> ShowS

show :: Key -> String

showList :: [Key] -> ShowS

Generic Key 
Instance details

Defined in Graphics.Vty.Input.Events

Associated Types

type Rep Key :: Type -> Type

Methods

from :: Key -> Rep Key x

to :: Rep Key x -> Key

Parse Key 
Instance details

Defined in Graphics.Vty.Config

Methods

parseValue :: Parser Key

type Rep Key 
Instance details

Defined in Graphics.Vty.Input.Events

type Rep Key = D1 (MetaData "Key" "Graphics.Vty.Input.Events" "vty-5.25.1-HM2SWWbjSR83s8nFz7tVbZ" False) ((((C1 (MetaCons "KEsc" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "KChar" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Char)) :+: C1 (MetaCons "KBS" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "KEnter" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "KLeft" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "KRight" PrefixI False) (U1 :: Type -> Type)))) :+: ((C1 (MetaCons "KUp" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "KDown" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "KUpLeft" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "KUpRight" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "KDownLeft" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "KDownRight" PrefixI False) (U1 :: Type -> Type))))) :+: (((C1 (MetaCons "KCenter" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "KFun" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) :+: C1 (MetaCons "KBackTab" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "KPrtScr" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "KPause" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "KIns" PrefixI False) (U1 :: Type -> Type)))) :+: ((C1 (MetaCons "KHome" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "KPageUp" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "KDel" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "KEnd" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "KPageDown" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "KBegin" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "KMenu" PrefixI False) (U1 :: Type -> Type))))))

data Modifier #

Constructors

MShift 
MCtrl 
MMeta 
MAlt 
Instances
Eq Modifier 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

(==) :: Modifier -> Modifier -> Bool

(/=) :: Modifier -> Modifier -> Bool

Ord Modifier 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

compare :: Modifier -> Modifier -> Ordering

(<) :: Modifier -> Modifier -> Bool

(<=) :: Modifier -> Modifier -> Bool

(>) :: Modifier -> Modifier -> Bool

(>=) :: Modifier -> Modifier -> Bool

max :: Modifier -> Modifier -> Modifier

min :: Modifier -> Modifier -> Modifier

Read Modifier 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

readsPrec :: Int -> ReadS Modifier

readList :: ReadS [Modifier]

readPrec :: ReadPrec Modifier

readListPrec :: ReadPrec [Modifier]

Show Modifier 
Instance details

Defined in Graphics.Vty.Input.Events

Methods

showsPrec :: Int -> Modifier -> ShowS

show :: Modifier -> String

showList :: [Modifier] -> ShowS

Generic Modifier 
Instance details

Defined in Graphics.Vty.Input.Events

Associated Types

type Rep Modifier :: Type -> Type

Methods

from :: Modifier -> Rep Modifier x

to :: Rep Modifier x -> Modifier

Parse Modifier 
Instance details

Defined in Graphics.Vty.Config

Methods

parseValue :: Parser Modifier

type Rep Modifier 
Instance details

Defined in Graphics.Vty.Input.Events

type Rep Modifier = D1 (MetaData "Modifier" "Graphics.Vty.Input.Events" "vty-5.25.1-HM2SWWbjSR83s8nFz7tVbZ" False) ((C1 (MetaCons "MShift" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "MCtrl" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "MMeta" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "MAlt" PrefixI False) (U1 :: Type -> Type)))

data Next a #

Instances
Functor Next 
Instance details

Defined in Brick.Types.Internal

Methods

fmap :: (a -> b) -> Next a -> Next b

(<$) :: a -> Next b -> Next a

data AttrName #

Instances
Eq AttrName 
Instance details

Defined in Brick.AttrMap

Methods

(==) :: AttrName -> AttrName -> Bool

(/=) :: AttrName -> AttrName -> Bool

Ord AttrName 
Instance details

Defined in Brick.AttrMap

Methods

compare :: AttrName -> AttrName -> Ordering

(<) :: AttrName -> AttrName -> Bool

(<=) :: AttrName -> AttrName -> Bool

(>) :: AttrName -> AttrName -> Bool

(>=) :: AttrName -> AttrName -> Bool

max :: AttrName -> AttrName -> AttrName

min :: AttrName -> AttrName -> AttrName

Read AttrName 
Instance details

Defined in Brick.AttrMap

Methods

readsPrec :: Int -> ReadS AttrName

readList :: ReadS [AttrName]

readPrec :: ReadPrec AttrName

readListPrec :: ReadPrec [AttrName]

Show AttrName 
Instance details

Defined in Brick.AttrMap

Methods

showsPrec :: Int -> AttrName -> ShowS

show :: AttrName -> String

showList :: [AttrName] -> ShowS

IsString AttrName 
Instance details

Defined in Brick.AttrMap

Methods

fromString :: String -> AttrName

Generic AttrName 
Instance details

Defined in Brick.AttrMap

Associated Types

type Rep AttrName :: Type -> Type

Methods

from :: AttrName -> Rep AttrName x

to :: Rep AttrName x -> AttrName

Semigroup AttrName 
Instance details

Defined in Brick.AttrMap

Methods

(<>) :: AttrName -> AttrName -> AttrName

sconcat :: NonEmpty AttrName -> AttrName

stimes :: Integral b => b -> AttrName -> AttrName

Monoid AttrName 
Instance details

Defined in Brick.AttrMap

NFData AttrName 
Instance details

Defined in Brick.AttrMap

Methods

rnf :: AttrName -> ()

GetAttr AttrName 
Instance details

Defined in Brick.Markup

Methods

getAttr :: AttrName -> RenderM n Attr

type Rep AttrName 
Instance details

Defined in Brick.AttrMap

type Rep AttrName = D1 (MetaData "AttrName" "Brick.AttrMap" "brick-0.53-7zUCwVpMXseGAfgRvQR7MX" False) (C1 (MetaCons "AttrName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String])))

on :: Color -> Color -> Attr #

fg :: Color -> Attr #

bg :: Color -> Attr #

applyAttrMappings :: [(AttrName, Attr)] -> AttrMap -> AttrMap #

getDatabasePath :: IO FilePath Source #

Returns the notmuch database path by executing 'notmuch config get database.path' in a separate process

solarizedDark :: AttrMap Source #

Default theme

(</>) :: FilePath -> FilePath -> FilePath #

(&) :: a -> (a -> b) -> b #

_head :: Cons s s a a => Traversal' s a #

preview :: MonadReader s m => Getting (First a) s a -> m (Maybe a) #

view :: MonadReader s m => Getting a s a -> m a #

over :: ASetter s t a b -> (a -> b) -> s -> t #

set :: ASetter s t a b -> b -> s -> t #

genBoundary :: RandomGen g => g -> String Source #

data Mailbox #

Constructors

Mailbox (Maybe Text) AddrSpec 
Instances
Eq Mailbox 
Instance details

Defined in Data.RFC5322.Address.Types

Methods

(==) :: Mailbox -> Mailbox -> Bool

(/=) :: Mailbox -> Mailbox -> Bool

Show Mailbox 
Instance details

Defined in Data.RFC5322.Address.Types

Methods

showsPrec :: Int -> Mailbox -> ShowS

show :: Mailbox -> String

showList :: [Mailbox] -> ShowS

Generic Mailbox 
Instance details

Defined in Data.RFC5322.Address.Types

Associated Types

type Rep Mailbox :: Type -> Type

Methods

from :: Mailbox -> Rep Mailbox x

to :: Rep Mailbox x -> Mailbox

NFData Mailbox 
Instance details

Defined in Data.RFC5322.Address.Types

Methods

rnf :: Mailbox -> ()

type Rep Mailbox 
Instance details

Defined in Data.RFC5322.Address.Types

type Rep Mailbox = D1 (MetaData "Mailbox" "Data.RFC5322.Address.Types" "purebred-email-0.4.1-L0F8azWAfQWDl3u3WU0uwO" False) (C1 (MetaCons "Mailbox" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AddrSpec)))

data AddrSpec #

Constructors

AddrSpec ByteString Domain 
Instances
Eq AddrSpec 
Instance details

Defined in Data.RFC5322.Address.Types

Methods

(==) :: AddrSpec -> AddrSpec -> Bool

(/=) :: AddrSpec -> AddrSpec -> Bool

Show AddrSpec 
Instance details

Defined in Data.RFC5322.Address.Types

Methods

showsPrec :: Int -> AddrSpec -> ShowS

show :: AddrSpec -> String

showList :: [AddrSpec] -> ShowS

Generic AddrSpec 
Instance details

Defined in Data.RFC5322.Address.Types

Associated Types

type Rep AddrSpec :: Type -> Type

Methods

from :: AddrSpec -> Rep AddrSpec x

to :: Rep AddrSpec x -> AddrSpec

NFData AddrSpec 
Instance details

Defined in Data.RFC5322.Address.Types

Methods

rnf :: AddrSpec -> ()

type Rep AddrSpec 
Instance details

Defined in Data.RFC5322.Address.Types

type Rep AddrSpec = D1 (MetaData "AddrSpec" "Data.RFC5322.Address.Types" "purebred-email-0.4.1-L0F8azWAfQWDl3u3WU0uwO" False) (C1 (MetaCons "AddrSpec" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Domain)))

data Domain #

Constructors

DomainDotAtom (NonEmpty ByteString) 
DomainLiteral ByteString 
Instances
Eq Domain 
Instance details

Defined in Data.RFC5322.Address.Types

Methods

(==) :: Domain -> Domain -> Bool

(/=) :: Domain -> Domain -> Bool

Show Domain 
Instance details

Defined in Data.RFC5322.Address.Types

Methods

showsPrec :: Int -> Domain -> ShowS

show :: Domain -> String

showList :: [Domain] -> ShowS

Generic Domain 
Instance details

Defined in Data.RFC5322.Address.Types

Associated Types

type Rep Domain :: Type -> Type

Methods

from :: Domain -> Rep Domain x

to :: Rep Domain x -> Domain

NFData Domain 
Instance details

Defined in Data.RFC5322.Address.Types

Methods

rnf :: Domain -> ()

type Rep Domain 
Instance details

Defined in Data.RFC5322.Address.Types

type Rep Domain = D1 (MetaData "Domain" "Data.RFC5322.Address.Types" "purebred-email-0.4.1-L0F8azWAfQWDl3u3WU0uwO" False) (C1 (MetaCons "DomainDotAtom" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (NonEmpty ByteString))) :+: C1 (MetaCons "DomainLiteral" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

sendmail Source #

Arguments

:: FilePath 
-> Builder

the rendered mail

-> IO (Either Error ()) 

Invoke a sendmail(1)-compatible program to send the email