commit ed3af9f720da980ae59d1b61288f598798125ab1 parent fa47f437b028295b88544049463e81276cabdae6 Author: Jacob R. Edwards <jacobouno@protonmail.com> Date: Sat, 26 Sep 2020 23:53:16 -0700 Add farbfeld support for xwallpaper Diffstat:
| M | sxiv/.config/sxiv/exec/key-handler | | | 9 | +++++++-- |
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sxiv/.config/sxiv/exec/key-handler b/sxiv/.config/sxiv/exec/key-handler @@ -22,8 +22,13 @@ confirm() setbg() { - ln -f "$1" "$XDG_CONFIG_HOME/wallpaper" - xwallpaper --zoom "$1" + local f="${XDG_CONFIG_HOME:?unset}/wallpaper" + if [ "farbfeld" = `dd if=$1 bs=8 count=1 of=/dev/stdout 2>/dev/null` ]; then + ff2jpg < "$1" > "$f" + else + ln -f "$1" "$f" + fi + xwallpaper --zoom "$f" } case $1