Display Chinese and English Characters Conky












0














So I'm trying to add kind of a word of the day thing to conky, but with Chinese words. There's a few ways I've tried this and with no success.



I have my words saved in a csv file formatted like

电脑,dia4nna3o,computer

In conky I've tried running

${exec mycommand}

Where mycommand has been several things:



1) Writing a python script that will print out a random line. Results in nothing (works in bash)



2) A bash script that echos the a random line. Results in nothing (works in bash)



3) Trying to convert the output from one of the above to an image and then displaying that image. Using



python randword.py | convert label:@- tmp.png



to convert the text to an image. While this displays an image, there is nothing where the Chinese character should be (but the English characters are there). Looks like this:



Output image



I'm really at a loss of what to do. Any idea?





System Info:
Distro: Manjaro x86_64
DE: XFCE
Conky Version:



[ steven ] [~] > conky --version                                        
conky 1.10.6_pre compiled Thu Dec 29 16:29:51 UTC 2016 for Linux 4.1.37-1-MANJARO x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky


General:
* math
* hddtemp
* portmon
* IPv6
* Curl
* RSS
* Weather (METAR)
* Weather (XOAP)
* wireless
* support for IBM/Lenovo notebooks
* nvidia
* builtin default configuration
* old configuration syntax
* Imlib2
* apcupsd
* iostats
* ncurses
* Internationalization support

Lua bindings:
* Cairo
* Imlib2
* RSVG
X11:
* Xdamage extension
* Xinerama extension (virtual display)
* XDBE (double buffer extension)
* Xft
* ARGB visual
* Own window

Music detection:
* MPD
* MOC

Default values:
* Netdevice: eth0
* Local configfile: $HOME/.conkyrc
* Localedir: /usr/share/locale
* Maximum netdevices: 64
* Maximum text size: 16384
* Size text buffer: 256









share|improve this question
























  • Does the font you are using in conky contain glyphs for the desired characters?
    – Fox
    Dec 15 at 8:20










  • I can only display English characters in conky. Even things like the ├─ from lsblk do not show. I'm not sure how to get other symbols or fonts loaded. Let alone a mixed one.
    – Steven Walton
    Dec 15 at 8:23
















0














So I'm trying to add kind of a word of the day thing to conky, but with Chinese words. There's a few ways I've tried this and with no success.



I have my words saved in a csv file formatted like

电脑,dia4nna3o,computer

In conky I've tried running

${exec mycommand}

Where mycommand has been several things:



1) Writing a python script that will print out a random line. Results in nothing (works in bash)



2) A bash script that echos the a random line. Results in nothing (works in bash)



3) Trying to convert the output from one of the above to an image and then displaying that image. Using



python randword.py | convert label:@- tmp.png



to convert the text to an image. While this displays an image, there is nothing where the Chinese character should be (but the English characters are there). Looks like this:



Output image



I'm really at a loss of what to do. Any idea?





System Info:
Distro: Manjaro x86_64
DE: XFCE
Conky Version:



[ steven ] [~] > conky --version                                        
conky 1.10.6_pre compiled Thu Dec 29 16:29:51 UTC 2016 for Linux 4.1.37-1-MANJARO x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky


General:
* math
* hddtemp
* portmon
* IPv6
* Curl
* RSS
* Weather (METAR)
* Weather (XOAP)
* wireless
* support for IBM/Lenovo notebooks
* nvidia
* builtin default configuration
* old configuration syntax
* Imlib2
* apcupsd
* iostats
* ncurses
* Internationalization support

Lua bindings:
* Cairo
* Imlib2
* RSVG
X11:
* Xdamage extension
* Xinerama extension (virtual display)
* XDBE (double buffer extension)
* Xft
* ARGB visual
* Own window

Music detection:
* MPD
* MOC

Default values:
* Netdevice: eth0
* Local configfile: $HOME/.conkyrc
* Localedir: /usr/share/locale
* Maximum netdevices: 64
* Maximum text size: 16384
* Size text buffer: 256









share|improve this question
























  • Does the font you are using in conky contain glyphs for the desired characters?
    – Fox
    Dec 15 at 8:20










  • I can only display English characters in conky. Even things like the ├─ from lsblk do not show. I'm not sure how to get other symbols or fonts loaded. Let alone a mixed one.
    – Steven Walton
    Dec 15 at 8:23














0












0








