summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/haskell/xmonad-tv/src/main.hs
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-10-23 21:02:02 +0200
committermakefu <github@syntax-fehler.de>2020-10-23 21:02:02 +0200
commite8b6cc0587929a7ebd0d00f83d298640b20b055f (patch)
treee0f813b8264119a84d6b8c32fa68041c8541ab59 /tv/5pkgs/haskell/xmonad-tv/src/main.hs
parentfd41a76d4cab2765f9ef95ce5322b7bffe52b8a7 (diff)
parent242530680d5dcb37a5a023d0b8f6155ab441cead (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'tv/5pkgs/haskell/xmonad-tv/src/main.hs')
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/src/main.hs21
1 files changed, 18 insertions, 3 deletions
diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs
index c83b411bd..b8ddd27e8 100644
--- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs
+++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs
@@ -1,4 +1,6 @@
{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeApplications #-}
module Main (main) where
@@ -32,10 +34,23 @@ import XMonad.Stockholm.Pager
import XMonad.Stockholm.Shutdown
import qualified Paths
+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
+
main :: IO ()
main = getArgs >>= \case
@@ -46,7 +61,6 @@ main = getArgs >>= \case
mainNoArgs :: IO ()
mainNoArgs = do
- let width = 1366
workspaces0 <- getWorkspaces0
handleShutdownEvent <- newShutdownEventHandler
launch
@@ -60,8 +74,9 @@ mainNoArgs = do
smartBorders $
ResizableTall
1
- (10 * 6 / width)
- ((80 * 6 + 2 * (1+1+1))/width) []
+ (fromIntegral (10 * myTermFontWidth) / fromIntegral myScreenWidth)
+ (fromIntegral (80 * myTermFontWidth + 2 * (myTermPadding + borderWidth def)) / fromIntegral myScreenWidth)
+ []
|||
Full
, manageHook =