You are not logged in.

#1 2019-08-24 09:25:14

wire7ack
Member
Registered: 2019-05-18
Posts: 35

[SOLVED] Custom GTK font for specific apps

Hello all. I would like GTK application to use custom font GTK.
I searched the Internet, but found nothing useful.

Help please sad

Last edited by wire7ack (2019-08-28 19:35:23)

Offline

#2 2019-08-24 09:37:07

summerer
Member
From: Germany
Registered: 2014-01-25
Posts: 54

Re: [SOLVED] Custom GTK font for specific apps

Hi wire7ack,

you might want to have a look at this wiki article. It lists some GUI tools you can try out and directly below them, you can see basic configuration example where it looks like one can tweak the fonts aswell.
https://wiki.archlinux.org/index.php/GT … tion_tools

Offline

#3 2019-08-24 09:45:00

wire7ack
Member
Registered: 2019-05-18
Posts: 35

Re: [SOLVED] Custom GTK font for specific apps

summerer wrote:

Hi wire7ack,

you might want to have a look at this wiki article. It lists some GUI tools you can try out and directly below them, you can see basic configuration example where it looks like one can tweak the fonts aswell.
https://wiki.archlinux.org/index.php/GT … tion_tools

Thanks for the answer. I understood how to change the theme for the application, but I did not understand how to change the font by this analogy

Offline

#4 2019-08-24 09:50:23

summerer
Member
From: Germany
Registered: 2014-01-25
Posts: 54

Re: [SOLVED] Custom GTK font for specific apps

If I read this correctly (https://wiki.archlinux.org/index.php/GTK#Configuration) changing the font for GTK3 apps can be done under

$XDG_CONFIG_HOME/gtk-3.0/settings.ini

by changing the gtk-font-name

[Settings]
gtk-icon-theme-name = Adwaita
gtk-theme-name = Adwaita
gtk-font-name = DejaVu Sans 11

Have you tried this yet?

Offline

#5 2019-08-27 17:10:12

wire7ack
Member
Registered: 2019-05-18
Posts: 35

Re: [SOLVED] Custom GTK font for specific apps

summerer wrote:

If I read this correctly (https://wiki.archlinux.org/index.php/GTK#Configuration) changing the font for GTK3 apps can be done under

$XDG_CONFIG_HOME/gtk-3.0/settings.ini

by changing the gtk-font-name

[Settings]
gtk-icon-theme-name = Adwaita
gtk-theme-name = Adwaita
gtk-font-name = DejaVu Sans 11

Have you tried this yet?

Thanks for answer, but I think I asked the wrong question. I wanted to change the font as you answered, but not for all GTK applications, but only for a certain.

Offline

#6 2019-08-27 18:00:45

sevendogs
Member
From: Texas
Registered: 2016-01-24
Posts: 201

Re: [SOLVED] Custom GTK font for specific apps


"Give a man a truth and he will think for a day. Teach a man to reason and he will think for a lifetime"

Offline

#7 2019-08-27 18:43:03

seth
Member
Registered: 2012-09-03
Posts: 62,192

Re: [SOLVED] Custom GTK font for specific apps

For gtk2 applications you can set GTK2_RC_FILES instead of messing up your global config path and firefox et al. will largely ignore your gtk config itfp.

=> It matters a lot, what "application" actually is.

Offline

#8 2019-08-28 07:26:44

wire7ack
Member
Registered: 2019-05-18
Posts: 35

Re: [SOLVED] Custom GTK font for specific apps

Thanks for the answers, but my problem remains unresolved sad

Offline

#9 2019-08-28 07:40:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,197

Re: [SOLVED] Custom GTK font for specific apps

See seth's comment

seth wrote:

=> It matters a lot, what "application" actually is.

Unless you are more transparent here all anyone can do is give you random suggestions, which specific applications do you want to do this with?

Offline

#10 2019-08-28 07:52:29

wire7ack
Member
Registered: 2019-05-18
Posts: 35

Re: [SOLVED] Custom GTK font for specific apps

V1del wrote:

See seth's comment

seth wrote:

=> It matters a lot, what "application" actually is.

Unless you are more transparent here all anyone can do is give you random suggestions, which specific applications do you want to do this with?

Oh, chromium

Offline

#11 2019-08-28 10:09:01

seth
Member
Registered: 2012-09-03
Posts: 62,192

Re: [SOLVED] Custom GTK font for specific apps

Chromium is not a gtk application by any stretch - and things get more complicated: what part of chromium are you concerned about? Content, UI, the web inspector, …?
And because I sense this is gonna end up being an xy-problem: why exactly do you want to alter that font specific to chromium?

Offline

#12 2019-08-28 13:04:24

latalante1
Member
Registered: 2018-08-30
Posts: 110

Re: [SOLVED] Custom GTK font for specific apps

@sevendogs has provided a link in which there is a solution.
It is not optimal (immature) but effective.

mkdir -p ~/.config/cr1/gtk-3.0
printf "[Settings]\ngtk-font-name = DejaVu Sans 10\n" > ~/.config/cr1/gtk-3.0/settings.ini
ln -s ~/.config/chromium ~/.config/cr1
XDG_CONFIG_HOME=$HOME/.config/cr1 chromium

Offline

#13 2019-08-28 19:07:32

wire7ack
Member
Registered: 2019-05-18
Posts: 35

Re: [SOLVED] Custom GTK font for specific apps

latalante1 wrote:

@sevendogs has provided a link in which there is a solution.
It is not optimal (immature) but effective.

mkdir -p ~/.config/cr1/gtk-3.0
printf "[Settings]\ngtk-font-name = DejaVu Sans 10\n" > ~/.config/cr1/gtk-3.0/settings.ini
ln -s ~/.config/chromium ~/.config/cr1
XDG_CONFIG_HOME=$HOME/.config/cr1 chromium

Thank you! You helped me a lot.
If you do not mind, I will ask you:
How to add this command to chromium.desktop. I tried so:

...
Exec=XDG_CONFIG_HOME=$HOME/.config/cr1 chromium

But the font remains the same sad

Offline

#14 2019-08-28 19:25:41

latalante1
Member
Registered: 2018-08-30
Posts: 110

Re: [SOLVED] Custom GTK font for specific apps

Maybe something like that.

...
Exec=env XDG_CONFIG_HOME=$HOME/.config/cr1 /usr/bin/chromium

or

You can create a shell script (wrapper) and place it ~/bin (in the your PATH) and give execute permission (chmod).

#!/bin/sh
XDG_CONFIG_HOME=$HOME/.config/cr1 /usr/bin/chromium "$@"

Offline

#15 2019-08-28 19:35:55

wire7ack
Member
Registered: 2019-05-18
Posts: 35

Re: [SOLVED] Custom GTK font for specific apps

latalante1 wrote:

Maybe something like that.

...
Exec=env XDG_CONFIG_HOME=$HOME/.config/cr1 /usr/bin/chromium

or

You can create a shell script (wrapper) and place it ~/bin (in the your PATH) and give execute permission (chmod).

#!/bin/sh
XDG_CONFIG_HOME=$HOME/.config/cr1 /usr/bin/chromium "$@"

Thanks again. The second option helped me.

Offline

Board footer

Powered by FluxBB