Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 21 Dec 2014, 17:35
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
quickview
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count_1  
Author Message
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Tue 25 Jan 2011, 22:17    Post_subject:  quickview
Sub_title: fast viewing for downloaded image files
 

Finds and views recent downloaded image file (searches for current day)
Edit download directory and viewer at top of script. Deletes image when program closes.

I run this from a tray icon with my text browser. When I want to view an image, I download and click on the icon. (Links browser downloads with "I" <return>).

Code:

#!/bin/sh

## view/delete current downloaded image file
## for use with text browser


## edit: working directory
DESK="/mnt/sda2/Desktop"
## edit: viewer
VW="viewnior"



[ -f /tmp/jpgs ] && rm /tmp/jpgs

cd "$DESK"

DAY="$(date +%d)"


ls -l | egrep '(\.jpg|\.gif|\.png|\.bmp|\.tiff)' >>/tmp/jpgs

while read line; do
  JPG="$(echo $line | cut -d' ' -f8-)"
  JDAY="$(echo $line | cut -d' ' -f6-  | cut -d\- -f3 | cut -d' ' -f1)" 
        [ "$JDAY" == "$DAY" ] && "$VW"  "$JPG"   && VAR=$JPG
       
done < /tmp/jpgs

sleep 1
wait
[ "$VAR" ] && rm "$VAR"
[ -f /tmp/jpgs ] && rm /tmp/jpgs

quicview.png
 Description   
 Filesize   216.77 KB
 Viewed   265 Time(s)

quicview.png

Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0500s ][ Queries: 13 (0.0164s) ][ GZIP on ]