summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-05-12 23:14:59 +0100
committerjao <jao@gnu.org>2022-05-12 23:14:59 +0100
commit88017cacad159d826ea8a502e062da079f75e3a2 (patch)
tree81a35f53da0f5630bb59610736e07b96c6a8fd8a
parentccffb16e0f254db3c07033fafed0d397f005b902 (diff)
downloadxmobar-88017cacad159d826ea8a502e062da079f75e3a2.tar.gz
xmobar-88017cacad159d826ea8a502e062da079f75e3a2.tar.bz2
Remove the now useless -DUTF8 flag
-rw-r--r--changelog.md7
-rw-r--r--src/Xmobar/Config/Parse.hs4
-rw-r--r--src/Xmobar/Plugins/EWMH.hs10
-rw-r--r--src/Xmobar/Plugins/XMonadLog.hs11
-rw-r--r--src/Xmobar/System/Localize.hsc6
-rw-r--r--src/Xmobar/Text/SwaybarClicks.hs3
-rw-r--r--xmobar.cabal4
7 files changed, 10 insertions, 35 deletions
diff --git a/changelog.md b/changelog.md
index e65ce79..8966c60 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,10 @@
+## Version 0.44 (unreleased)
+
+_Breaking changes_
+
+ - Building with UTF-8 support is now mandatory (the with_utf8 flag
+ is gone).
+
## Version 0.43 (May, 2023)
_New features_
diff --git a/src/Xmobar/Config/Parse.hs b/src/Xmobar/Config/Parse.hs
index 89af808..65e1af8 100644
--- a/src/Xmobar/Config/Parse.hs
+++ b/src/Xmobar/Config/Parse.hs
@@ -26,12 +26,12 @@ import Data.Functor ((<&>))
import Xmobar.Config.Types
-#if defined XFT || defined UTF8
+#ifdef XFT
import qualified System.IO as S (readFile)
#endif
readFileSafe :: FilePath -> IO String
-#if defined XFT || defined UTF8
+#ifdef XFT
readFileSafe = S.readFile
#else
readFileSafe = readFile
diff --git a/src/Xmobar/Plugins/EWMH.hs b/src/Xmobar/Plugins/EWMH.hs
index 6440940..94fd7d7 100644
--- a/src/Xmobar/Plugins/EWMH.hs
+++ b/src/Xmobar/Plugins/EWMH.hs
@@ -23,11 +23,7 @@ import Control.Monad.Reader
import Graphics.X11 hiding (Modifier, Color)
import Graphics.X11.Xlib.Extras
import Xmobar.Run.Exec
-#ifdef UTF8
-#undef UTF8
import Codec.Binary.UTF8.String as UTF8
-#define UTF8
-#endif
import Foreign.C (CChar, CLong)
import Xmobar.X11.Events (nextEvent')
@@ -256,10 +252,4 @@ updateDesktop w = do
_ -> return ()
decodeCChar :: [CChar] -> String
-#ifdef UTF8
-#undef UTF8
decodeCChar = UTF8.decode . map fromIntegral
-#define UTF8
-#else
-decodeCChar = map (toEnum . fromIntegral)
-#endif
diff --git a/src/Xmobar/Plugins/XMonadLog.hs b/src/Xmobar/Plugins/XMonadLog.hs
index d887aad..e1459e1 100644
--- a/src/Xmobar/Plugins/XMonadLog.hs
+++ b/src/Xmobar/Plugins/XMonadLog.hs
@@ -23,12 +23,7 @@ import Graphics.X11.Xlib.Extras
import Xmobar.Run.Exec
import Xmobar.Run.Actions (stripActions)
-#ifdef UTF8
-#undef UTF8
import Codec.Binary.UTF8.String as UTF8
-#define UTF8
-#endif
-
import Foreign.C (CChar)
import Data.List (intercalate)
import Xmobar.X11.Events (nextEvent')
@@ -86,10 +81,4 @@ instance Exec XMonadLog where
return ()
decodeCChar :: [CChar] -> String
-#ifdef UTF8
-#undef UTF8
decodeCChar = UTF8.decode . map fromIntegral
-#define UTF8
-#else
-decodeCChar = map (toEnum . fromIntegral)
-#endif
diff --git a/src/Xmobar/System/Localize.hsc b/src/Xmobar/System/Localize.hsc
index eec5e3b..84c4d45 100644
--- a/src/Xmobar/System/Localize.hsc
+++ b/src/Xmobar/System/Localize.hsc
@@ -25,9 +25,7 @@ import qualified System.Locale as L
import qualified Data.Time.Format as L
#endif
-#ifdef UTF8
import Codec.Binary.UTF8.String
-#endif
-- get localized strings
type NlItem = CInt
@@ -48,12 +46,8 @@ foreign import ccall unsafe "langinfo.h nl_langinfo"
getLangInfo :: NlItem -> IO String
getLangInfo item = do
itemStr <- nl_langinfo item
-#ifdef UTF8
str <- peekCString itemStr
return $ if isUTF8Encoded str then decodeString str else str
-#else
- peekCString itemStr
-#endif
#include <locale.h>
foreign import ccall unsafe "locale.h setlocale"
diff --git a/src/Xmobar/Text/SwaybarClicks.hs b/src/Xmobar/Text/SwaybarClicks.hs
index c829e65..a06c8a1 100644
--- a/src/Xmobar/Text/SwaybarClicks.hs
+++ b/src/Xmobar/Text/SwaybarClicks.hs
@@ -23,9 +23,6 @@ import Control.Monad (when)
import Data.Aeson
-
--- import qualified Data.ByteString.Lazy as BL
-
import GHC.Generics
import Xmobar.System.Utils (forkThread)
diff --git a/xmobar.cabal b/xmobar.cabal
index e8520f1..e01bebd 100644
--- a/xmobar.cabal
+++ b/xmobar.cabal
@@ -1,5 +1,5 @@
name: xmobar
-version: 0.43
+version: 0.44
homepage: https://github.com/jaor/xmobar
synopsis: A Minimalistic Text Based Status Bar
description: Xmobar is a minimalistic text based status bar.
@@ -183,8 +183,6 @@ library
ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-do-bind
- cpp-options: -DUTF8
-
build-depends:
X11 >= 1.6.1,
aeson >= 1.4.7.1,