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 Sat 20 Sep 2014, 16:14
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 [1 Post]  
Author Message
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Tue 25 Jan 2011, 22:17    Post subject:  quickview
Subject description: 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   260 Time(s)

quicview.png

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


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