Solarized my termonad configuration

This commit is contained in:
Serĉanto de Scio 2018-12-06 12:37:02 +10:00
parent 4ac554f037
commit 7fe768e279
No known key found for this signature in database
GPG key ID: B41FA6FF04CE4B93

View file

@ -1,55 +1,107 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
-- | This is my Termonad configuration.
-- | This is my configuration file for the Termonad terminal emulator.
module Main where module Main where
import Data.Colour.SRGB (Colour, sRGB24) import Termonad
-- import Data.Colour (withOpacity) ( CursorBlinkMode(CursorBlinkModeOff), Option(Set)
import Termonad.App (defaultMain) , ShowScrollbar(ShowScrollbarNever), TMConfig, confirmExit, cursorBlinkMode
import Termonad.Config , defaultConfigOptions, defaultTMConfig, options, showMenu, showScrollbar
( FontConfig, FontSize(FontSizePoints), Option(Set) , start, FontConfig, FontSize(FontSizePoints), defaultFontConfig, fontConfig
, ShowScrollbar(ShowScrollbarNever), defaultFontConfig, defaultTMConfig , fontFamily, fontSize
, fontConfig, fontFamily, fontSize, showScrollbar, showMenu
) )
import Termonad.Config.Colour import Termonad.Config.Colour
import Termonad.Config.Vec (Vec, VecT((:+), EmptyV), N8) ( Colour, ColourConfig, Palette(ExtendedPalette), addColourExtension
import Termonad.Config.Extension ((<+>)) , createColourExtension, cursorBgColour, defaultColourConfig, foregroundColour
, palette, sRGB24
)
import Termonad.Config.Vec (Vec((:*), EmptyVec), N8, unsafeFromListVec_)
import Data.Colour.SRGB (Colour, sRGB24)
-- | This sets the color of the cursor in the terminal. -- This is our main 'TMConfig'. It holds all of the non-colour settings
-- for Termonad.
-- --
-- This uses the "Data.Colour" module to define a dark-red color. -- This shows how a few settings can be changed.
-- There are many default colors defined in "Data.Colour.Names". myTMConfig :: TMConfig
cursBgColor :: Colour Double myTMConfig =
cursBgColor = sRGB24 204 0 0 defaultTMConfig
{ options =
defaultConfigOptions
{ showScrollbar = ShowScrollbarNever
, confirmExit = False
, showMenu = False
, cursorBlinkMode = CursorBlinkModeOff
, fontConfig = fontConf
}
}
-- | This sets the colors used for the terminal. We only specify the background -- | This is our Solarized dark 'ColourConfig'. It holds all of our dark-related settings.
-- color of the cursor. solarizedDark :: ColourConfig (Colour Double)
colConf :: ColourConfig (Colour Double) solarizedDark =
colConf =
defaultColourConfig defaultColourConfig
{ cursorBgColour = Set cursBgColor -- `withOpacity` 0.7 -- Set the default foreground colour of text of the terminal.
, palette = BasicPalette mySolarizedColours { foregroundColour = sRGB24 131 148 150 -- base0
} where -- Set the extended palette that has 2 Vecs of 8 Solarized pallette colours
mySolarizedColours :: Vec N8 (Colour Double) , palette = ExtendedPalette solarizedDark1 solarizedDark2
mySolarizedColours }
= sRGB24 0 43 54 -- base03, background where
:+ sRGB24 220 50 47 -- red solarizedDark1 :: Vec N8 (Colour Double)
:+ sRGB24 7 54 66 -- base02 solarizedDark1 =
:+ sRGB24 203 75 22 -- orange sRGB24 0 43 54 -- base03, background
:+ sRGB24 38 139 210 -- blue :* sRGB24 220 50 47 -- red
:+ sRGB24 211 54 130 -- magenta :* sRGB24 133 153 0 -- green
:+ sRGB24 42 161 152 -- cyan :* sRGB24 181 137 0 -- yellow
:+ sRGB24 211 54 130 -- magenta :* sRGB24 38 139 210 -- blue
-- :+ sRGB24 211 54 130 -- magenta :* sRGB24 211 54 130 -- magenta
-- :+ sRGB24 211 54 130 -- magenta :* sRGB24 42 161 152 -- cyan
-- :+ sRGB24 211 54 130 -- magenta :* sRGB24 238 232 213 -- base2
-- :+ sRGB24 211 54 130 -- magenta :* EmptyVec
-- :+ sRGB24 211 54 130 -- magenta
-- :+ sRGB24 211 54 130 -- magenta solarizedDark2 :: Vec N8 (Colour Double)
-- :+ sRGB24 211 54 130 -- magenta solarizedDark2 =
-- :+ sRGB24 211 54 130 -- magenta sRGB24 7 54 66 -- base02, background highlights
:+ EmptyV :* sRGB24 203 75 22 -- orange
:* sRGB24 88 110 117 -- base01, comments / secondary text
:* sRGB24 131 148 150 -- base0, body text / default code / primary content
:* sRGB24 147 161 161 -- base1, optional emphasised content
:* sRGB24 108 113 196 -- violet
:* sRGB24 101 123 131 -- base00
:* sRGB24 253 246 227 -- base3
:* EmptyVec
-- | This is our Solarized light 'ColourConfig'. It holds all of our light-related settings.
solarizedLight :: ColourConfig (Colour Double)
solarizedLight =
defaultColourConfig
-- Set the default foreground colour of text of the terminal.
{ foregroundColour = sRGB24 101 123 131 -- base00
-- Set the extended palette that has 2 Vecs of 8 Solarized pallette colours
, palette = ExtendedPalette solarizedLight1 solarizedLight2
}
where
solarizedLight1 :: Vec N8 (Colour Double)
solarizedLight1 =
sRGB24 238 232 213 -- base2, background highlights
:* sRGB24 220 50 47 -- red
:* sRGB24 133 153 0 -- green
:* sRGB24 181 137 0 -- yellow
:* sRGB24 38 139 210 -- blue
:* sRGB24 211 54 130 -- magenta
:* sRGB24 42 161 152 -- cyan
:* sRGB24 7 54 66 -- base02
:* EmptyVec
solarizedLight2 :: Vec N8 (Colour Double)
solarizedLight2 =
sRGB24 253 246 227 -- base3, background
:* sRGB24 203 75 22 -- orange
:* sRGB24 147 161 161 -- base1, comments / secondary text
:* sRGB24 101 123 131 -- base00, body text / default code / primary content
:* sRGB24 88 110 117 -- base01, optional emphasised content
:* sRGB24 108 113 196 -- violet
:* sRGB24 131 148 150 -- base0
:* sRGB24 0 43 54 -- base03
:* EmptyVec
-- | This defines the font for the terminal. -- | This defines the font for the terminal.
fontConf :: FontConfig fontConf :: FontConfig
@ -61,11 +113,11 @@ fontConf =
main :: IO () main :: IO ()
main = do main = do
let termonadConf = -- First, create the colour extension based on either Solarixed modules.
defaultTMConfig myColourExt <- createColourExtension solarizedDark
{ fontConfig = fontConf
-- Make sure the scrollbar is never visible. -- Update 'myTMConfig' with our colour extension.
, showScrollbar = ShowScrollbarNever let newTMConfig = addColourExtension myTMConfig myColourExt
, showMenu = False
} <+> colConf -- Start Termonad with our updated 'TMConfig'.
defaultMain termonadConf start newTMConfig