Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 (KCharj
) []) (scrollDown
`chain
`continue
) , Keybinding (EvKey (KChark
) []) (scrollUp
`chain` continue) , Keybinding (EvKey (KChard
) []) (scrollPageDown
`chain` continue) , Keybinding (EvKey (KCharu
) []) (scrollPageUp
`chain` continue) ] mailViewKeybindings = [ Keybinding (EvKey (KCharJ
) []) (listDown
`chain'
`displayMail
`chain` continue) , Keybinding (EvKey (KCharK
) []) (listUp
`chain'` displayMail `chain` continue) , Keybinding (EvKey (KCharG
) []) (listJumpToEnd
`chain` continue) , Keybinding (EvKey (KCharg
) []) (listJumpToStart
`chain` continue) ] <> scrollKeybindings main =purebred
$ tweakdefaultConfig
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
- module Types
- module Error
- module UI.Actions
- module UI.Index.Keybindings
- module UI.Mail.Keybindings
- data Event
- = EvKey Key [Modifier]
- | EvMouseDown Int Int Button [Modifier]
- | EvMouseUp Int Int (Maybe Button)
- | EvResize Int Int
- | EvPaste ByteString
- | EvLostFocus
- | EvGainedFocus
- data Key
- data Modifier
- data Next a
- data AttrName
- on :: Color -> Color -> Attr
- fg :: Color -> Attr
- bg :: Color -> Attr
- applyAttrMappings :: [(AttrName, Attr)] -> AttrMap -> AttrMap
- getDatabasePath :: IO FilePath
- defaultConfig :: UserConfiguration
- solarizedDark :: AttrMap
- mailTagAttr :: AttrName
- listStateSelectedAttr :: AttrName
- listStateToggledAttr :: AttrName
- listStateNewmailAttr :: AttrName
- (</>) :: 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
- data Mailbox = Mailbox (Maybe Text) AddrSpec
- data AddrSpec = AddrSpec ByteString Domain
- data Domain
- = DomainDotAtom (NonEmpty ByteString)
- | DomainLiteral ByteString
- purebred :: UserConfiguration -> IO ()
- sendmail :: FilePath -> Builder -> IO (Either Error ())
Documentation
module Types
module Error
module UI.Actions
module UI.Index.Keybindings
module UI.Mail.Keybindings
Constructors
EvKey Key [Modifier] | |
EvMouseDown Int Int Button [Modifier] | |
EvMouseUp Int Int (Maybe Button) | |
EvResize Int Int | |
EvPaste ByteString | |
EvLostFocus | |
EvGainedFocus |
Instances
Eq Event | |
Ord Event | |
Read Event | |
Defined in Graphics.Vty.Input.Events | |
Show Event | |
Generic Event | |
type Rep Event | |
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)))) |
Constructors
KEsc | |
KChar Char | |
KBS | |
KEnter | |
KLeft | |
KRight | |
KUp | |
KDown | |
KUpLeft | |
KUpRight | |
KDownLeft | |
KDownRight | |
KCenter | |
KFun Int | |
KBackTab | |
KPrtScr | |
KPause | |
KIns | |
KHome | |
KPageUp | |
KDel | |
KEnd | |
KPageDown | |
KBegin | |
KMenu |
Instances
Eq Key | |
Ord Key | |
Read Key | |
Defined in Graphics.Vty.Input.Events | |
Show Key | |
Generic Key | |
Parse Key | |
Defined in Graphics.Vty.Config Methods parseValue :: Parser Key | |
type Rep Key | |
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)))))) |
Instances
Eq Modifier | |
Ord Modifier | |
Defined in Graphics.Vty.Input.Events | |
Read Modifier | |
Defined in Graphics.Vty.Input.Events | |
Show Modifier | |
Generic Modifier | |
Parse Modifier | |
Defined in Graphics.Vty.Config Methods parseValue :: Parser Modifier | |
type Rep Modifier | |
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))) |
Instances
Eq AttrName | |
Ord AttrName | |
Read AttrName | |
Defined in Brick.AttrMap | |
Show AttrName | |
IsString AttrName | |
Defined in Brick.AttrMap Methods fromString :: String -> AttrName | |
Generic AttrName | |
Semigroup AttrName | |
Monoid AttrName | |
NFData AttrName | |
Defined in Brick.AttrMap | |
GetAttr AttrName | |
Defined in Brick.Markup | |
type Rep AttrName | |
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]))) |
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
genBoundary :: RandomGen g => g -> String Source #
Instances
Eq Mailbox | |
Show Mailbox | |
Generic Mailbox | |
NFData Mailbox | |
Defined in Data.RFC5322.Address.Types | |
type Rep Mailbox | |
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))) |
Instances
Eq AddrSpec | |
Show AddrSpec | |
Generic AddrSpec | |
NFData AddrSpec | |
Defined in Data.RFC5322.Address.Types | |
type Rep AddrSpec | |
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))) |
Constructors
DomainDotAtom (NonEmpty ByteString) | |
DomainLiteral ByteString |
Instances
Eq Domain | |
Show Domain | |
Generic Domain | |
NFData Domain | |
Defined in Data.RFC5322.Address.Types | |
type Rep Domain | |
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))) |
purebred :: UserConfiguration -> IO () Source #