1280px / elementary-desktop-icons

A series or Bash scripts and patches for re-adding desktop icons to Pantheon (elementary OS), previously named "eOS-xfdesktop4".
0 stars 0 forks source link

xfdesktop4: eOS7's background dim feature is not supported #2

Open 1280px opened 1 year ago

1280px commented 1 year ago

opened on May 3

Due to gala rendering it by applying opacity over wallpaper instead of altering an actual image, it's impossible to get the dimmed variant by just using the actual file path. I think it should be possible to implement using imagemagick, but sounds like way too much hassle for now.

1280px commented 8 months ago

A draft I made:

...
    # change wallpaper image for given desktop on all displays
    /usr/bin/xfconf-query -l -c xfce4-desktop | grep "/backdrop/screen0/monitor.*/workspace${currWorkspaceID}/last-image" |
        while read -r line; do
            # check whether both dark mode and wallpaper dim are ON;
            # see https://github.com/doomemacs/doomemacs/issues/6027#issuecomment-1019373126
            if (echo $(gsettings get io.elementary.desktop.background dim-wallpaper-in-dark-style) | grep -q "true") &&
                (dbus-send --session --dest=org.freedesktop.portal.Desktop --type=method_call \
                    --print-reply /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read \
                    string:org.freedesktop.appearance string:color-scheme);
                then
                    input_image="$1"
                    convert $input_image \
                        -fill "rgba(0,0,0,0.45)" \  # see https://github.com/elementary/gala/pull/1651
                        -draw "rectangle 0,0 $(identify -format "%w,%h" $input_image)" \
                        ~/.xfdesktopWU_dimmed.png
                fi
            else
                /usr/bin/xfconf-query -c xfce4-desktop -p "$line" -s "$wpImage"
            fi
        done
...

However, for the logic to work correctly, we need to somehow monitor dbus color scheme signal changes as well.