summaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2008-04-06 03:12:34 +0200
committerLukas Mai <l.mai@web.de>2008-04-06 03:12:34 +0200
commit937ec3b887137056e32b6c6f9d35f3c29b6abb97 (patch)
treeb94595b776ee06ceb46574dc50e1c191679d12e2 /XMonad
parent5fc44eac6007d35178e5563338f7ec2068e49b20 (diff)
downloadmetatile-937ec3b887137056e32b6c6f9d35f3c29b6abb97.tar
metatile-937ec3b887137056e32b6c6f9d35f3c29b6abb97.zip
XMonad.Main: call setlocale on startup
darcs-hash:20080406011234-462cf-09fde81185653a210d292b90b02595de7c365bb1
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Main.hsc (renamed from XMonad/Main.hs)12
1 files changed, 11 insertions, 1 deletions
diff --git a/XMonad/Main.hs b/XMonad/Main.hsc
index ab276af..5df6ed8 100644
--- a/XMonad/Main.hs
+++ b/XMonad/Main.hsc
@@ -1,4 +1,4 @@
-{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts #-}
+{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, ForeignFunctionInterface #-}
----------------------------------------------------------------------------
-- |
-- Module : XMonad.Main
@@ -23,6 +23,9 @@ import Control.Monad.Reader
import Control.Monad.State
import Data.Maybe (fromMaybe)
+import Foreign.C
+import Foreign.Ptr
+
import System.Environment (getArgs)
import System.Posix.Signals
@@ -37,11 +40,18 @@ import XMonad.Operations
import System.IO
+#include <locale.h>
+
+foreign import ccall unsafe "locale.h setlocale" c_setlocale :: CInt -> Ptr CChar -> IO (Ptr CChar)
+
-- |
-- The main entry point
--
xmonad :: (LayoutClass l Window, Read (l Window)) => XConfig l -> IO ()
xmonad initxmc = do
+ -- setup locale information from environment
+ withCString "" $ \p -> do
+ c_setlocale (#const LC_ALL) p
-- ignore SIGPIPE
installHandler openEndedPipe Ignore Nothing
-- First, wrap the layout in an existential, to keep things pretty: