rcfiles/.config/termonad/termonad.hs

117 lines
3.3 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-02-22 01:45:49 +00:00
-- Currently defaults to Dracula
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
, 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
, 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'.
dracula :: ColourConfig (AlphaColour Double)
dracula =
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-02-22 01:45:49 +00:00
{ backgroundColour = Set (createColour 40 42 54) -- black.0
, foregroundColour = Set (createColour 248 248 242) -- white.7
-- Set the extended palette that has 2 Vecs of 8 Dracula palette colours
, palette = ExtendedPalette draculaNormal draculaBright
2020-10-29 13:00:10 +00:00
}
where
2022-02-22 01:45:49 +00:00
draculaNormal :: List8 (AlphaColour Double)
draculaNormal = fromMaybe defaultStandardColours $ mkList8
[ createColour 40 42 54 -- black.0
, createColour 255 85 85 -- red.1
, createColour 80 250 123 -- green.2
, createColour 241 250 140 -- yellow.3
, createColour 189 147 249 -- blue.4
, createColour 255 121 198 -- magenta.5
, createColour 139 233 253 -- cyan.6
, createColour 248 248 242 -- white.7
2020-10-29 13:00:10 +00:00
]
2022-02-22 01:45:49 +00:00
draculaBright :: List8 (AlphaColour Double)
draculaBright = fromMaybe defaultStandardColours $ mkList8
[ createColour 77 77 77 -- black.8
, createColour 255 110 103 -- red.9
, createColour 90 247 142 -- green.10
, createColour 244 249 157 -- yellow.11
, createColour 202 169 250 -- blue.12
, createColour 255 146 208 -- magenta.13
, createColour 154 237 254 -- cyan.14
, createColour 230 230 230 -- 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-02-22 01:45:49 +00:00
myColourExt <- createColourExtension dracula
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