Created
March 15, 2026 04:54
-
-
Save rumly111/416826c35aea392e731352503f876877 to your computer and use it in GitHub Desktop.
Workaround for Xfce 4.20 Wayland Wallpaper Bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/fish | |
| function sync_xfce_wallpaper | |
| set SOURCE "monitorUMCSHARP" | |
| set TARGET "monitorHDMI-A-1" | |
| set CHANNEL "xfce4-desktop" | |
| set props "backdrop-cycle-enable" "backdrop-cycle-random-order" "backdrop-cycle-timer" "color-style" "image-style" "last-image" "rgba1" "rgba2" | |
| set types "bool" "bool" "int" "int" "int" "string" "rgba" "rgba" | |
| for prop in (xfconf-query -c $CHANNEL -l | grep $SOURCE) | |
| set base_name (basename $prop) | |
| if set -l index (contains -i -- $base_name $props) | |
| set type $types[$index] | |
| else | |
| printf "[warn] unknown property: %s\n" $base_name | |
| continue | |
| end | |
| set target_prop (string replace $SOURCE $TARGET $prop) | |
| if test "$type" = "rgba" | |
| set parts (xfconf-query -c $CHANNEL -p $prop | sed '1,2d' | string split '\n' | tr , .) | |
| xfconf-query -c $CHANNEL -p $target_prop -n -t double -t double -t double -t double -s $parts[1] -s $parts[2] -s $parts[3] -s $parts[4] | |
| else | |
| set value (xfconf-query -c $CHANNEL -p $prop) | |
| xfconf-query -c $CHANNEL -p $target_prop -n -t $type -s $value | |
| end | |
| end | |
| end | |
| sync_xfce_wallpaper | |
| xfconf-query -c xfce4-desktop -p /backdrop/screen0 -m | while read -l line | |
| if string match -q "*monitorUMCSHARP*" "$line" | |
| sync_xfce_wallpaper | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment