alex1701c/EmojiRunner

Grey incomplete list of emojis through krunner

Bumbadawg opened this issue ยท 17 comments

Screenshot_20190827_192327
I set the emoticon in KDE settings to various packs but it didn't change.
Also i can't find the configuration window, nor the executable to run from CLI. Hints to get colourful full list of emojis ?

Emojis work fine in other application like Steam/Firefox, but not Krunner.

Sorry for answering so late, I haven't received a notification ๐Ÿ˜ถ

The full list of emojis is in the settings dialog, you can find in in the System Settings and then "Plasma Search" or the settings icon on the left side of Krunner.
If you have launched it you have to search for "EmojiRunner" .

krunner
configure

After a lot of testing I found a simple solution ๐Ÿ˜‡
I have tried in on a new KUbuntu 18.04 install with KDE Plasma 5.12 LTS and
I have only executed the following instructions:

Copy the config file to ~/.config/fontconfig/fonts.conf:
fonts.conf.txt
The file has a .txt extension because I can't attach a .conf file.

Install nerd-fonts from Github.
fonts-emojione and fonts-noto-color-emoji from your package manager.

After installing these packages run fc-cache -f -v and reboot.

@Bumbadawg Thank you for mentioning this issue and if you encounter other problems feel free to ask ๐Ÿ˜€.
PS: The new version of the EmojiRunner pastes the emojis significantly faster so I would recommend to install the new version.

Wonderful, i switched back to breeze emojis, installed those fonts, cleaned the font cache, reboot and it works !
PS: latest update: the .local/share/emojirunner/paste.py is owned by root, you should demote any user files to user rights.

First of all I am happy that it works !๐Ÿ‘

And you are right regarding the user permissions issue, but this Python script has been removed.
Now the plugin uses xdotool to emit Ctrl+V, this is way faster and resource lighter.

Indeed for the folder. Thanks for your work, it's very useful to spam eggplants followed by communicative sweat drops to my mates.
+1 for xdotool. Keep up the good work

going back to you, the font.conf actually messed up my system fonts for MPV, how would you set EmojiOne as "append" only for this kwin script ?

First of all how does MVP look like in your case ?

But going back to your idea: You can actually change the modes and binding properties so that EmojiOne is used as a fallback.
And maybe you can try to remove the lines where the mode="assign" .

As far as I know there is no way to change the font for just one application, but I am by all means
no expert when it comes to Linux fonts.

Maybe https://www.omgubuntu.co.uk/2016/03/enable-color-emoji-linux-svg-font can help you.

I hope that you have now at least a starting point for fixing this issue ๐Ÿ™ƒ

PS: Do the fonts work fine in MVP if you have the fonts.conf removed and what distro are you running?

Edit: Can you try this fontconfig out ? It is maybe less "aggressive" ๐Ÿ˜…

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

    <dir>~/.fonts</dir>
    <dir>/usr/share/fonts</dir>

    <match target="font">
        <edit mode="assign" name="lcdfilter"><const>lcddefault</const></edit>
        <edit mode="assign" name="autohint"><bool>false</bool></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>monospace</string></test>
        <edit name="family" mode="append" binding="strong"><string>EmojiOne</string></edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family"><string>serif</string></test>
        <edit name="family" mode="append" binding="strong"><string>EmojiOne</string></edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family"><string>sans-serif</string></test>
        <edit name="family" mode="append" binding="strong"><string>EmojiOne</string></edit>
    </match>
</fontconfig>

IT JUST WORKS.

PS: My distro is KDE Neon (ubuntu 18.04 + KDE 5.16).

IT JUST WORKS.

Thanks for the quick feedback, I will add a section for this to the README.md

Well, I have used this config over the day and noted that in some occasions simple digits are replaced with emojis for instance 1 gets shown as 1๏ธโƒฃ .
This only happens on some occasions, that's why I haven't noticed it when writing the initial fix.

The reason for this is that the digit 1 is available in two fonts (the original and appended one) but because the binding of the emoji font is set to strong the emoji font is chosen. If the binding would be set to weak the (sometimes uncolored) emojis of the original font would be used.

