Skip to main content
Topic: [Solved]Entering awesome font icon characters in jsonc conf file of waybar (Read 1217 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Solved]Entering awesome font icon characters in jsonc conf file of waybar

Hi,
I try to adapt my waybar config and want to add an icon. I've  installed the awesome font so I can cleary see the icon characters in my current waybar. In my current config.jsonc (which I copied from github to get a headstart)  I see the following :


"custom/browser": {
        "format": " ",
        "on-click": "xdg-open https://",
        "tooltip": true,
        "tooltip-format": "Launch Browser",
},

My question now is : how can I type or enter the icon character on the "format" line ? Do I have to use an escape sequence ?
FYI : I want add something similar to my waybar to start my mail reader (thunderbird), so I can not just 'copy & paste' the format line above.

Regards


Re: Entering awesome font icon characters in jsonc configuration file of waybar.

Reply #1
Hi,
I try to adapt my waybar config and want to add an icon. I've  installed the awesome font so I can cleary see the icon characters in my current waybar. In my current config.jsonc (which I copied from github to get a headstart)  I see the following :


"custom/browser": {
        "format": " ",
        "on-click": "xdg-open https://",
        "tooltip": true,
        "tooltip-format": "Launch Browser",
},

My question now is : how can I type or enter the icon character on the "format" line ? Do I have to use an escape sequence ?
FYI : I want add something similar to my waybar to start my mail reader (thunderbird), so I can not just 'copy & paste' the format line above.

Regards



Am a bit confused so am asking for clarification. You want the icon character to be clickable and launch the thunderbird program?
I haven't tried waybar in a long time so my suggestion maybe useless.

Change the on-click variable from:

Code: [Select]
        "on-click": "xdg-open https://",
to
Code: [Select]
        "on-click": "thunderbird",
or
Code: [Select]
        "on-click": "sh -c thunderbird",

Re: Entering awesome font icon characters in jsonc configuration file of waybar.

Reply #2
It is about the following line :
  "format": " "
And specifically the quoted character after “format”
It does not show well on my forum post because the site does not show well awesome font I guess.
In my terminal kitty it show as a small firefox logo.
If I now want to type this line with another quoted character from the awesome font how do I proceed ?
I found out on the awesome website that each character has a corresponding unicode. The one I would like to use has unicode f0e0. Can I use this somehow to enter the character ?

Re: Entering awesome font icon characters in jsonc configuration file of waybar.

Reply #3
It is about the following line :
  "format": " "
And specifically the quoted character after “format”
It does not show well on my forum post because the site does not show well awesome font I guess.
In my terminal kitty it show as a small firefox logo.
If I now want to type this line with another quoted character from the awesome font how do I proceed ?
I found out on the awesome website that each character has a corresponding unicode. The one I would like to use has unicode f0e. Can I use this somehow to enter the character ?


I see, so you just wanted to change the firefox font character. Just copy paste the font character on you want to use. If you're familiar with scripting or programming jargon then think of that as a string. Otherwise just treat or think of that font character as any other text font character/letter and not as an image/icon file.

I haven't dealt with a json config for quite a while but I think that last key-value pair should have no comma (one marked in red):
Quote
        "tooltip-format": "Launch Browser",

Re: Entering awesome font icon characters in jsonc configuration file of waybar.

Reply #4
@clappingsnowdrop : thanks for the reply but I cannot just copy & paste this character from somewhere.
But in the meantime I've found the solution.
If you want toe enter a character by unicode you have to type <ctrl>+<shift>+u. In my terminal kitty I was then even prompted with a message 'please enter hex code'. I then entered f0e0 and voilà the icon appeared (an envelope).

Marking as solved.


 

Re: Entering awesome font icon characters in jsonc configuration file of waybar.

Reply #5
@clappingsnowdrop : thanks for the reply but I cannot just copy & paste this character from somewhere.
But in the meantime I've found the solution.
If you want toe enter a character by unicode you have to type <ctrl>+<shift>+u. In my terminal kitty I was then even prompted with a message 'please enter hex code'. I then entered f0e0 and voilà the icon appeared (an envelope).

Marking as solved.



I see. Thanks for posting the solution.