diff options
Diffstat (limited to 'cam')
-rw-r--r-- | cam/ChangeLog | 14 | ||||
-rw-r--r-- | cam/README | 45 | ||||
-rw-r--r-- | cam/cam_bookmarks | 2 | ||||
-rwxr-xr-x | cam/feh-cam | 195 | ||||
-rwxr-xr-x | cam/gen-cam-menu | 44 |
5 files changed, 0 insertions, 300 deletions
diff --git a/cam/ChangeLog b/cam/ChangeLog deleted file mode 100644 index 4a562bd..0000000 --- a/cam/ChangeLog +++ /dev/null @@ -1,14 +0,0 @@ -0.3 ---- -- added this changelog.. - -0.4 ---- -- added richlowe's patch. since he pretty much rewrote everything, he's -an author, not a contributor. :) -- uses "use strict" now -- uses POD for documentation -- added title support in cam bookmarks file -- cmd line flag for different bookmars file -- getoppt_long use for command-line flags -- rmeoved richlow's damn nonstandard Pod::Usage stuff diff --git a/cam/README b/cam/README deleted file mode 100644 index e67d60e..0000000 --- a/cam/README +++ /dev/null @@ -1,45 +0,0 @@ -Cam 0.4 README -============== -This document was last updated on 20010223-1620-PST. -Please see the file COPYING for licensing information. - -Description -=========== -feh-cam is a Perl wrapper for feh that simlifies viewing webcams. It uses -keyed bookmarks. Type "feh-cam --help" at the command line for usage -information. - -Webcam Information -================== -All webcam images are the property of their respective owners. If you -enjoy the cam, you should check out the page too! The initial list of -cam bookmarks (in the cam_bookmarks file) is a combination of webcams -scoured from the #E People Page (http://bma.debian.net/~bma/e-irc/), -my favorite webcams from the Stile Project's cam pages -(http://www.stileproject.com/), and additional #e people cams that -have come online since cam's original release (0.1). - -Installation -============ -- Copy the "feh-cam" script to a location in your PATH (ex /usr/bin, - /usr/local/bin, or $HOME/bin), and make sure hte execute bit on the - script is set (type "chmod a+x $HOME/.cam_bookmarks"). -- Copy the "cam_bookmarks" file to $HOME/.cam_bookmarks and make sure - cam can see it by typing "feh-cam --list". -- Optionally, modify the options inside the feh-cam script. You can pass - feh any options before the image by adjusting the $PRE variable, - and any options after the image by adjustin the $POST variable. - For example, I like to keep all cam images by default; you can enable - this behavior with the -k command line option, or enable it permanently - by adding it to the $PRE flags in feh-cam. - -About the Authors -================= -Paul Duncan <pabs@pablotron.org>, pabs on #e -http://www.pablotron.org/ - -Richard Lowe <richlowe@btinternet.com>, richlowe on #e -http://www.richlowe.btinternet.co.uk/ - -...but the real credit goes to Tom Gilbert for making feh, an awesome -image viewer. :) diff --git a/cam/cam_bookmarks b/cam/cam_bookmarks deleted file mode 100644 index 8d45413..0000000 --- a/cam/cam_bookmarks +++ /dev/null @@ -1,2 +0,0 @@ -nasa_shuttle=60,http://science.ksc.nasa.gov/shuttle/countdown/video/chan2large.jpg - diff --git a/cam/feh-cam b/cam/feh-cam deleted file mode 100755 index 29b254f..0000000 --- a/cam/feh-cam +++ /dev/null @@ -1,195 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use Getopt::Long; - -############################################# -############# CAM RUN-TIME OPTIONS ########## -############################################# -my $feh = "feh"; - -# additional feh cmdline options -my $PRE = " -q -G -Twebcam -1 0 -0 1 "; -my $POST = ""; -############################################# -############################################# - -# Options -my $help = ''; -my $fullscreen = ''; -my $geometry = ''; -my $list = ''; -my $verbose = ''; -my $add = ''; -my $keep = ''; -my $deftitle = '%cCAM - %u'; -my $title = ''; -my $bp = $ENV{HOME}."/.cam_bookmarks"; -my $DEBUG = 0; - -# check args -&print_usage_and_exit unless (@ARGV); - -print STDERR "Note: feh-cam will be removed from the feh distribution in 2013.\n"; -print STDERR "Please mail derf\@finalrewind.org if you still use it.\n"; - - -# Url, Refresh, and bookmarks -my $url = ""; -my $ref = ""; -my %bms = (); - -GetOptions('help|?|h' => \$help, - 'full-screen|f|giblets-mom' => \$fullscreen, - 'list|l' => \$list, - 'geometry|g=s' => \$geometry, - 'verbose|v' => \$verbose, - 'add|a' => \$add, - 'keep-images|k|save-pr0n' => \$keep, - 'title|t=s' => \$title, - 'debug|d' => \$DEBUG, - 'bookmarks|b=s' => \$bp - ); - -my $key = shift @ARGV; - -&print_usage_and_exit if ($help); - -if ($verbose) { - $PRE .= " -V "; -} - -if ($fullscreen) { - $PRE =~ s/-w//; - $PRE .= " --full-screen --auto-zoom "; -} - -if ($geometry) { - $PRE .= " --geometry $geometry "; -} - -# if requested, add a key/url pair to bookmarks file -if ($add) { - my $mytitle = ''; - ($url,$ref,$mytitle) = @ARGV; - die "Bad key syntax\n" unless ($key && $url && $ref); - - $mytitle="" unless ($mytitle); - - open(BMF, ">>$bp") or die "Couldn't open bookmarks file \"$bp\": $!\n"; - print BMF "$key=$ref,$url \"$mytitle\"\n"; - close BMF; - print "Added URL key \"$key\" = $url, $ref.\n"; # its useful to have this even if you arent debugging --richlowe - exit 0; -} - -if ($keep) { - $PRE .= " -k "; -} - - - -# load bookmarks -open(BMF, "$bp") or die "Couldn't open bookmarks file \"$bp\": $!\n"; -foreach (<BMF>) { - next unless /^(.*?)=(.*)$/; - $bms{$1} = $2; - print "key=$1, url=$2\n" if ($DEBUG); -} -close BMF; - -# if requested, dump a list of key/url pair values -if ($list) { - foreach (sort keys %bms) { - my $t = $bms{$_}; - - $t =~ s/^(.+?),(.+?)(^ "(.*)"|)?$/$2/; - chomp $t; - print "$_ = $t, $1, $3\n"; - } - exit 0; -} - -# main loop -MAIN: { - do { - $title=""; - $url = $bms{$key}; - die "Couldn't find URL key \"$key.\"\n" unless($url); - - $url =~ s/^(.+?),(.+?)( "(.*)")?$/$2/; - $ref = $1; - - if ($4) { - $title = $4; - } else { - $title = $deftitle; - } - - if ($title) { - $title =~ s/\%c/$key/g; - $title =~ s/\%u/$url/g; - $title =~ s/\%r/$ref/g; - $title =~ s/\%\%/\%/g; - $title = " --title \"$title\" "; - } - - my $cmd = "$feh $PRE $title -T".$key."cam -R $ref $url $POST"; - print "$cmd\n" if ($DEBUG); - FORK: { - my $pid; - if ($pid = fork) { - # We're a daddy! :) - } elsif (defined $pid) { - # child - exec "$cmd" or die "Couldnt exec() $feh: $!\n"; - } elsif ( $! =~ /No more process/) { - sleep 5; - redo FORK; - } else { - # wtf? - die "Unrecoverable fork() error: $!\n"; - } - } - } while ($key = shift @ARGV); -} - - -sub print_usage_and_exit() { - print <<END_USAGE; -$0 0.4 -by Paul Duncan <pabs\@pablotron.org>, and - Richard Lowe <richlowe\@btinternet.com> - -Description: - A convenient webcam wrapper for feh. - -Usage: - $0 <keys> - Load the urls specified by the given keys. - key : a url key stored in the bookmarks file (\"$bp\"). - $0 <-a|--add> key url refresh - Add a key to the bookmarks file. - key : short key (ex \"jenni\"), - url : url (ex \"http://www.jennicam.org/webcam/cam.jpg\"), - refresh : refresh, in seconds (ex 120) - $0 <-l|--list> - List each url key in the bookmarks file (\"$bp\"). - $0 [-f|--full-screen] keys - Start feh in full-screen mode (aka --giblets-mom \"viewing\" mode). - $0 [-k|--keep-images] keys - Save each image in the current directory (aka --save-pr0n). - $0 [-g|--geometry] xxx - Use window geometry xxx (e.g. 640x480). - $0 [-v|--verbose] options - Start feh in verbose mode (feh -V). - $0 <-h|-?|--help> - Display usage information (this screen). - -Notes: -Thanks to giblet for feh, an awesome image and webcam viewing program, -and raster for Imlib2. -END_USAGE - exit(-1); -} - diff --git a/cam/gen-cam-menu b/cam/gen-cam-menu deleted file mode 100755 index 710070b..0000000 --- a/cam/gen-cam-menu +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -###################################################################### -# gen_cam_menu.sh 0.1 # -# by Paul Duncan <pabs@pablotron.org> # -# # -# This script will generate a menu of cam bookmarks for # -# Enlightenment DR0.16.x. TYou can safely run this script more than # -# once; it won't add an another entry to the left-click menu if it's # -# already been run once. It doesn't delete any existing menu # -# entries, and it backs up your existing menu files as well. (just # -# in case I screwed up.. hehe). THe two variables below allow you # -# rename the left-click menuitem, and the menu title. # -# # -# # -MENU_ITEM="Webcams"; # -MENU_TITLE="Webcam List"; # -BMARKS=$HOME"/.cam_bookmarks"; # -# # -###################################################################### - - -C_MENUFILE="webcam.menu"; -F_MENUFILE="file.menu"; -C_MENU=$HOME"/.enlightenment/"$C_MENUFILE; -F_MENU=$HOME"/.enlightenment/"$F_MENUFILE; - -# make backups, just in case -cp -f $C_MENU $C_MENU"-cam_menu.backup" -cp -f $F_MENU $F_MENU"-cam_menu.backup" - -echo "Note: gen-cam-menu will be removed from the feh distribution by 2013." > /dev/stderr -echo "Please mail derf@finalrewind.org if you still use it." > /dev/stderr - -# generate cam menu -echo "Generating \""$C_MENU"\"."; -echo "\"$TITLE\"" > "$C_MENU"; -cat $BMARKS | perl -e "while (<>) { /(.*?)=/; \$keys{\$1}=\"1\"; } foreach(sort keys %keys) { /(.)(.*$)/; print \"\\\"\".uc(\$1).\"\$2\\\" NULL exec \\\"feh-cam \$1\$2\\\"\\n\"; }">> $C_MENU; - -# add entry to file menu if there isn't one -echo "Generating \""$F_MENU"\"."; -perl -i -e "\$already_there=0; while (<>) { \$already_there++ if (/$MENU_ITEM/); print \"\\\"$MENU_ITEM\\\" NULL menu \\\"$C_MENUFILE\\\"\\n\" if (!\$already_there&&/Restart/); print; }" $F_MENU; - -echo "Done."; |