0







So I'm trying to add kind of a word of the day thing to conky, but with Chinese words. There's a few ways I've tried this and with no success.



I have my words saved in a csv file formatted like

电脑,dia4nna3o,computer

In conky I've tried running

${exec mycommand}

Where mycommand has been several things:



1) Writing a python script that will print out a random line. Results in nothing (works in bash)



2) A bash script that echos the a random line. Results in nothing (works in bash)



3) Trying to convert the output from one of the above to an image and then displaying that image. Using



python randword.py | convert label:@- tmp.png



to convert the text to an image. While this displays an image, there is nothing where the Chinese character should be (but the English characters are there). Looks like this:



Output image



I'm really at a loss of what to do. Any idea?





System Info:
Distro: Manjaro x86_64
DE: XFCE
Conky Version:



[ steven ] [~] > conky --version                                        
conky 1.10.6_pre compiled Thu Dec 29 16:29:51 UTC 2016 for Linux 4.1.37-1-MANJARO x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky


General:
* math
* hddtemp
* portmon
* IPv6
* Curl
* RSS
* Weather (METAR)
* Weather (XOAP)
* wireless
* support for IBM/Lenovo notebooks
* nvidia
* builtin default configuration
* old configuration syntax
* Imlib2
* apcupsd
* iostats
* ncurses
* Internationalization support

Lua bindings:
* Cairo
* Imlib2
* RSVG
X11:
* Xdamage extension
* Xinerama extension (virtual display)
* XDBE (double buffer extension)
* Xft
* ARGB visual
* Own window

Music detection:
* MPD
* MOC

Default values:
* Netdevice: eth0
* Local configfile: $HOME/.conkyrc
* Localedir: /usr/share/locale
* Maximum netdevices: 64
* Maximum text size: 16384
* Size text buffer: 256









share|improve this question















So I'm trying to add kind of a word of the day thing to conky, but with Chinese words. There's a few ways I've tried this and with no success.



I have my words saved in a csv file formatted like

电脑,dia4nna3o,computer

In conky I've tried running

${exec mycommand}

Where mycommand has been several things:



1) Writing a python script that will print out a random line. Results in nothing (works in bash)



2) A bash script that echos the a random line. Results in nothing (works in bash)



3) Trying to convert the output from one of the above to an image and then displaying that image. Using



python randword.py | convert label:@- tmp.png



to convert the text to an image. While this displays an image, there is nothing where the Chinese character should be (but the English characters are there). Looks like this:



Output image



I'm really at a loss of what to do. Any idea?





System Info:
Distro: Manjaro x86_64
DE: XFCE
Conky Version:



[ steven ] [~] > conky --version                                        
conky 1.10.6_pre compiled Thu Dec 29 16:29:51 UTC 2016 for Linux 4.1.37-1-MANJARO x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky


General:
* math
* hddtemp
* portmon
* IPv6
* Curl
* RSS
* Weather (METAR)
* Weather (XOAP)
* wireless
* support for IBM/Lenovo notebooks
* nvidia
* builtin default configuration
* old configuration syntax
* Imlib2
* apcupsd
* iostats
* ncurses
* Internationalization support

Lua bindings:
* Cairo
* Imlib2
* RSVG
X11:
* Xdamage extension
* Xinerama extension (virtual display)
* XDBE (double buffer extension)
* Xft
* ARGB visual
* Own window

Music detection:
* MPD
* MOC

Default values:
* Netdevice: eth0
* Local configfile: $HOME/.conkyrc
* Localedir: /usr/share/locale
* Maximum netdevices: 64
* Maximum text size: 16384
* Size text buffer: 256






conky language






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 15 at 21:19

























asked Dec 15 at 8:15









Steven Walton

398112




398112












  • Does the font you are using in conky contain glyphs for the desired characters?
    – Fox
    Dec 15 at 8:20










  • I can only display English characters in conky. Even things like the ├─ from lsblk do not show. I'm not sure how to get other symbols or fonts loaded. Let alone a mixed one.
    – Steven Walton
    Dec 15 at 8:23


















  • Does the font you are using in conky contain glyphs for the desired characters?
    – Fox
    Dec 15 at 8:20










  • I can only display English characters in conky. Even things like the ├─ from lsblk do not show. I'm not sure how to get other symbols or fonts loaded. Let alone a mixed one.
    – Steven Walton
    Dec 15 at 8:23
















