rcfiles/.config/termonad/termonad.hs

145 lines
4.7 KiB
Haskell
Raw Normal View History

2018-12-04 23:11:41 +00:00
{-# LANGUAGE OverloadedStrings #-}
2018-12-06 06:52:50 +00:00
-- This is my Termonad configuration.
2018-12-04 23:11:41 +00:00
module Main where
2018-12-06 02:37:02 +00:00
import Termonad
( CursorBlinkMode(CursorBlinkModeOff)
, 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-01-25 14:18:18 +00:00
, backgroundColour
, foregroundColour
, palette
2018-12-06 02:37:02 +00:00
)
import Termonad.Config.Vec (Vec((:*), EmptyVec), N8)
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
, cursorBlinkMode = CursorBlinkModeOff
, fontConfig = fontConf
}
}
2018-12-04 23:11:41 +00:00
2018-12-06 06:52:50 +00:00
-- This is our Solarized dark 'ColourConfig'. It holds all of our dark-related settings.
solarizedDark :: ColourConfig (AlphaColour Double)
2018-12-06 02:37:02 +00:00
solarizedDark =
2018-12-04 23:11:41 +00:00
defaultColourConfig
2018-12-06 02:37:02 +00:00
-- Set the default foreground colour of text of the terminal.
{ foregroundColour = Set (createColour 131 148 150) -- base0
2020-01-25 14:18:18 +00:00
, backgroundColour = Set (createColour 0 43 54) -- base03
-- Set the extended palette that has 2 Vecs of 8 Solarized palette colours
2018-12-06 02:37:02 +00:00
, palette = ExtendedPalette solarizedDark1 solarizedDark2
}
where
solarizedDark1 :: Vec N8 (AlphaColour Double)
2018-12-06 02:37:02 +00:00
solarizedDark1 =
2020-01-25 14:18:18 +00:00
createColour 7 54 66 -- base02, background highlights
:* createColour 220 50 47 -- red
:* createColour 133 153 0 -- green
:* createColour 181 137 0 -- yellow
:* createColour 38 139 210 -- blue
:* createColour 211 54 130 -- magenta
:* createColour 42 161 152 -- cyan
:* createColour 238 232 213 -- base2
2018-12-06 02:37:02 +00:00
:* EmptyVec
solarizedDark2 :: Vec N8 (AlphaColour Double)
2018-12-06 02:37:02 +00:00
solarizedDark2 =
2020-01-25 14:18:18 +00:00
createColour 0 43 54 -- base03, background
:* createColour 203 75 22 -- orange
:* createColour 88 110 117 -- base01, comments / secondary text
:* createColour 131 148 150 -- base0, body text / default code / primary content
:* createColour 147 161 161 -- base1, optional emphasised content
:* createColour 108 113 196 -- violet
:* createColour 101 123 131 -- base00
:* createColour 253 246 227 -- base3
2018-12-06 02:37:02 +00:00
:* EmptyVec
2018-12-06 06:52:50 +00:00
-- This is our Solarized light 'ColourConfig'. It holds all of our light-related settings.
solarizedLight :: ColourConfig (AlphaColour Double)
2018-12-06 02:37:02 +00:00
solarizedLight =
defaultColourConfig
-- Set the default foreground colour of text of the terminal.
{ foregroundColour = Set (createColour 101 123 131) -- base00
2020-01-25 14:18:18 +00:00
, backgroundColour = Set (createColour 253 246 227) -- base3
-- Set the extended palette that has 2 Vecs of 8 Solarized palette colours
2018-12-06 02:37:02 +00:00
, palette = ExtendedPalette solarizedLight1 solarizedLight2
}
where
solarizedLight1 :: Vec N8 (AlphaColour Double)
2018-12-06 02:37:02 +00:00
solarizedLight1 =
createColour 238 232 213 -- base2, background highlights
:* createColour 220 50 47 -- red
:* createColour 133 153 0 -- green
:* createColour 181 137 0 -- yellow
:* createColour 38 139 210 -- blue
:* createColour 211 54 130 -- magenta
:* createColour 42 161 152 -- cyan
:* createColour 7 54 66 -- base02
2018-12-06 02:37:02 +00:00
:* EmptyVec
solarizedLight2 :: Vec N8 (AlphaColour Double)
2018-12-06 02:37:02 +00:00
solarizedLight2 =
createColour 253 246 227 -- base3, background
:* createColour 203 75 22 -- orange
:* createColour 147 161 161 -- base1, comments / secondary text
:* createColour 101 123 131 -- base00, body text / default code / primary content
:* createColour 88 110 117 -- base01, optional emphasised content
:* createColour 108 113 196 -- violet
:* createColour 131 148 150 -- base0
:* createColour 0 43 54 -- base03
2018-12-06 02:37:02 +00:00
:* EmptyVec
2018-12-04 23:11:41 +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
{ fontFamily = "Droid Sans Mono Dotted for Powerline"
2020-01-25 14:18:18 +00:00
, fontSize = FontSizePoints 6
2018-12-04 23:11:41 +00:00
}
main :: IO ()
main = do
2020-03-17 12:45:42 +00:00
-- First, create the colour extension based on either Solarized modules.
2018-12-06 02:37:02 +00:00
myColourExt <- createColourExtension solarizedDark
-- Update 'myTMConfig' with our colour extension.
let newTMConfig = addColourExtension myTMConfig myColourExt
-- Start Termonad with our updated 'TMConfig'.
start newTMConfig