Crylia / crylia-theme

A theme for AwesomeWM
516 stars 26 forks source link

[QUESTION] How to change the font of workspaces from (1, 2, 3, ...) to a Japanese font (一 , 二, 三, 四, ...) #39

Closed ghost closed 1 year ago

ghost commented 1 year ago

2023-01-04_12-03

This font...

Crylia commented 1 year ago

https://github.com/Crylia/crylia-theme/blob/3f141601e1ce990dfc2df1480a2150b0dd6202bd/awesome/crylia_bar/init.lua#L15

You can edit the strings there to anything you like (Make sure your font supports kanji)

ghost commented 1 year ago

OK thanks

ghost commented 1 year ago

I edited the above file with the respective kanji fonts installed but its not showing up there in the status bar... (I even rebooted after editing the file) pic1

Crylia commented 1 year ago

Ah sorry, you'd have to edit it here https://github.com/Crylia/crylia-theme/blob/3f141601e1ce990dfc2df1480a2150b0dd6202bd/awesome/src/widgets/taglist.lua#L68 instead of object.index put the character depending on the index there(the index goes from 1 .. 9).

ghost commented 1 year ago

Would you mind elaborating how to put it in there, I mean I did this and now all workspaces just use "一"

pic1

Crylia commented 1 year ago

It works by iterating over all tags, you can use the object.index to check which you are on and then adjust the text.

e.g.

if object.index == 1 then
  tag_widget.container.margin.label:set_text("一")
elseif object.index == 2 then
  tag_widget.container.margin.label:set_text("二")
...
end
ghost commented 1 year ago

Yes it finally works, thank you very much.