#!/bin/sh format="$(printf "jpg\njxl\nwebp\navif" | dmenu -i -p "Compression format")" [ -z "$format" ] && exit quality="$(printf "75\n50\n25" | dmenu -i -p "Compression quality")" [ -z "$quality" ] && exit # We have to pretend using image/png; otherwise, dumbass programs refuse to work xclip -selection clipboard -t image/png -o | convert - -quality "$quality" "$format":- | xclip -selection clipboard -t image/png