Does the font you are using in conky contain glyphs for the desired characters?
– Fox
Dec 15 at 8:20




Does the font you are using in conky contain glyphs for the desired characters?
– Fox
Dec 15 at 8:20












I can only display English characters in conky. Even things like the ├─ from lsblk do not show. I'm not sure how to get other symbols or fonts loaded. Let alone a mixed one.
– Steven Walton
Dec 15 at 8:23




I can only display English characters in conky. Even things like the ├─ from lsblk do not show. I'm not sure how to get other symbols or fonts loaded. Let alone a mixed one.
– Steven Walton
Dec 15 at 8:23










1 Answer
1






active

oldest

votes


















1














You will need to have a suitable font, and also set the locale for conky. I tried the following on a Linux Fedora using conky 1.10.4. Install a font:



sudo dnf install google-noto-cjk-fonts 


Create a file with some utf8 character:



    printf 'xe5xbax83n' >chars


Create a .conkyrc that sets a global cjk font, and also tries setting a variant within the text part, and uses cat to read the above file:



conky.config = {
minimum_height = 400,
minimum_width = 600,
font = 'Noto Sans CJK TC Regular:size=40',
use_xft = true,
};
conky.text = [[
start ${exec cat chars} end
${font Noto Sans CJK TC Bold:size=20} start ${exec cat chars} end ${font}
]]


Run conky in a utf8 locale



    LC_ALL=en_US.utf8 conky -c .conkyrc -o


to get the result:



conky






share|improve this answer





















  • Seems like something else is going on. With ONLY what you put in the conkyrc file I still get the square that represents unknown symbol. Again, catting chars shows the correct thing in the terminal. I'll update my post for system info
    – Steven Walton
    Dec 15 at 20:53










  • Your conky info is the same as mine. Presumably, fc-match 'Noto Sans CJK TC' shows NotoSansCJK-Regular.ttc as a match.
    – meuh
    Dec 15 at 22:29










  • That would be correct. I get the same output.
    – Steven Walton
    Dec 15 at 22:52











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f488106%2fdisplay-chinese-and-english-characters-conky%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You will need to have a suitable font, and also set the locale for conky. I tried the following on a Linux Fedora using conky 1.10.4. Install a font:



sudo dnf install google-noto-cjk-fonts 


Create a file with some utf8 character:



    printf 'xe5xbax83n' >chars


Create a .conkyrc that sets a global cjk font, and also tries setting a variant within the text part, and uses cat to read the above file:



conky.config = {
minimum_height = 400,
minimum_width = 600,
font = 'Noto Sans CJK TC Regular:size=40',
use_xft = true,
};
conky.text = [[
start ${exec cat chars} end
${font Noto Sans CJK TC Bold:size=20} start ${exec cat chars} end ${font}
]]


Run conky in a utf8 locale



    LC_ALL=en_US.utf8 conky -c .conkyrc -o


to get the result:



conky






share|improve this answer





















  • Seems like something else is going on. With ONLY what you put in the conkyrc file I still get the square that represents unknown symbol. Again, catting chars shows the correct thing in the terminal. I'll update my post for system info
    – Steven Walton
    Dec 15 at 20:53










  • Your conky info is the same as mine. Presumably, fc-match 'Noto Sans CJK TC' shows NotoSansCJK-Regular.ttc as a match.
    – meuh
    Dec 15 at 22:29










  • That would be correct. I get the same output.
    – Steven Walton
    Dec 15 at 22:52
















1














You will need to have a suitable font, and also set the locale for conky. I tried the following on a Linux Fedora using conky 1.10.4. Install a font:



sudo dnf install google-noto-cjk-fonts 


Create a file with some utf8 character:



    printf 'xe5xbax83n' >chars


Create a .conkyrc that sets a global cjk font, and also tries setting a variant within the text part, and uses cat to read the above file:



conky.config = {
minimum_height = 400,
minimum_width = 600,
font = 'Noto Sans CJK TC Regular:size=40',
use_xft = true,
};
conky.text = [[
start ${exec cat chars} end
${font Noto Sans CJK TC Bold:size=20} start ${exec cat chars} end ${font}
]]


Run conky in a utf8 locale



    LC_ALL=en_US.utf8 conky -c .conkyrc -o


to get the result:



conky






