You are not logged in.
On X11/i3, my gtk3 apps use the Arc them fine, but on wayland/sway, they all use the default theme for some reason.
The only thing relevant I can think of it my settings file:
$ cat .config/gtk-3.0/settings.ini
[Settings]
gtk-theme-name = Arc-Darker
gtk-icon-theme-name = Arc
gtk-fallback-icon-theme = gnome
gtk-font-name = Ubuntu 10
gtk-menu-images = true
# "disables" recent files entries
gtk-recent-files-max-age=0
gtk-recent-files-limit=0
gtk-dialogs-use-header = false
gtk-windows-use-header = false
Any ideas? Any hints? Any idea where I might follow up on this?
Last edited by hobarrera (2020-02-25 13:57:50)
Offline
It looks like you're experiencing this issue which is due to an incompatibility between sway and GTK+3. The page I linked has some workarounds.
Offline
I don't know if I have to open a new thread but I am also experimenting this issue. I tried the workarounds from https://github.com/swaywm/sway/wiki/GTK … n-Wayland/ but it did not work.
When I open dconf-editor or any GTK3 app in Weston it opens properly but it does not on Sway and Plasma-Wayland.
Best regards.
Archlinux Colombia!!!
Offline
Have you tried setting the environment variable GTK_THEME=Arc-Darker ?
I personally use GTK_THEME=Adwaita:dark
Offline
Have you tried setting the environment variable GTK_THEME=Arc-Darker ?
I personally use GTK_THEME=Adwaita:dark
Hello,
Firstable thanks for your help.
Yes, I tried in the past and the environment works but the big problem are the fonts, it looks so ugly. I open any app in Weston and it looks fine but when I open in Plasma or Sway it doesn't and I cannot figure out what is going on
I also tried changing themes temporally with "dconf-editor" but It does not work
Archlinux Colombia!!!
Offline
I actually have this problem:
https://github.com/flatpak/flatpak/issues/2861
But in my case it happens with any GTK3 app
Archlinux Colombia!!!
Offline
Hello again, I could finally solved the problem. I accept that I made a mistake but I will post the solution anyway in order to anybody else don't make the same mistake as I did.
As @C-Ren said the solution is here but I tried again and again on the same solution without reading anything else. I edited the sway configuration file with this:
set $gnome-schema org.gnome.desktop.interface
exec_always {
gsettings set $gnome-schema gtk-theme 'Your theme'
gsettings set $gnome-schema icon-theme 'Your icon theme'
gsettings set $gnome-schema cursor-theme 'Your cursor Theme'
}
There is a BUG with that solution, posted here and here and that's why Sway could not apply the changes.
So I finally decided to apply the other solution which consist in creating a script called "import-gsettings" with this content:
#!/bin/sh
# usage: import-gsettings <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ...
expression=""
for pair in "$@"; do
IFS=:; set -- $pair
expressions="$expressions -e 's:^$2=(.*)$:gsettings set org.gnome.desktop.interface $1 \1:e'"
done
IFS=
eval exec sed -E $expressions "${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini >/dev/null
And edit the Sway config file with this:
exec_always import-gsettings \
gtk-theme:gtk-theme-name \
icon-theme:gtk-icon-theme-name \
cursor-theme:gtk-cursor-theme-name
That's worked for me. I hope this help anybody else.
Best regards.
Archlinux Colombia!!!
Offline
Feedback here was spot on. It works perfect now, thanks!
Offline
I copied your code, but the settings are still ignored for me (tried with Thunar):
$ cat /home/xenon/.config/sway/scripts/import-gsettings.sh
#!/bin/sh
# usage: import-gsettings.sh <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ...
expression=""
for pair in "$@"; do
IFS=:; set -- $pair
expressions="$expressions -e 's:^$2=(.*)$:gsettings set org.gnome.desktop.interface $1 \1:e'"
done
IFS=
eval exec sed -E $expressions "${XDG_CONFIG_HOME:-$HOME/.config}"/gtk-3.0/settings.ini >/dev/null
$ cat .config/sway/config
...
# Load GTK options from settings.ini
exec_always ~/.config/sway/scripts/import-gsettings.sh \
gtk-theme:gtk-theme-name \
icon-theme:gtk-icon-theme-name \
cursor-theme:gtk-cursor-theme-name
...
$ cat /home/xenon/.config/gtk-3.0/settings.ini
[Settings]
gtk-theme-name = Adwaita-dark
gtk-icon-theme-name = Adwaita
gtk-font-name = Monospace 11
Any idea why?
Offline
I copied your code, but the settings are still ignored for me (tried with Thunar):
Maybe Thunar uses GTK2? Afaik you could also set gtk options in .bashrc (inside home folder).
Last edited by equalizer876 (2020-12-30 11:59:42)
Offline
No, not anymore, it's been ported to GTK3 a while ago.
As per the Wiki entry the very presence of the settings.ini should suffice to have the settings applied, but it's not the case.
Offline
Actually, the setup as described in the GTK Wiki entry is working as expected for *all* my GTK applications *except* Thunar, which accepts the color scheme, but ignores the font. This could be fixed by defining a gtk.css in ~/.config/gtk-3.0 as described here.
Last edited by teXnican (2020-12-30 13:42:27)
Offline
I feel the need to mention, this is still an issue and we are close to the end of 2024 ... smhmyhead
Offline
The wiki was updated long ago on this topic. From https://wiki.archlinux.org/title/GTK#Wayland_backend:
When using the Wayland backend, some variables are not sourced from settings.ini. Any key that is present in the GSettings schema org.gnome.desktop.interface are read from there instead of settings.ini.
You need to configure these settings via dconf.
Offline