===== View Images ===== Shows all images from the currently viewed website pretty formated and resized in either the same or a new uzbl instance. This script is meant to demonstrate JavaScript substitution and [[html-mode]] in a real world example. ==== Usage ==== Save the script below to a file and execute it. \\ See the comments for how to customize the behaviour and appearence. **NOTE:** You will at least have to customize //SOCKET// and //FIFO// ==== Script ==== #!/bin/bash # # (c) 2009, Robert Manea # # Display all images of the currently viewed site # # Modify, these should probably be setable as cl arguments # SOCKET=/tmp/uzbl_socket_main FIFO=/tmp/uzbl_fifo_main #path to uzblctrl # UCTL=uzblctrl #path to uzblcat # UCAT=uzblcat # Preferences # IMAGES_PER_ROW=4 IMAGE_WIDTH=150 IMAGE_HEIGHT=90 #---------------------------------------------------------------------- IMAGE_CNT=$($UCTL -s $SOCKET -c 'print @@') SITE_URL=$($UCTL -s $SOCKET -c 'print @@') # retrieve image links i=0 for url in $($UCTL -s $SOCKET -c 'print @@') do IMG[$((i++))]="$url" done # construct the page holding the images # ( cat << EOHTML

Images on
$SITE_URL:

EOHTML for i in $(seq 0 $IMAGE_CNT) do [ $(($i % $IMAGES_PER_ROW)) -eq 0 ] && echo '' cat << EOHTML EOHTML done echo '
' \ '' ) | $UCAT > $FIFO # open in existing instance #) | $UCAT | uzbl -c - # display in new uzbl instance