share|improve this answer





















  • Seems like something else is going on. With ONLY what you put in the conkyrc file I still get the square that represents unknown symbol. Again, catting chars shows the correct thing in the terminal. I'll update my post for system info
    – Steven Walton
    Dec 15 at 20:53










  • Your conky info is the same as mine. Presumably, fc-match 'Noto Sans CJK TC' shows NotoSansCJK-Regular.ttc as a match.
    – meuh
    Dec 15 at 22:29










  • That would be correct. I get the same output.
    – Steven Walton
    Dec 15 at 22:52














1












1








1






You will need to have a suitable font, and also set the locale for conky. I tried the following on a Linux Fedora using conky 1.10.4. Install a font:



sudo dnf install google-noto-cjk-fonts 


Create a file with some utf8 character:



    printf 'xe5xbax83n' >chars


Create a .conkyrc that sets a global cjk font, and also tries setting a variant within the text part, and uses cat to read the above file:



conky.config = {
minimum_height = 400,
minimum_width = 600,
font = 'Noto Sans CJK TC Regular:size=40',
use_xft = true,
};
conky.text = [[
start ${exec cat chars} end
${font Noto Sans CJK TC Bold:size=20} start ${exec cat chars} end ${font}
]]


Run conky in a utf8 locale



    LC_ALL=en_US.utf8 conky -c .conkyrc -o


to get the result:



conky






share|improve this answer












You will need to have a suitable font, and also set the locale for conky. I tried the following on a Linux Fedora using conky 1.10.4. Install a font:



sudo dnf install google-noto-cjk-fonts 


Create a file with some utf8 character:



    printf 'xe5xbax83n' >chars


Create a .conkyrc that sets a global cjk font, and also tries setting a variant within the text part, and uses cat to read the above file:



conky.config = {
minimum_height = 400,
minimum_width = 600,
font = 'Noto Sans CJK TC Regular:size=40',
use_xft = true,
};
conky.text = [[
start ${exec cat chars} end
${font Noto Sans CJK TC Bold:size=20} start ${exec cat chars} end ${font}
]]


Run conky in a utf8 locale



    LC_ALL=en_US.utf8 conky -c .conkyrc -o


to get the result:



conky







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 15 at 20:11









meuh

31.4k11854




31.4k11854












  • Seems like something else is going on. With ONLY what you put in the conkyrc file I still get the square that represents unknown symbol. Again, catting chars shows the correct thing in the terminal. I'll update my post for system info
    – Steven Walton
    Dec 15 at 20:53










  • Your conky info is the same as mine. Presumably, fc-match 'Noto Sans CJK TC' shows NotoSansCJK-Regular.ttc as a match.
    – meuh
    Dec 15 at 22:29










  • That would be correct. I get the same output.
    – Steven Walton
    Dec 15 at 22:52


















  • Seems like something else is going on. With ONLY what you put in the conkyrc file I still get the square that represents unknown symbol. Again, catting chars shows the correct thing in the terminal. I'll update my post for system info
    – Steven Walton
    Dec 15 at 20:53










  • Your conky info is the same as mine. Presumably, fc-match 'Noto Sans CJK TC' shows NotoSansCJK-Regular.ttc as a match.
    – meuh
    Dec 15 at 22:29










  • That would be correct. I get the same output.
    – Steven Walton
    Dec 15 at 22:52
















Seems like something else is going on. With ONLY what you put in the conkyrc file I still get the square that represents unknown symbol. Again, catting chars shows the correct thing in the terminal. I'll update my post for system info
– Steven Walton
Dec 15 at 20:53




Seems like something else is going on. With ONLY what you put in the conkyrc file I still get the square that represents unknown symbol. Again, catting chars shows the correct thing in the terminal. I'll update my post for system info
– Steven Walton
Dec 15 at 20:53












Your conky info is the same as mine. Presumably, fc-match 'Noto Sans CJK TC' shows NotoSansCJK-Regular.ttc as a match.
– meuh
Dec 15 at 22:29




Your conky info is the same as mine. Presumably, fc-match 'Noto Sans CJK TC' shows NotoSansCJK-Regular.ttc as a match.
– meuh
Dec 15 at 22:29












That would be correct. I get the same output.
– Steven Walton
Dec 15 at 22:52




That would be correct. I get the same output.
– Steven Walton
Dec 15 at 22:52


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f488106%2fdisplay-chinese-and-english-characters-conky%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre