From 8b3705b8d13d7be48ce9954c13b0a30797a6788a Mon Sep 17 00:00:00 2001 From: sheaf Date: Sun, 8 Sep 2024 17:04:41 +0200 Subject: [PATCH] Set GDK_SCALE = 2 by default --- app/Main.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Main.hs b/app/Main.hs index dd18056..19c43fe 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -6,7 +6,11 @@ module Main -- base import Control.Monad - ( void ) + ( void, when ) +import Data.Maybe + ( isNothing ) +import System.Environment + ( lookupEnv, setEnv ) import System.Exit ( ExitCode(..), exitSuccess, exitWith ) import GHC.Conc @@ -46,6 +50,12 @@ main = withCP65001 do = procs setNumCapabilities caps + -- Set GDK_SCALE = 2 by default, + -- unless GDK_SCALE is already set. + mbGdkScale <- lookupEnv "GDK_SCALE" + when (isNothing mbGdkScale) $ + setEnv "GDK_SCALE" "2" + --------------------------------------------------------- -- Run GTK application