xmonad / xmonad-contrib

Contributed modules for xmonad

Home Page:https://xmonad.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`X.P.Unicode`: support Unicode symbols in description

PRESFIL opened this issue · comments

Problem Description

X.P.Unicode allows you to work with Emoji in Unicode, but does not allow you to use
non-Latin characters in the description of these Emojis. X.P.Unicode works fine, but
cannot display such characters correctly.

image

I managed to write a patch to add support, but for this I had to abandon ByteString.
I don't know if this is acceptable or necessary achieve operability with ByteString...

Steps to Reproduce

  1. Install Noto font
  2. Create a file with an Emoji description (/home/user/.xmonad/unicode-data):
1f47e;alien monster | द एलियन
  1. Recompile the Xmonad config
  2. Sparm Unicode prompt
  3. Start typing characters to display completion

Configuration File

import XMonad
import XMonad.Prompt
import XMonad.Prompt.Unicode

import qualified Data.Map as M

-- Prompts
--  default prompt settings
myXPConfig :: XPConfig
myXPConfig = def
  { font = "xft:monospace:size=9,Noto Color Emoji:pixelsize=12:style=Regular,Noto Sans Devanagari UI"
  , height = 17
  , position = Top
  , promptBorderWidth = 0
  , historyFilter = deleteAllDuplicates
  , searchPredicate = fuzzyMatch
  }

myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList
  [ ((modm .|. controlMask, xK_u), unicodePrompt "/home/user/.xmonad/unicode-data" myXPConfig)
  ]

main = do
  xmonad = def
    { keys = myKeys <+> keys def
    }

Checklist

I managed to write a patch to add support, but for this I had to abandon ByteString.
I don't know if this is acceptable or necessary achieve operability with ByteString...

Could you share your patch?

@TheMC47 , what do you think about using String?

I'm not sure, I don't know my way around this area. I thought providing a workaround would serve as a discussion basis with more knowledgeable maintainers. Since you have an alternative, feel free to create a PR! It would be more convenient to review code that way