Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.62k stars 705 forks source link

Waybar can't detect system theme #3601

Open joaopedroaat opened 1 month ago

joaopedroaat commented 1 month ago

I'm trying to set auto dark-mode switch on my waybar so it follows my gtk theme

On the wiki it says:

Styling is done using the CSS file format and with a file named style.css. You can also use style-light.css and style-dark.css respectively to follow the system theme.

But when i run my waybar i get the following error:

Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

How can i fix it?

VincentBerthier commented 1 month ago

I have the same issue after updating my system this morning :/ (Using Hyprland, even though I’m not trying to set the theme or anything)

joaopedroaat commented 1 month ago

I have the same issue after updating my system this morning :/ (Using Hyprland, even though I’m not trying to set the theme or anything)

I'm using Hyprland too

allergicapple commented 2 weeks ago

Same on labwc:

[2024-10-17 22:48:57.120] [info] Unable to receive desktop appearance: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
[2024-10-17 22:48:57.120] [info] Using CSS file /home/user/.config/waybar/style.css

Using gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" or "prefer.light" the light/dark switching is not updating the dynamic colors (e.g. @theme_base_color) in the css, thus the used colors stay the same.

or rather: maybe it detects a change, would load the light/dark theme, but because it cannot see if it is currently light or dark, in both cases it loads the same theme, so no visual change.

Edit:

I fixed it. It was a problem with the installed Breeze theme. These exists a file called gtk-dark.css, which seems to be in effect even though the light theme is requested. Fix was to rename/delete these file. Now everything works as intended with full light/dark theme switching.

# GTK has some problems, which results in not switching to the light variant of the Breeze theme. Workaround:
#   cd '/usr/share/themes/Breeze/gtk-3.0/' && sudo mv 'gtk-dark.css' 'gtk-dark.css.disabled'
#   cd '/usr/share/themes/Breeze/gtk-4.0/' && sudo mv 'gtk-dark.css' 'gtk-dark.css.disabled'