index.md - sites - public wiki contents of suckless.org
 (HTM) git clone git://git.suckless.org/sites
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
       index.md (1423B)
       ---
            1 png images
            2 ==========
            3 
            4 Description
            5 -----------
            6 Preview PNG images using [libspng](https://libspng.org/).
            7 
            8 Lines like `PNG_IMAGE:/path/to/image.png` will be replaced with a preview of
            9 the given image file. The prefix (`PNG_IMAGE:`) can be changed via the `-ip`
           10 flag. An empty prefix string is possible, too.
           11 
           12 The image preview is taken from the top left corner of the image. For vertical
           13 menus, the height is limited to _N_ pixels provided via `-is N` or the height
           14 of two text lines otherwise. For horizontal menus, the preview height equals
           15 the bar height. The image width is limited to _N_ pixels provided via `-is N`
           16 or the height of eight text lines otherwise.
           17 
           18 Example
           19 -------
           20 
           21 Select a [greenclip](https://github.com/erebe/greenclip) clipboard entry with
           22 image previews:
           23 
           24     greenclip print | grep . \
           25       | sed -E 's|^(image/png  )(.*)|\1/tmp/greenclip/\2.png|' \
           26       | ./dmenu -i -fn 'monospace:size=14' -ip 'image/png  ' -p clipboard -l 23 -is 120 \
           27       | sed -E 's|^(image/png  )/tmp/greenclip/(-?[0-9]+)\.png$|\1\2|' \
           28       | xargs -r -d'\n' -I '{}' greenclip print '{}'
           29 
           30 ![dmenu png images screenshot](https://maximilian-schillinger.de/img/screenshot_dmenu_libspng.png)
           31 
           32 Download
           33 --------
           34 * [dmenu-png-images-5.3.diff](dmenu-png-images-5.3.diff) (2024-11-04) ([mirror @ sr.ht](https://git.sr.ht/~maxgyver83/dmenu/tree/image-support-libspng))
           35 
           36 Authors
           37 -------
           38 * Max Schillinger - <maxschillinger@web.de>