I have done some digging and tried a lot of tweaks and I came up with a modified version of the archived emojione-color Github repo.
I have tested it and it seems to work with Krunner, Firefox, Konsole and MPV, it would be
very nice if you could try it out and give feedback ๐Ÿ˜ƒ

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <test name="family" compare="eq">
        <string>Bitstream Vera Serif</string>
    </test>
    <edit name="family" mode="assign_replace">
      <string>Bitstream Vera Serif</string>
    </edit>
    <edit name="family" mode="append_last">
      <string>serif</string>
    </edit>
  </match>

  <match>
    <test qual="any" name="family">
        <string>serif</string>
    </test>
    <edit name="family" mode="prepend_first">
      <string>Bitstream Vera Serif</string>
    </edit>
    <edit name="family" mode="prepend_first">
      <string>EmojiOne</string>
    </edit>
  </match>

  <match target="font">
    <test name="family" compare="eq">
        <string>Bitstream Vera Sans</string>
    </test>
    <edit name="family" mode="assign_replace">
      <string>Bitstream Vera Sans</string>
    </edit>
    <edit name="family" mode="append_last">
      <string>sans-serif</string>
    </edit>
  </match>

  <match target="pattern">
    <test qual="any" name="family">
        <string>sans-serif</string>
    </test>
    <edit name="family" mode="prepend_first">
      <string>Bitstream Vera Sans</string>
    </edit>
    <edit name="family" mode="prepend_first">
      <string>EmojiOne</string>
    </edit>
  </match>

  <match target="font">
    <test name="family" compare="eq">
        <string>Bitstream Vera Sans Mono</string>
    </test>
    <edit name="family" mode="assign_replace">
      <string>Bitstream Vera Sans Mono</string>
    </edit>
    <edit name="family" mode="append_last">
      <string>monospace</string>
    </edit>
  </match>

  <match target="pattern">
    <test qual="any" name="family">
        <string>monospace</string>
    </test>
    <!--
    Make Bitstream Vera Sans Mono the first result
    Note: If you want a different monospace font, this is where you change it.
    -->
    <edit name="family" mode="prepend_first">
      <string>Bitstream Vera Sans Mono</string>
    </edit>
    <edit name="family" mode="prepend_first">
      <string>EmojiOne</string>
    </edit>
  </match>

  <alias binding="strong">
    <family>emoji</family>
    <default><family>EmojiOne</family></default>
  </alias>

  <!-- Alias requests for the other emoji fonts -->
  <alias binding="strong">
    <family>Apple Emoji</family>
    <prefer><family>EmojiOne</family></prefer>
    <default><family>sans-serif</family></default>
  </alias>
  <alias binding="strong">
    <family>Segoe UI Emoji</family>
    <prefer><family>EmojiOne</family></prefer>
    <default><family>sans-serif</family></default>
  </alias>
  <alias binding="strong">
    <family>Noto Emoji</family>
    <prefer><family>EmojiOne</family></prefer>
    <default><family>sans-serif</family></default>
  </alias>
</fontconfig>

I confirm i had those blue one all around. Now with the latest build of emojione + your fonts.conf i don't have them anymore. But so are the emojis in krunner, even after a font cache cleanup.

At this point I can only recommend to try the https://github.com/eosrei/twemoji-color-font fonts and their fontconfig out, because I can't reproduce this issue, sorry.

Btw: The reason the emojis work in Steam and Firefox is that they handle the emojis themselves, while this Krunner plugin uses you system wide configuration.

I hope that you can figure this issue somehow out ๐Ÿ˜ƒ.

Hello. I am having the gray emojis problem. I already checked everything stated here when i installed it. I managed to make it work for a short but unknown period of time, i am not sure if it stopped working after i updated the system or after a certain library got updated. I just noticed that color was gone today. I have followed the instructions here but this time i cant get it working. I am a linux vegan (i use arch btw hahaha) One thing thats definitively important, i am sure, is that before if i went to the config i could see the colored emojis there. But now they are all grey. I have installed the packages stated here and rebooted. Any idea?

Thanks a lot @fabianski7 i did as stated in that post and i have it working now, i also learned a little about the problem so i really appreciate that you pointed out those links. Thanks!