xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
579 stars 272 forks source link

Identify a location to download data for XMonad.Prompt.Unicode #840

Closed jpolchlo closed 8 months ago

jpolchlo commented 8 months ago

Problem Description

XMonad.Prompt.Unicode requires a data file to function. It appears that unicode-data is used to generate this data file, but the instructions for doing so are not clear, and I've had trouble generating this file for myself. Either more specific instructions should be provided, or a downloadable data file should be made available.

Steps to Reproduce

Not a bug, nothing to reproduce.

Configuration File

N/A, but the function to be used is

import XMonad.Prompt.Unicode

unicodePrompt "/path/to/unicode/data" def

Checklist

geekosaur commented 8 months ago

That module, like everything else in xmonad-contrib, is contributed by someone else (the file header says @nomeata with changes by @nickhu); if they can't help then all we can do is remove the module from the distribution.

nomeata commented 8 months ago

That file is a standard file shipped by distributions. On Ubuntu, you’ll find it in the package unicode-data at path /usr/share/unicode/UnicodeData.txt (see https://packages.debian.org/sid/all/unicode-data/filelist for the list of files).

On NixOS it’s a bit trickier. I just notice that I am running a different version of the code, guess I wrote that when switching to NixOS, that reads supports an environment variable: https://gist.github.com/nomeata/b927440678e905fb433460f38e6f86ce, which I set in my NixOS configuration:

  environment.variables = {
    UNICODE_DATA = "${pkgs.unicode-character-database}/share/unicode";
  };
jpolchlo commented 8 months ago

Hey, @nomeata, thanks for the pointer. I found a file on my system thanks to your reply titled UnicodeData.txt, but it's under /usr/share/texmf-dist, which seems decidedly nonstandard. It does work, but it feels a bit kludge-y. I'd imagine that the standard file located at http://www.unicode.org/Public/UNIDATA/UnicodeData.txt is probably close to ground truth, and so should be called out in the prompt module's docstring. I can probably make a PR with that documentation change if it's useful.

nomeata commented 8 months ago

What is your distribution?

But yes, such a PR would be useful

jpolchlo commented 8 months ago

Gentoo

nomeata commented 8 months ago

Maybe https://packages.gentoo.org/packages/app-i18n/unicode-data would be the canonical package? Where does it put the file?

jpolchlo commented 8 months ago

Yup. That's it. Got thrown by the app-i18n category. Was not familiar with the abbreviation. I'll make a documentation PR.