diff --git a/spectacle_uploader.sh b/spectacle_uploader.sh index de5a618..5eb3f25 100755 --- a/spectacle_uploader.sh +++ b/spectacle_uploader.sh @@ -19,7 +19,7 @@ VISIBILITY="${VISIBILITY}" # 0 = public, 1 = unlisted, 2 = private # Notification app header title & preview dimensions APP_NAME="${APP_NAME:-f0ckm}" -PREVIEW_MAX_HEIGHT="${PREVIEW_MAX_HEIGHT:-80}" # Max height in pixels without cropping +PREVIEW_HEIGHT="${PREVIEW_HEIGHT:-80}" # Center crop height in pixels (e.g. 80) # ── 1. Clipboard Helper Function (Wayland / X11) ─────────────────────────── copy_to_clipboard() { @@ -64,16 +64,16 @@ if [ -f "$SAVE_PATH" ]; then # Copy URL to clipboard copy_to_clipboard "$ITEM_URL" - # Create preview thumbnail scaled up to 80px height (no cropping/cutting) + # Create center-cropped preview banner (exact 80px height) PREVIEW_THUMB="/tmp/f0ckm_preview.png" if command -v magick &>/dev/null; then - magick "$SAVE_PATH" -resize "x${PREVIEW_MAX_HEIGHT}>" "$PREVIEW_THUMB" + magick "$SAVE_PATH" -gravity center -crop "x${PREVIEW_HEIGHT}+0+0" +repage "$PREVIEW_THUMB" else PREVIEW_THUMB="$SAVE_PATH" fi - # HTML body with preview max height 80px (no cut), and link on a new line - BODY_TEXT="


${ITEM_URL}" + # HTML body with fixed height preview banner (no scrolling), and link on a new line + BODY_TEXT="


${ITEM_URL}" # Send Notification notify-send \