aboutsummaryrefslogtreecommitdiffhomepage
path: root/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/Main.hs b/Main.hs
index 21f1747..d4b50c6 100644
--- a/Main.hs
+++ b/Main.hs
@@ -66,16 +66,6 @@ appEvent st (VtyEvent e) =
_ -> continue st
appEvent st _ = continue st
-initialState :: St
-initialState =
- St { _stScanningSession = Nothing
- , _stOCR = True
- , _stColour = Greyscale
- , _stPaper = A4
- , _stDPI = 300
- , _stOutdir = ""
- }
-
theApp :: App St e ()
theApp =
App { appDraw = drawUI
@@ -86,4 +76,15 @@ theApp =
}
main = do
+ papersize <- init <$> readFile "/etc/papersize"
+ let paper = if papersize == "letter" then Letter else A4
+ initialState = St
+ { _stScanningSession = Nothing
+ , _stOCR = True
+ , _stColour = Greyscale
+ , _stPaper = paper
+ , _stDefaultPaper = paper
+ , _stDPI = 300
+ , _stOutdir = ""
+ }
void $ defaultMain theApp initialState