From aeb613133472da374bf292a66296f16e23d8fc6f Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Fri, 16 Jan 2026 13:30:08 +0100 Subject: Enable hyprland gnome settings to set prefer-dark for all apps --- roles/hyprland/tasks/main.yml | 2 ++ roles/hyprland/templates/hyprland/envs.conf.j2 | 14 ++++++++++++++ roles/hyprtheme/files/scripts/theme-set | 14 +++++++------- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/roles/hyprland/tasks/main.yml b/roles/hyprland/tasks/main.yml index 93fb2743..2119d456 100644 --- a/roles/hyprland/tasks/main.yml +++ b/roles/hyprland/tasks/main.yml @@ -9,6 +9,8 @@ - "hyprlock" - "hypridle" - "hyprland" + - "xdg-desktop-portal-gtk" + - "xdg-desktop-portal-hyprland" - name: "Configure greetd" become: true diff --git a/roles/hyprland/templates/hyprland/envs.conf.j2 b/roles/hyprland/templates/hyprland/envs.conf.j2 index 51f7bc08..05ba1693 100644 --- a/roles/hyprland/templates/hyprland/envs.conf.j2 +++ b/roles/hyprland/templates/hyprland/envs.conf.j2 @@ -3,3 +3,17 @@ env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 + +# Force all apps to use Wayland +env = GDK_BACKEND,wayland,x11,* +env = QT_QPA_PLATFORM,wayland;xcb +env = QT_STYLE_OVERRIDE,kvantum +env = SDL_VIDEODRIVER,wayland +env = MOZ_ENABLE_WAYLAND,1 +env = ELECTRON_OZONE_PLATFORM_HINT,wayland +env = OZONE_PLATFORM,wayland +env = XDG_SESSION_TYPE,wayland + +# Allow better support for screen sharing (Google Meet, Discord, etc) +env = XDG_CURRENT_DESKTOP,Hyprland +env = XDG_SESSION_DESKTOP,Hyprland diff --git a/roles/hyprtheme/files/scripts/theme-set b/roles/hyprtheme/files/scripts/theme-set index 31a9bc73..61b7345e 100644 --- a/roles/hyprtheme/files/scripts/theme-set +++ b/roles/hyprtheme/files/scripts/theme-set @@ -39,13 +39,13 @@ fi killall -SIGUSR1 kitty >/dev/null 2>&1 || true killall -SIGUSR2 ghostty >/dev/null 2>&1 || true -# if [[ -f ~/.config/hyprtheme/current/light.mode ]]; then - # gsettings set org.gnome.desktop.interface color-scheme "prefer-light" - # gsettings set org.gnome.desktop.interface gtk-theme "Adwaita" -# else - # gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" - # gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark" -# fi +if [[ -f ~/.config/hyprtheme/current/light.mode ]]; then + gsettings set org.gnome.desktop.interface color-scheme "prefer-light" + gsettings set org.gnome.desktop.interface gtk-theme "Adwaita" +else + gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" + gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark" +fi # # Change gnome icon theme color # GNOME_ICONS_THEME=~/.config/hyprtheme/current/icons.theme -- cgit v1.2.3