Skip to content

Comments

Add support for gnome 42 dark mode#91

Open
wmcmillian-coalmarch wants to merge 2 commits intoadi1090x:masterfrom
wmcmillian-coalmarch:gnome42dark
Open

Add support for gnome 42 dark mode#91
wmcmillian-coalmarch wants to merge 2 commits intoadi1090x:masterfrom
wmcmillian-coalmarch:gnome42dark

Conversation

@wmcmillian-coalmarch
Copy link

This adds support for gnome 42's new dark mode. So that the wall paper changes even if it is in dark mode.

@gw8ndal
Copy link

gw8ndal commented Apr 28, 2022

Looks good, I would love to see it merged

@DonFruendo
Copy link

+1 for this. With more people using dark mode and Gnome dedicating a setting to it, this is a really good addition!

@HaydenS3
Copy link

HaydenS3 commented Jul 8, 2022

Works but creates a file with $1 as name on Ubuntu 22.04. Removing the 2>$1 from scripts fixed the issue.

Copy link

@vintagefuture vintagefuture left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to replace 2>$1 with 2>/dev/null
Otherwise an empty file called -c might be generated.

vintagefuture

This comment was marked as duplicate.

@adi1090x
Copy link
Owner

Sorry for being way too late.

Nice PR, can you resolve conflicts and reproduce it?

@adi1090x adi1090x closed this Aug 22, 2023
@adi1090x adi1090x reopened this Aug 22, 2023
@vintagefuture
Copy link

@wmcmillian-coalmarch Are you able to resolve the conflict?
@adi1090x I'm happy to submit a new PR with these same changes if it helps

@dukercs
Copy link

dukercs commented Apr 10, 2025

I had the same issue on GNOME 42 (X11) running on Ubuntu 22.04.
When the script /usr/share/dynamic-wallpaper/dwall.sh it's trying to set a wallpaper using this command:

gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/dynamic-wallpaper/images/room/9.jpg'

…it did not work and gave no error.

🕵️ Root cause:

GNOME uses the key picture-uri-dark instead of picture-uri when dark mode is enabled.

We can check the current color scheme with:

gsettings get org.gnome.desktop.interface color-scheme

If it returns 'prefer-dark', then we need to use:

gsettings set org.gnome.desktop.background picture-uri-dark 'file:///usr/share/dynamic-wallpaper/images/room/9.jpg'

✅ Suggestion: Handle both themes in set_gnome() function, something like

set_gnome() {
    THEME_MODE=$(gsettings get org.gnome.desktop.interface color-scheme)

    if [[ "$THEME_MODE" == "'prefer-dark'" ]]; then
        gsettings set org.gnome.desktop.background picture-uri-dark "file:///$1"
    else
        gsettings set org.gnome.desktop.background picture-uri "file:///$1"
    fi
	gsettings set org.gnome.desktop.screensaver picture-uri "file:///$1"
}

---

Hope this helps others who run into the same issue.  
Great project, by the way! 👏  
Cheers from Brazil 🇧🇷!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants