Skip to content

Theming

aloysius edited this page Mar 19, 2021 · 5 revisions

XMonad-Aloysius includes a means by which you can specify which theme you want through the build script. Please note that specifying the theme automatically produces a build call so you do not need both -b and -t [themename].

Please note that the theming mechanisms currently sit across three or so different repositories and it is not yet integrated. There's some manual labour to co-ordinate the theming of XMonad with the themes of your other applications (e.g. firefox, gtk apps).

The default theme is horizon.

Horizon
Screenshot

To switch all of your xmonad features (dmenu, dzen, containers etc.) to your choice of theme then its as easy as

./build -t [horizon|nord|laserwave|dracula|ephemeral|lovelace|nature]

Please see the following links for the influences behind the themes

Creating your own theme

Create a new file called YourTheme.hs file in app/Theme/ and fill it with the following information (the example below is for Horizon.hs, the default theme).

module Theme.Horizon where

basebg = "#1c1e26"
basefg = "#c7c9cb"
base00 = "#16161c"  -- darkest black
base01 = "#1a1c23"  -- dark black
base02 = "#1c1e26"  -- black
base03 = "#232530"  -- bright black
base04 = "#6a6a6a"  -- dark white
base05 = "#f9cec3"  -- white
base06 = "#f9cbbe"  -- bright white
base07 = "#fadad1"  -- 
base08 = "#fdf0ed"  -- 
base09 = "#21bfc2"  -- 
base10 = "#25b2bc"  --
base11 = "#e95678"  -- 
base12 = "#f09383"  -- 
base13 = "#fab795"  -- 
base14 = "#09f7a0"  -- 
base15 = "#b877db"  -- 

fontsize :: String
fontsize = "12"

sansserif :: String
sansserif = "xft:Rounded Mplus 1c Medium:style=Regular:size=" ++ fontsize

sansserif' :: String
sansserif' = "Rounded Mplus 1c Medium-" ++ fontsize

monospace :: String
monospace = "xft:mplus Nerd Font Mono:size=" ++ fontsize

altsans :: String
altsans = "xft:mplus Nerd Font:style=Medium:size=" ++ fontsize

These variables are all required. Following this edit app/Theme/ChosenTheme.hs and edit the import line to match the name of your theme. This is the only change required in the haskell source.

You will also need to add the theme to the build script (for now) by adding it into the list within the themeCompile function. For example, you could change the stanza

themeCompile () {
  theme=("${(@)theme:#-t}")
  echo "  Setting new theme: $theme[@]"

  case $theme[@] in
    horizon | yourtheme )
      setTheme $theme[@];;
    *)
      echo "   You have incorrectly specified a theme, please see the help"
      ;;
  esac
}

which will only allow builds to specify either the horizon theme or "yourtheme".

Clone this wiki locally