对 Xmonad 工作区使用 unicode 字符

lok*_*oki 2 unicode haskell xmonad

我想在 Xmonad 的工作区中使用Nerd Fonts 中的Unicode 字符。

myWorkspaces = ["1:?", "2:?", "3:?", "4:?", "5:?", "6:?", "7:?", "8:?", "9:?"]
Run Code Online (Sandbox Code Playgroud)

以供参考:

工作区 Unicode 名称数组

但是,我在编译时收到以下错误:

xmonad.hs:191:13: error:
    lexical error in string/character literal at character '\62057'
    |
191 |         ["1:?", "2:?", "3:?", "4:?", "5:?", "6:?", "7:?", "8:?", "9:?"]
    |             ^

Please check the file for errors.

Warning: Missing charsets in String to FontSet conversion 
Run Code Online (Sandbox Code Playgroud)

有没有机会使用一整套书呆子字体 unicode 字符?我已经看到其他人在他们的 config 中使用了 unicode 的子集。

Jos*_*ica 6

我认为您遇到了GHC 错误 #5518。作为一种解决方法,请尝试使用转义语法(例如,"1:\62057""1:\xf269"代替"1:?")。

  • 也许值得注意的是,虽然这与 bug #5518“相关”,但这种行为实际上并不是一个 bug。Haskell 标准和 GHC 要求字符串文字仅包含“图形”Unicode 字符(字母、标记、数字、标点符号、符号和空格,对应于 Unicode 类别 L、M、N、P、S 和 Z,并且不包括上述大多数字符(被指定为“私人使用”或类别 Co)。 (2认同)