rcfiles/.config/termonad/termonad.hs

119 lines
3.4 KiB
Haskell
Raw Normal View History

2018-12-04 23:11:41 +00:00
{-# LANGUAGE OverloadedStrings #-}
2020-10-29 13:00:10 +00:00
-- | This is my Termonad configuration.
2022-03-21 00:59:51 +00:00
-- Currently defaults to One Dark Pro
2018-12-04 23:11:41 +00:00
module Main where
2020-10-29 13:00:10 +00:00
import Data.Maybe (fromMaybe)
2018-12-06 02:37:02 +00:00
import Termonad
2020-05-23 08:35:58 +00:00
( CursorBlinkMode(CursorBlinkModeOn)
, Option(Set)
, ShowScrollbar(ShowScrollbarNever)
, TMConfig
2022-03-21 00:59:51 +00:00
, boldIsBright
, confirmExit
, cursorBlinkMode
, defaultConfigOptions
, defaultTMConfig
, options
, showMenu
, showScrollbar
, start
, FontConfig
, FontSize(FontSizePoints)
, defaultFontConfig
, fontConfig
, fontFamily
, fontSize
2018-12-04 23:11:41 +00:00
)
import Termonad.Config.Colour
( AlphaColour
, ColourConfig
, Palette(ExtendedPalette)
, addColourExtension
, createColour
, createColourExtension
, defaultColourConfig
2020-10-29 13:00:10 +00:00
, defaultStandardColours
, defaultLightColours
2020-01-25 14:18:18 +00:00
, backgroundColour
, foregroundColour
, palette
2020-10-29 13:00:10 +00:00
, List8
, mkList8
2018-12-06 02:37:02 +00:00
)
2018-12-04 23:11:41 +00:00
2018-12-06 02:37:02 +00:00
-- This is our main 'TMConfig'. It holds all of the non-colour settings
-- for Termonad.
2018-12-04 23:11:41 +00:00
--
2018-12-06 02:37:02 +00:00
-- This shows how a few settings can be changed.
myTMConfig :: TMConfig
myTMConfig =
defaultTMConfig
{ options =
defaultConfigOptions
{ showScrollbar = ShowScrollbarNever
2022-03-21 00:59:51 +00:00
, boldIsBright = True
2018-12-06 02:37:02 +00:00
, confirmExit = False
, showMenu = False
2020-05-23 08:35:58 +00:00
, cursorBlinkMode = CursorBlinkModeOn
2018-12-06 02:37:02 +00:00
, fontConfig = fontConf
}
}
2018-12-04 23:11:41 +00:00
2022-02-22 01:45:49 +00:00
-- This is our Dracula 'ColourConfig'.
2022-03-21 00:59:51 +00:00
onedarkpro :: ColourConfig (AlphaColour Double)
onedarkpro =
2020-10-29 13:00:10 +00:00
defaultColourConfig
2021-05-28 06:18:47 +00:00
-- Set the default background & foreground colour of text of the terminal.
2022-03-21 00:59:51 +00:00
{ backgroundColour = Set (createColour 40 44 52) -- black.0
, foregroundColour = Set (createColour 171 178 191) -- white.7
2022-02-22 01:45:49 +00:00
-- Set the extended palette that has 2 Vecs of 8 Dracula palette colours
2022-03-21 00:59:51 +00:00
, palette = ExtendedPalette onedarkproNormal onedarkproBright
2020-10-29 13:00:10 +00:00
}
where
2022-03-21 00:59:51 +00:00
onedarkproNormal :: List8 (AlphaColour Double)
onedarkproNormal = fromMaybe defaultStandardColours $ mkList8
[ createColour 40 44 52 -- black.0
, createColour 244 108 117 -- red.1
, createColour 152 195 121 -- green.2
, createColour 229 192 123 -- yellow.3
, createColour 97 175 239 -- blue.4
, createColour 198 120 221 -- magenta.5
, createColour 86 182 194 -- cyan.6
, createColour 171 178 191 -- white.7
2020-10-29 13:00:10 +00:00
]
2022-03-21 00:59:51 +00:00
onedarkproBright :: List8 (AlphaColour Double)
onedarkproBright = fromMaybe defaultStandardColours $ mkList8
[ createColour 63 63 63 -- black.8
, createColour 224 108 117 -- red.9
, createColour 152 195 121 -- green.10
, createColour 229 192 123 -- yellow.11
, createColour 97 175 239 -- blue.12
, createColour 198 120 221 -- magenta.13
, createColour 86 182 194 -- cyan.14
, createColour 191 197 206 -- white.15
2020-10-29 13:00:10 +00:00
]
2018-12-06 06:52:50 +00:00
-- This defines the font for the terminal.
2018-12-04 23:11:41 +00:00
fontConf :: FontConfig
fontConf =
defaultFontConfig
2021-05-28 06:18:47 +00:00
-- { fontFamily = "Droid Sans Mono Dotted for Powerline"
-- { fontFamily = "Inconsolata for Powerline"
{ fontFamily = "Inconsolata-g for Powerline"
2022-02-22 01:45:49 +00:00
, fontSize = FontSizePoints 8
2018-12-04 23:11:41 +00:00
}
main :: IO ()
main = do
2021-05-28 06:18:47 +00:00
-- First, create the colour extension based on either PaperColor modules.
2022-03-21 00:59:51 +00:00
myColourExt <- createColourExtension onedarkpro
2018-12-06 02:37:02 +00:00
-- Update 'myTMConfig' with our colour extension.
let newTMConfig = addColourExtension myTMConfig myColourExt
-- Start Termonad with our updated 'TMConfig'.
start newTMConfig