tv xmonad: move my* to Build

This prevents Main from getting rebuilt due to TH whenever one of its
imported modules changes.
This commit is contained in:
tv 2022-04-04 15:19:19 +02:00
parent 7721142f25
commit f9d4a12916
2 changed files with 25 additions and 16 deletions

View File

@ -0,0 +1,24 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module Build where
import XMonad (Dimension)
import THEnv.JSON (getCompileEnvJSONExp)
myFont :: String
myFont =
"-schumacher-*-*-*-*-*-*-*-*-*-*-*-iso10646-*"
myScreenWidth :: Dimension
myScreenWidth =
$(getCompileEnvJSONExp (id @Dimension) "XMONAD_BUILD_SCREEN_WIDTH")
myTermFontWidth :: Dimension
myTermFontWidth =
$(getCompileEnvJSONExp (id @Dimension) "XMONAD_BUILD_TERM_FONT_WIDTH")
myTermPadding :: Dimension
myTermPadding =
2

View File

@ -1,6 +1,4 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module Main (main) where
@ -35,22 +33,9 @@ import XMonad.Actions.PerWorkspaceKeys (chooseAction)
import XMonad.Stockholm.Pager
import XMonad.Stockholm.Shutdown
import THEnv.JSON (getCompileEnvJSONExp)
myFont :: String
myFont = "-schumacher-*-*-*-*-*-*-*-*-*-*-*-iso10646-*"
myScreenWidth :: Dimension
myScreenWidth =
$(getCompileEnvJSONExp (id @Dimension) "XMONAD_BUILD_SCREEN_WIDTH")
myTermFontWidth :: Dimension
myTermFontWidth =
$(getCompileEnvJSONExp (id @Dimension) "XMONAD_BUILD_TERM_FONT_WIDTH")
myTermPadding :: Dimension
myTermPadding = 2
import Build (myFont, myScreenWidth, myTermFontWidth, myTermPadding)
main :: IO ()